/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import * as components from "../components/index.js";
export const CreateExternalTestOutLessonType = {
    Powerpath100: "powerpath-100",
    Quiz: "quiz",
    TestOut: "test-out",
    Placement: "placement",
};
/** @internal */
export const CreateExternalTestOutRequest$inboundSchema = z.union([
    components.CreateExternalTestOutInput$inboundSchema.and(z.object({ lessonType: z.literal("test-out") }).transform((v) => ({
        lessonType: v.lessonType,
    }))),
    components.CreateExternalPlacementInput$inboundSchema.and(z.object({ lessonType: z.literal("placement") }).transform((v) => ({
        lessonType: v.lessonType,
    }))),
]);
/** @internal */
export const CreateExternalTestOutRequest$outboundSchema = z.union([
    components.CreateExternalTestOutInput$outboundSchema.and(z.object({ lessonType: z.literal("test-out") }).transform((v) => ({
        lessonType: v.lessonType,
    }))),
    components.CreateExternalPlacementInput$outboundSchema.and(z.object({ lessonType: z.literal("placement") }).transform((v) => ({
        lessonType: v.lessonType,
    }))),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateExternalTestOutRequest$;
(function (CreateExternalTestOutRequest$) {
    /** @deprecated use `CreateExternalTestOutRequest$inboundSchema` instead. */
    CreateExternalTestOutRequest$.inboundSchema = CreateExternalTestOutRequest$inboundSchema;
    /** @deprecated use `CreateExternalTestOutRequest$outboundSchema` instead. */
    CreateExternalTestOutRequest$.outboundSchema = CreateExternalTestOutRequest$outboundSchema;
})(CreateExternalTestOutRequest$ || (CreateExternalTestOutRequest$ = {}));
export function createExternalTestOutRequestToJSON(createExternalTestOutRequest) {
    return JSON.stringify(CreateExternalTestOutRequest$outboundSchema.parse(createExternalTestOutRequest));
}
export function createExternalTestOutRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateExternalTestOutRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateExternalTestOutRequest' from JSON`);
}
/** @internal */
export const CreateExternalTestOutLessonType$inboundSchema = z.nativeEnum(CreateExternalTestOutLessonType);
/** @internal */
export const CreateExternalTestOutLessonType$outboundSchema = CreateExternalTestOutLessonType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateExternalTestOutLessonType$;
(function (CreateExternalTestOutLessonType$) {
    /** @deprecated use `CreateExternalTestOutLessonType$inboundSchema` instead. */
    CreateExternalTestOutLessonType$.inboundSchema = CreateExternalTestOutLessonType$inboundSchema;
    /** @deprecated use `CreateExternalTestOutLessonType$outboundSchema` instead. */
    CreateExternalTestOutLessonType$.outboundSchema = CreateExternalTestOutLessonType$outboundSchema;
})(CreateExternalTestOutLessonType$ || (CreateExternalTestOutLessonType$ = {}));
/** @internal */
export const CreateExternalTestOutResponse$inboundSchema = z.object({
    lessonType: CreateExternalTestOutLessonType$inboundSchema,
    lessonId: z.string(),
    courseComponentId: z.string(),
    resourceId: z.string(),
    launchUrl: z.string().optional(),
    toolProvider: z.string(),
    vendorId: z.string(),
    courseIdOnFail: z.nullable(z.string()).optional(),
    grades: z.array(z.number()).optional(),
});
/** @internal */
export const CreateExternalTestOutResponse$outboundSchema = z.object({
    lessonType: CreateExternalTestOutLessonType$outboundSchema,
    lessonId: z.string(),
    courseComponentId: z.string(),
    resourceId: z.string(),
    launchUrl: z.string().optional(),
    toolProvider: z.string(),
    vendorId: z.string(),
    courseIdOnFail: z.nullable(z.string()).optional(),
    grades: z.array(z.number()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateExternalTestOutResponse$;
(function (CreateExternalTestOutResponse$) {
    /** @deprecated use `CreateExternalTestOutResponse$inboundSchema` instead. */
    CreateExternalTestOutResponse$.inboundSchema = CreateExternalTestOutResponse$inboundSchema;
    /** @deprecated use `CreateExternalTestOutResponse$outboundSchema` instead. */
    CreateExternalTestOutResponse$.outboundSchema = CreateExternalTestOutResponse$outboundSchema;
})(CreateExternalTestOutResponse$ || (CreateExternalTestOutResponse$ = {}));
export function createExternalTestOutResponseToJSON(createExternalTestOutResponse) {
    return JSON.stringify(CreateExternalTestOutResponse$outboundSchema.parse(createExternalTestOutResponse));
}
export function createExternalTestOutResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateExternalTestOutResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateExternalTestOutResponse' from JSON`);
}
//# sourceMappingURL=createexternaltestout.js.map