/*
 * 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 GetAttemptsScoreStatus = {
    Exempt: "exempt",
    FullyGraded: "fully graded",
    NotSubmitted: "not submitted",
    PartiallyGraded: "partially graded",
    Submitted: "submitted",
};
/** @internal */
export const GetAttemptsRequest$inboundSchema = z.object({
    student: z.string(),
    lesson: z.string(),
});
/** @internal */
export const GetAttemptsRequest$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 GetAttemptsRequest$;
(function (GetAttemptsRequest$) {
    /** @deprecated use `GetAttemptsRequest$inboundSchema` instead. */
    GetAttemptsRequest$.inboundSchema = GetAttemptsRequest$inboundSchema;
    /** @deprecated use `GetAttemptsRequest$outboundSchema` instead. */
    GetAttemptsRequest$.outboundSchema = GetAttemptsRequest$outboundSchema;
})(GetAttemptsRequest$ || (GetAttemptsRequest$ = {}));
export function getAttemptsRequestToJSON(getAttemptsRequest) {
    return JSON.stringify(GetAttemptsRequest$outboundSchema.parse(getAttemptsRequest));
}
export function getAttemptsRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAttemptsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAttemptsRequest' from JSON`);
}
/** @internal */
export const GetAttemptsScoreStatus$inboundSchema = z.nativeEnum(GetAttemptsScoreStatus);
/** @internal */
export const GetAttemptsScoreStatus$outboundSchema = GetAttemptsScoreStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAttemptsScoreStatus$;
(function (GetAttemptsScoreStatus$) {
    /** @deprecated use `GetAttemptsScoreStatus$inboundSchema` instead. */
    GetAttemptsScoreStatus$.inboundSchema = GetAttemptsScoreStatus$inboundSchema;
    /** @deprecated use `GetAttemptsScoreStatus$outboundSchema` instead. */
    GetAttemptsScoreStatus$.outboundSchema = GetAttemptsScoreStatus$outboundSchema;
})(GetAttemptsScoreStatus$ || (GetAttemptsScoreStatus$ = {}));
/** @internal */
export const GetAttemptsAttempt$inboundSchema = z.object({
    attempt: z.nullable(z.number()),
    score: z.number(),
    scoreStatus: GetAttemptsScoreStatus$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 GetAttemptsAttempt$outboundSchema = z.object({
    attempt: z.nullable(z.number()),
    score: z.number(),
    scoreStatus: GetAttemptsScoreStatus$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 GetAttemptsAttempt$;
(function (GetAttemptsAttempt$) {
    /** @deprecated use `GetAttemptsAttempt$inboundSchema` instead. */
    GetAttemptsAttempt$.inboundSchema = GetAttemptsAttempt$inboundSchema;
    /** @deprecated use `GetAttemptsAttempt$outboundSchema` instead. */
    GetAttemptsAttempt$.outboundSchema = GetAttemptsAttempt$outboundSchema;
})(GetAttemptsAttempt$ || (GetAttemptsAttempt$ = {}));
export function getAttemptsAttemptToJSON(getAttemptsAttempt) {
    return JSON.stringify(GetAttemptsAttempt$outboundSchema.parse(getAttemptsAttempt));
}
export function getAttemptsAttemptFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAttemptsAttempt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAttemptsAttempt' from JSON`);
}
/** @internal */
export const GetAttemptsResponse$inboundSchema = z.object({
    attempts: z.array(z.lazy(() => GetAttemptsAttempt$inboundSchema)),
});
/** @internal */
export const GetAttemptsResponse$outboundSchema = z.object({
    attempts: z.array(z.lazy(() => GetAttemptsAttempt$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAttemptsResponse$;
(function (GetAttemptsResponse$) {
    /** @deprecated use `GetAttemptsResponse$inboundSchema` instead. */
    GetAttemptsResponse$.inboundSchema = GetAttemptsResponse$inboundSchema;
    /** @deprecated use `GetAttemptsResponse$outboundSchema` instead. */
    GetAttemptsResponse$.outboundSchema = GetAttemptsResponse$outboundSchema;
})(GetAttemptsResponse$ || (GetAttemptsResponse$ = {}));
export function getAttemptsResponseToJSON(getAttemptsResponse) {
    return JSON.stringify(GetAttemptsResponse$outboundSchema.parse(getAttemptsResponse));
}
export function getAttemptsResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAttemptsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAttemptsResponse' from JSON`);
}
//# sourceMappingURL=getattempts.js.map