/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const LineItemStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
/** @internal */
export const LineItemStatus$inboundSchema = z.nativeEnum(LineItemStatus);
/** @internal */
export const LineItemStatus$outboundSchema = LineItemStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LineItemStatus$;
(function (LineItemStatus$) {
    /** @deprecated use `LineItemStatus$inboundSchema` instead. */
    LineItemStatus$.inboundSchema = LineItemStatus$inboundSchema;
    /** @deprecated use `LineItemStatus$outboundSchema` instead. */
    LineItemStatus$.outboundSchema = LineItemStatus$outboundSchema;
})(LineItemStatus$ || (LineItemStatus$ = {}));
/** @internal */
export const LineItemClass$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const LineItemClass$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 LineItemClass$;
(function (LineItemClass$) {
    /** @deprecated use `LineItemClass$inboundSchema` instead. */
    LineItemClass$.inboundSchema = LineItemClass$inboundSchema;
    /** @deprecated use `LineItemClass$outboundSchema` instead. */
    LineItemClass$.outboundSchema = LineItemClass$outboundSchema;
})(LineItemClass$ || (LineItemClass$ = {}));
export function lineItemClassToJSON(lineItemClass) {
    return JSON.stringify(LineItemClass$outboundSchema.parse(lineItemClass));
}
export function lineItemClassFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemClass$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemClass' from JSON`);
}
/** @internal */
export const LineItemSchool$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const LineItemSchool$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 LineItemSchool$;
(function (LineItemSchool$) {
    /** @deprecated use `LineItemSchool$inboundSchema` instead. */
    LineItemSchool$.inboundSchema = LineItemSchool$inboundSchema;
    /** @deprecated use `LineItemSchool$outboundSchema` instead. */
    LineItemSchool$.outboundSchema = LineItemSchool$outboundSchema;
})(LineItemSchool$ || (LineItemSchool$ = {}));
export function lineItemSchoolToJSON(lineItemSchool) {
    return JSON.stringify(LineItemSchool$outboundSchema.parse(lineItemSchool));
}
export function lineItemSchoolFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemSchool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemSchool' from JSON`);
}
/** @internal */
export const LineItemCategory$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const LineItemCategory$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 LineItemCategory$;
(function (LineItemCategory$) {
    /** @deprecated use `LineItemCategory$inboundSchema` instead. */
    LineItemCategory$.inboundSchema = LineItemCategory$inboundSchema;
    /** @deprecated use `LineItemCategory$outboundSchema` instead. */
    LineItemCategory$.outboundSchema = LineItemCategory$outboundSchema;
})(LineItemCategory$ || (LineItemCategory$ = {}));
export function lineItemCategoryToJSON(lineItemCategory) {
    return JSON.stringify(LineItemCategory$outboundSchema.parse(lineItemCategory));
}
export function lineItemCategoryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemCategory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemCategory' from JSON`);
}
/** @internal */
export const GradingPeriod$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const GradingPeriod$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 GradingPeriod$;
(function (GradingPeriod$) {
    /** @deprecated use `GradingPeriod$inboundSchema` instead. */
    GradingPeriod$.inboundSchema = GradingPeriod$inboundSchema;
    /** @deprecated use `GradingPeriod$outboundSchema` instead. */
    GradingPeriod$.outboundSchema = GradingPeriod$outboundSchema;
})(GradingPeriod$ || (GradingPeriod$ = {}));
export function gradingPeriodToJSON(gradingPeriod) {
    return JSON.stringify(GradingPeriod$outboundSchema.parse(gradingPeriod));
}
export function gradingPeriodFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GradingPeriod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GradingPeriod' from JSON`);
}
/** @internal */
export const LineItemAcademicSession$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const LineItemAcademicSession$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 LineItemAcademicSession$;
(function (LineItemAcademicSession$) {
    /** @deprecated use `LineItemAcademicSession$inboundSchema` instead. */
    LineItemAcademicSession$.inboundSchema = LineItemAcademicSession$inboundSchema;
    /** @deprecated use `LineItemAcademicSession$outboundSchema` instead. */
    LineItemAcademicSession$.outboundSchema = LineItemAcademicSession$outboundSchema;
})(LineItemAcademicSession$ || (LineItemAcademicSession$ = {}));
export function lineItemAcademicSessionToJSON(lineItemAcademicSession) {
    return JSON.stringify(LineItemAcademicSession$outboundSchema.parse(lineItemAcademicSession));
}
export function lineItemAcademicSessionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemAcademicSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemAcademicSession' from JSON`);
}
/** @internal */
export const LineItemScoreScale$inboundSchema = z.object({
    sourcedId: z.string(),
});
/** @internal */
export const LineItemScoreScale$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 LineItemScoreScale$;
(function (LineItemScoreScale$) {
    /** @deprecated use `LineItemScoreScale$inboundSchema` instead. */
    LineItemScoreScale$.inboundSchema = LineItemScoreScale$inboundSchema;
    /** @deprecated use `LineItemScoreScale$outboundSchema` instead. */
    LineItemScoreScale$.outboundSchema = LineItemScoreScale$outboundSchema;
})(LineItemScoreScale$ || (LineItemScoreScale$ = {}));
export function lineItemScoreScaleToJSON(lineItemScoreScale) {
    return JSON.stringify(LineItemScoreScale$outboundSchema.parse(lineItemScoreScale));
}
export function lineItemScoreScaleFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemScoreScale$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemScoreScale' from JSON`);
}
/** @internal */
export const LineItemLearningObjectiveId$inboundSchema = z.object({
    learningObjectiveId: z.string(),
    score: z.number().optional(),
    textScore: z.string().optional(),
});
/** @internal */
export const LineItemLearningObjectiveId$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 LineItemLearningObjectiveId$;
(function (LineItemLearningObjectiveId$) {
    /** @deprecated use `LineItemLearningObjectiveId$inboundSchema` instead. */
    LineItemLearningObjectiveId$.inboundSchema = LineItemLearningObjectiveId$inboundSchema;
    /** @deprecated use `LineItemLearningObjectiveId$outboundSchema` instead. */
    LineItemLearningObjectiveId$.outboundSchema = LineItemLearningObjectiveId$outboundSchema;
})(LineItemLearningObjectiveId$ || (LineItemLearningObjectiveId$ = {}));
export function lineItemLearningObjectiveIdToJSON(lineItemLearningObjectiveId) {
    return JSON.stringify(LineItemLearningObjectiveId$outboundSchema.parse(lineItemLearningObjectiveId));
}
export function lineItemLearningObjectiveIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemLearningObjectiveId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemLearningObjectiveId' from JSON`);
}
/** @internal */
export const LineItemLearningObjectiveSet$inboundSchema = z.object({
    source: z.string(),
    learningObjectiveIds: z.array(z.lazy(() => LineItemLearningObjectiveId$inboundSchema)),
});
/** @internal */
export const LineItemLearningObjectiveSet$outboundSchema = z.object({
    source: z.string(),
    learningObjectiveIds: z.array(z.lazy(() => LineItemLearningObjectiveId$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LineItemLearningObjectiveSet$;
(function (LineItemLearningObjectiveSet$) {
    /** @deprecated use `LineItemLearningObjectiveSet$inboundSchema` instead. */
    LineItemLearningObjectiveSet$.inboundSchema = LineItemLearningObjectiveSet$inboundSchema;
    /** @deprecated use `LineItemLearningObjectiveSet$outboundSchema` instead. */
    LineItemLearningObjectiveSet$.outboundSchema = LineItemLearningObjectiveSet$outboundSchema;
})(LineItemLearningObjectiveSet$ || (LineItemLearningObjectiveSet$ = {}));
export function lineItemLearningObjectiveSetToJSON(lineItemLearningObjectiveSet) {
    return JSON.stringify(LineItemLearningObjectiveSet$outboundSchema.parse(lineItemLearningObjectiveSet));
}
export function lineItemLearningObjectiveSetFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItemLearningObjectiveSet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItemLearningObjectiveSet' from JSON`);
}
/** @internal */
export const LineItem$inboundSchema = z.object({
    sourcedId: z.string().optional(),
    status: LineItemStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    description: z.nullable(z.string()).optional(),
    assignDate: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    dueDate: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    class: z.lazy(() => LineItemClass$inboundSchema),
    school: z.lazy(() => LineItemSchool$inboundSchema),
    category: z.lazy(() => LineItemCategory$inboundSchema),
    gradingPeriod: z.nullable(z.lazy(() => GradingPeriod$inboundSchema))
        .optional(),
    academicSession: z.nullable(z.lazy(() => LineItemAcademicSession$inboundSchema)).optional(),
    scoreScale: z.nullable(z.lazy(() => LineItemScoreScale$inboundSchema))
        .optional(),
    resultValueMin: z.nullable(z.number()).optional(),
    resultValueMax: z.nullable(z.number()).optional(),
    learningObjectiveSet: z.nullable(z.array(z.lazy(() => LineItemLearningObjectiveSet$inboundSchema))).optional(),
});
/** @internal */
export const LineItem$outboundSchema = z.object({
    sourcedId: z.string().optional(),
    status: LineItemStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    description: z.nullable(z.string()).optional(),
    assignDate: z.date().transform(v => v.toISOString()),
    dueDate: z.date().transform(v => v.toISOString()),
    class: z.lazy(() => LineItemClass$outboundSchema),
    school: z.lazy(() => LineItemSchool$outboundSchema),
    category: z.lazy(() => LineItemCategory$outboundSchema),
    gradingPeriod: z.nullable(z.lazy(() => GradingPeriod$outboundSchema))
        .optional(),
    academicSession: z.nullable(z.lazy(() => LineItemAcademicSession$outboundSchema)).optional(),
    scoreScale: z.nullable(z.lazy(() => LineItemScoreScale$outboundSchema))
        .optional(),
    resultValueMin: z.nullable(z.number()).optional(),
    resultValueMax: z.nullable(z.number()).optional(),
    learningObjectiveSet: z.nullable(z.array(z.lazy(() => LineItemLearningObjectiveSet$outboundSchema))).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LineItem$;
(function (LineItem$) {
    /** @deprecated use `LineItem$inboundSchema` instead. */
    LineItem$.inboundSchema = LineItem$inboundSchema;
    /** @deprecated use `LineItem$outboundSchema` instead. */
    LineItem$.outboundSchema = LineItem$outboundSchema;
})(LineItem$ || (LineItem$ = {}));
export function lineItemToJSON(lineItem) {
    return JSON.stringify(LineItem$outboundSchema.parse(lineItem));
}
export function lineItemFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItem' from JSON`);
}
//# sourceMappingURL=lineitem.js.map