/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
/**
 * The status of this attempt
 */
export const CreateNewAttemptScoreStatus = {
    Exempt: "exempt",
    FullyGraded: "fully graded",
    NotSubmitted: "not submitted",
    PartiallyGraded: "partially graded",
    Submitted: "submitted",
};
/** @internal */
export const CreateNewAttemptRequest$inboundSchema = z.object({
    student: z.string(),
    lesson: z.string(),
});
/** @internal */
export const CreateNewAttemptRequest$outboundSchema = z.object({
    student: z.string(),
    lesson: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateNewAttemptRequest$;
(function (CreateNewAttemptRequest$) {
    /** @deprecated use `CreateNewAttemptRequest$inboundSchema` instead. */
    CreateNewAttemptRequest$.inboundSchema = CreateNewAttemptRequest$inboundSchema;
    /** @deprecated use `CreateNewAttemptRequest$outboundSchema` instead. */
    CreateNewAttemptRequest$.outboundSchema = CreateNewAttemptRequest$outboundSchema;
})(CreateNewAttemptRequest$ || (CreateNewAttemptRequest$ = {}));
export function createNewAttemptRequestToJSON(createNewAttemptRequest) {
    return JSON.stringify(CreateNewAttemptRequest$outboundSchema.parse(createNewAttemptRequest));
}
export function createNewAttemptRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateNewAttemptRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateNewAttemptRequest' from JSON`);
}
/** @internal */
export const CreateNewAttemptScoreStatus$inboundSchema = z.nativeEnum(CreateNewAttemptScoreStatus);
/** @internal */
export const CreateNewAttemptScoreStatus$outboundSchema = CreateNewAttemptScoreStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateNewAttemptScoreStatus$;
(function (CreateNewAttemptScoreStatus$) {
    /** @deprecated use `CreateNewAttemptScoreStatus$inboundSchema` instead. */
    CreateNewAttemptScoreStatus$.inboundSchema = CreateNewAttemptScoreStatus$inboundSchema;
    /** @deprecated use `CreateNewAttemptScoreStatus$outboundSchema` instead. */
    CreateNewAttemptScoreStatus$.outboundSchema = CreateNewAttemptScoreStatus$outboundSchema;
})(CreateNewAttemptScoreStatus$ || (CreateNewAttemptScoreStatus$ = {}));
/** @internal */
export const CreateNewAttemptAttempt$inboundSchema = z.object({
    attempt: z.nullable(z.number()),
    score: z.number(),
    scoreStatus: CreateNewAttemptScoreStatus$inboundSchema,
    startedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))),
    completedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))),
});
/** @internal */
export const CreateNewAttemptAttempt$outboundSchema = z.object({
    attempt: z.nullable(z.number()),
    score: z.number(),
    scoreStatus: CreateNewAttemptScoreStatus$outboundSchema,
    startedAt: z.nullable(z.date().transform(v => v.toISOString())),
    completedAt: z.nullable(z.date().transform(v => v.toISOString())),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateNewAttemptAttempt$;
(function (CreateNewAttemptAttempt$) {
    /** @deprecated use `CreateNewAttemptAttempt$inboundSchema` instead. */
    CreateNewAttemptAttempt$.inboundSchema = CreateNewAttemptAttempt$inboundSchema;
    /** @deprecated use `CreateNewAttemptAttempt$outboundSchema` instead. */
    CreateNewAttemptAttempt$.outboundSchema = CreateNewAttemptAttempt$outboundSchema;
})(CreateNewAttemptAttempt$ || (CreateNewAttemptAttempt$ = {}));
export function createNewAttemptAttemptToJSON(createNewAttemptAttempt) {
    return JSON.stringify(CreateNewAttemptAttempt$outboundSchema.parse(createNewAttemptAttempt));
}
export function createNewAttemptAttemptFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateNewAttemptAttempt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateNewAttemptAttempt' from JSON`);
}
/** @internal */
export const CreateNewAttemptResponse$inboundSchema = z.object({
    attempt: z.lazy(() => CreateNewAttemptAttempt$inboundSchema),
});
/** @internal */
export const CreateNewAttemptResponse$outboundSchema = z.object({
    attempt: z.lazy(() => CreateNewAttemptAttempt$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateNewAttemptResponse$;
(function (CreateNewAttemptResponse$) {
    /** @deprecated use `CreateNewAttemptResponse$inboundSchema` instead. */
    CreateNewAttemptResponse$.inboundSchema = CreateNewAttemptResponse$inboundSchema;
    /** @deprecated use `CreateNewAttemptResponse$outboundSchema` instead. */
    CreateNewAttemptResponse$.outboundSchema = CreateNewAttemptResponse$outboundSchema;
})(CreateNewAttemptResponse$ || (CreateNewAttemptResponse$ = {}));
export function createNewAttemptResponseToJSON(createNewAttemptResponse) {
    return JSON.stringify(CreateNewAttemptResponse$outboundSchema.parse(createNewAttemptResponse));
}
export function createNewAttemptResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateNewAttemptResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateNewAttemptResponse' from JSON`);
}
//# sourceMappingURL=createnewattempt.js.map