/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const AcademicSessionStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
export const AcademicSessionType = {
    GradingPeriod: "gradingPeriod",
    Semester: "semester",
    SchoolYear: "schoolYear",
    Term: "term",
};
export const ParentType = {
    AcademicSession: "academicSession",
    AssessmentLineItem: "assessmentLineItem",
    Category: "category",
    Class: "class",
    Course: "course",
    Demographics: "demographics",
    Enrollment: "enrollment",
    GradingPeriod: "gradingPeriod",
    LineItem: "lineItem",
    Org: "org",
    Resource: "resource",
    Result: "result",
    ScoreScale: "scoreScale",
    Student: "student",
    Teacher: "teacher",
    Term: "term",
    User: "user",
    ComponentResource: "componentResource",
    CourseComponent: "courseComponent",
};
export const OrgType2 = {
    AcademicSession: "academicSession",
    AssessmentLineItem: "assessmentLineItem",
    Category: "category",
    Class: "class",
    Course: "course",
    Demographics: "demographics",
    Enrollment: "enrollment",
    GradingPeriod: "gradingPeriod",
    LineItem: "lineItem",
    Org: "org",
    Resource: "resource",
    Result: "result",
    ScoreScale: "scoreScale",
    Student: "student",
    Teacher: "teacher",
    Term: "term",
    User: "user",
    ComponentResource: "componentResource",
    CourseComponent: "courseComponent",
};
/** @internal */
export const AcademicSessionStatus$inboundSchema = z.nativeEnum(AcademicSessionStatus);
/** @internal */
export const AcademicSessionStatus$outboundSchema = AcademicSessionStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AcademicSessionStatus$;
(function (AcademicSessionStatus$) {
    /** @deprecated use `AcademicSessionStatus$inboundSchema` instead. */
    AcademicSessionStatus$.inboundSchema = AcademicSessionStatus$inboundSchema;
    /** @deprecated use `AcademicSessionStatus$outboundSchema` instead. */
    AcademicSessionStatus$.outboundSchema = AcademicSessionStatus$outboundSchema;
})(AcademicSessionStatus$ || (AcademicSessionStatus$ = {}));
/** @internal */
export const AcademicSessionType$inboundSchema = z.nativeEnum(AcademicSessionType);
/** @internal */
export const AcademicSessionType$outboundSchema = AcademicSessionType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AcademicSessionType$;
(function (AcademicSessionType$) {
    /** @deprecated use `AcademicSessionType$inboundSchema` instead. */
    AcademicSessionType$.inboundSchema = AcademicSessionType$inboundSchema;
    /** @deprecated use `AcademicSessionType$outboundSchema` instead. */
    AcademicSessionType$.outboundSchema = AcademicSessionType$outboundSchema;
})(AcademicSessionType$ || (AcademicSessionType$ = {}));
/** @internal */
export const ParentType$inboundSchema = z
    .nativeEnum(ParentType);
/** @internal */
export const ParentType$outboundSchema = ParentType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ParentType$;
(function (ParentType$) {
    /** @deprecated use `ParentType$inboundSchema` instead. */
    ParentType$.inboundSchema = ParentType$inboundSchema;
    /** @deprecated use `ParentType$outboundSchema` instead. */
    ParentType$.outboundSchema = ParentType$outboundSchema;
})(ParentType$ || (ParentType$ = {}));
/** @internal */
export const AcademicSessionParent$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: ParentType$inboundSchema,
});
/** @internal */
export const AcademicSessionParent$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: ParentType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AcademicSessionParent$;
(function (AcademicSessionParent$) {
    /** @deprecated use `AcademicSessionParent$inboundSchema` instead. */
    AcademicSessionParent$.inboundSchema = AcademicSessionParent$inboundSchema;
    /** @deprecated use `AcademicSessionParent$outboundSchema` instead. */
    AcademicSessionParent$.outboundSchema = AcademicSessionParent$outboundSchema;
})(AcademicSessionParent$ || (AcademicSessionParent$ = {}));
export function academicSessionParentToJSON(academicSessionParent) {
    return JSON.stringify(AcademicSessionParent$outboundSchema.parse(academicSessionParent));
}
export function academicSessionParentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AcademicSessionParent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcademicSessionParent' from JSON`);
}
/** @internal */
export const OrgType2$inboundSchema = z
    .nativeEnum(OrgType2);
/** @internal */
export const OrgType2$outboundSchema = OrgType2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var OrgType2$;
(function (OrgType2$) {
    /** @deprecated use `OrgType2$inboundSchema` instead. */
    OrgType2$.inboundSchema = OrgType2$inboundSchema;
    /** @deprecated use `OrgType2$outboundSchema` instead. */
    OrgType2$.outboundSchema = OrgType2$outboundSchema;
})(OrgType2$ || (OrgType2$ = {}));
/** @internal */
export const AcademicSessionOrg$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: OrgType2$inboundSchema,
});
/** @internal */
export const AcademicSessionOrg$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: OrgType2$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AcademicSessionOrg$;
(function (AcademicSessionOrg$) {
    /** @deprecated use `AcademicSessionOrg$inboundSchema` instead. */
    AcademicSessionOrg$.inboundSchema = AcademicSessionOrg$inboundSchema;
    /** @deprecated use `AcademicSessionOrg$outboundSchema` instead. */
    AcademicSessionOrg$.outboundSchema = AcademicSessionOrg$outboundSchema;
})(AcademicSessionOrg$ || (AcademicSessionOrg$ = {}));
export function academicSessionOrgToJSON(academicSessionOrg) {
    return JSON.stringify(AcademicSessionOrg$outboundSchema.parse(academicSessionOrg));
}
export function academicSessionOrgFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AcademicSessionOrg$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcademicSessionOrg' from JSON`);
}
/** @internal */
export const AcademicSession$inboundSchema = z.object({
    sourcedId: z.string(),
    status: AcademicSessionStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    startDate: z.string(),
    endDate: z.string(),
    type: AcademicSessionType$inboundSchema,
    parent: z.nullable(z.lazy(() => AcademicSessionParent$inboundSchema))
        .optional(),
    schoolYear: z.number(),
    org: z.lazy(() => AcademicSessionOrg$inboundSchema),
});
/** @internal */
export const AcademicSession$outboundSchema = z.object({
    sourcedId: z.string(),
    status: AcademicSessionStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    startDate: z.string(),
    endDate: z.string(),
    type: AcademicSessionType$outboundSchema,
    parent: z.nullable(z.lazy(() => AcademicSessionParent$outboundSchema))
        .optional(),
    schoolYear: z.number(),
    org: z.lazy(() => AcademicSessionOrg$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AcademicSession$;
(function (AcademicSession$) {
    /** @deprecated use `AcademicSession$inboundSchema` instead. */
    AcademicSession$.inboundSchema = AcademicSession$inboundSchema;
    /** @deprecated use `AcademicSession$outboundSchema` instead. */
    AcademicSession$.outboundSchema = AcademicSession$outboundSchema;
})(AcademicSession$ || (AcademicSession$ = {}));
export function academicSessionToJSON(academicSession) {
    return JSON.stringify(AcademicSession$outboundSchema.parse(academicSession));
}
export function academicSessionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AcademicSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcademicSession' from JSON`);
}
//# sourceMappingURL=academicsession.js.map