/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const ResultStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
export const ResultScoreStatus = {
    Exempt: "exempt",
    FullyGraded: "fully graded",
    NotSubmitted: "not submitted",
    PartiallyGraded: "partially graded",
    Submitted: "submitted",
};
/** @internal */
export const ResultStatus$inboundSchema = z.nativeEnum(ResultStatus);
/** @internal */
export const ResultStatus$outboundSchema = ResultStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResultStatus$;
(function (ResultStatus$) {
    /** @deprecated use `ResultStatus$inboundSchema` instead. */
    ResultStatus$.inboundSchema = ResultStatus$inboundSchema;
    /** @deprecated use `ResultStatus$outboundSchema` instead. */
    ResultStatus$.outboundSchema = ResultStatus$outboundSchema;
})(ResultStatus$ || (ResultStatus$ = {}));
/** @internal */
export const ResultLineItem$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const ResultLineItem$outboundSchema = z.object({
    sourcedId: 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 ResultLineItem$;
(function (ResultLineItem$) {
    /** @deprecated use `ResultLineItem$inboundSchema` instead. */
    ResultLineItem$.inboundSchema = ResultLineItem$inboundSchema;
    /** @deprecated use `ResultLineItem$outboundSchema` instead. */
    ResultLineItem$.outboundSchema = ResultLineItem$outboundSchema;
})(ResultLineItem$ || (ResultLineItem$ = {}));
export function resultLineItemToJSON(resultLineItem) {
    return JSON.stringify(ResultLineItem$outboundSchema.parse(resultLineItem));
}
export function resultLineItemFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultLineItem' from JSON`);
}
/** @internal */
export const ResultStudent$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const ResultStudent$outboundSchema = z.object({
    sourcedId: 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 ResultStudent$;
(function (ResultStudent$) {
    /** @deprecated use `ResultStudent$inboundSchema` instead. */
    ResultStudent$.inboundSchema = ResultStudent$inboundSchema;
    /** @deprecated use `ResultStudent$outboundSchema` instead. */
    ResultStudent$.outboundSchema = ResultStudent$outboundSchema;
})(ResultStudent$ || (ResultStudent$ = {}));
export function resultStudentToJSON(resultStudent) {
    return JSON.stringify(ResultStudent$outboundSchema.parse(resultStudent));
}
export function resultStudentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultStudent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultStudent' from JSON`);
}
/** @internal */
export const ResultClass$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const ResultClass$outboundSchema = z.object({
    sourcedId: 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 ResultClass$;
(function (ResultClass$) {
    /** @deprecated use `ResultClass$inboundSchema` instead. */
    ResultClass$.inboundSchema = ResultClass$inboundSchema;
    /** @deprecated use `ResultClass$outboundSchema` instead. */
    ResultClass$.outboundSchema = ResultClass$outboundSchema;
})(ResultClass$ || (ResultClass$ = {}));
export function resultClassToJSON(resultClass) {
    return JSON.stringify(ResultClass$outboundSchema.parse(resultClass));
}
export function resultClassFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultClass$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultClass' from JSON`);
}
/** @internal */
export const ResultScoreScale$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const ResultScoreScale$outboundSchema = z.object({
    sourcedId: 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 ResultScoreScale$;
(function (ResultScoreScale$) {
    /** @deprecated use `ResultScoreScale$inboundSchema` instead. */
    ResultScoreScale$.inboundSchema = ResultScoreScale$inboundSchema;
    /** @deprecated use `ResultScoreScale$outboundSchema` instead. */
    ResultScoreScale$.outboundSchema = ResultScoreScale$outboundSchema;
})(ResultScoreScale$ || (ResultScoreScale$ = {}));
export function resultScoreScaleToJSON(resultScoreScale) {
    return JSON.stringify(ResultScoreScale$outboundSchema.parse(resultScoreScale));
}
export function resultScoreScaleFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultScoreScale$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultScoreScale' from JSON`);
}
/** @internal */
export const ResultScoreStatus$inboundSchema = z.nativeEnum(ResultScoreStatus);
/** @internal */
export const ResultScoreStatus$outboundSchema = ResultScoreStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResultScoreStatus$;
(function (ResultScoreStatus$) {
    /** @deprecated use `ResultScoreStatus$inboundSchema` instead. */
    ResultScoreStatus$.inboundSchema = ResultScoreStatus$inboundSchema;
    /** @deprecated use `ResultScoreStatus$outboundSchema` instead. */
    ResultScoreStatus$.outboundSchema = ResultScoreStatus$outboundSchema;
})(ResultScoreStatus$ || (ResultScoreStatus$ = {}));
/** @internal */
export const ResultLearningObjectiveId$inboundSchema = z.object({
    learningObjectiveId: z.string(),
    score: z.number().optional(),
    textScore: z.string().optional(),
});
/** @internal */
export const ResultLearningObjectiveId$outboundSchema = z.object({
    learningObjectiveId: z.string(),
    score: z.number().optional(),
    textScore: z.string().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResultLearningObjectiveId$;
(function (ResultLearningObjectiveId$) {
    /** @deprecated use `ResultLearningObjectiveId$inboundSchema` instead. */
    ResultLearningObjectiveId$.inboundSchema = ResultLearningObjectiveId$inboundSchema;
    /** @deprecated use `ResultLearningObjectiveId$outboundSchema` instead. */
    ResultLearningObjectiveId$.outboundSchema = ResultLearningObjectiveId$outboundSchema;
})(ResultLearningObjectiveId$ || (ResultLearningObjectiveId$ = {}));
export function resultLearningObjectiveIdToJSON(resultLearningObjectiveId) {
    return JSON.stringify(ResultLearningObjectiveId$outboundSchema.parse(resultLearningObjectiveId));
}
export function resultLearningObjectiveIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultLearningObjectiveId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultLearningObjectiveId' from JSON`);
}
/** @internal */
export const ResultLearningObjectiveSet$inboundSchema = z.object({
    source: z.string(),
    learningObjectiveIds: z.array(z.lazy(() => ResultLearningObjectiveId$inboundSchema)),
});
/** @internal */
export const ResultLearningObjectiveSet$outboundSchema = z.object({
    source: z.string(),
    learningObjectiveIds: z.array(z.lazy(() => ResultLearningObjectiveId$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResultLearningObjectiveSet$;
(function (ResultLearningObjectiveSet$) {
    /** @deprecated use `ResultLearningObjectiveSet$inboundSchema` instead. */
    ResultLearningObjectiveSet$.inboundSchema = ResultLearningObjectiveSet$inboundSchema;
    /** @deprecated use `ResultLearningObjectiveSet$outboundSchema` instead. */
    ResultLearningObjectiveSet$.outboundSchema = ResultLearningObjectiveSet$outboundSchema;
})(ResultLearningObjectiveSet$ || (ResultLearningObjectiveSet$ = {}));
export function resultLearningObjectiveSetToJSON(resultLearningObjectiveSet) {
    return JSON.stringify(ResultLearningObjectiveSet$outboundSchema.parse(resultLearningObjectiveSet));
}
export function resultLearningObjectiveSetFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResultLearningObjectiveSet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultLearningObjectiveSet' from JSON`);
}
/** @internal */
export const Result$inboundSchema = z
    .object({
    sourcedId: z.string().optional(),
    status: ResultStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    lineItem: z.lazy(() => ResultLineItem$inboundSchema),
    student: z.lazy(() => ResultStudent$inboundSchema),
    class: z.nullable(z.lazy(() => ResultClass$inboundSchema)).optional(),
    scoreScale: z.nullable(z.lazy(() => ResultScoreScale$inboundSchema))
        .optional(),
    scoreStatus: ResultScoreStatus$inboundSchema,
    score: z.nullable(z.number()).optional(),
    textScore: z.nullable(z.string()).optional(),
    scoreDate: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    comment: z.nullable(z.string()).optional(),
    learningObjectiveSet: z.nullable(z.array(z.lazy(() => ResultLearningObjectiveSet$inboundSchema))).optional(),
    inProgress: z.string().optional(),
    incomplete: z.string().optional(),
    late: z.string().optional(),
    missing: z.string().optional(),
});
/** @internal */
export const Result$outboundSchema = z.object({
    sourcedId: z.string().optional(),
    status: ResultStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    lineItem: z.lazy(() => ResultLineItem$outboundSchema),
    student: z.lazy(() => ResultStudent$outboundSchema),
    class: z.nullable(z.lazy(() => ResultClass$outboundSchema)).optional(),
    scoreScale: z.nullable(z.lazy(() => ResultScoreScale$outboundSchema))
        .optional(),
    scoreStatus: ResultScoreStatus$outboundSchema,
    score: z.nullable(z.number()).optional(),
    textScore: z.nullable(z.string()).optional(),
    scoreDate: z.date().transform(v => v.toISOString()),
    comment: z.nullable(z.string()).optional(),
    learningObjectiveSet: z.nullable(z.array(z.lazy(() => ResultLearningObjectiveSet$outboundSchema))).optional(),
    inProgress: z.string().optional(),
    incomplete: z.string().optional(),
    late: z.string().optional(),
    missing: z.string().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Result$;
(function (Result$) {
    /** @deprecated use `Result$inboundSchema` instead. */
    Result$.inboundSchema = Result$inboundSchema;
    /** @deprecated use `Result$outboundSchema` instead. */
    Result$.outboundSchema = Result$outboundSchema;
})(Result$ || (Result$ = {}));
export function resultToJSON(result) {
    return JSON.stringify(Result$outboundSchema.parse(result));
}
export function resultFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Result$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Result' from JSON`);
}
//# sourceMappingURL=result.js.map