/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const ClassStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
export const ClassType = {
    Homeroom: "homeroom",
    Scheduled: "scheduled",
};
/** @internal */
export const ClassStatus$inboundSchema = z
    .nativeEnum(ClassStatus);
/** @internal */
export const ClassStatus$outboundSchema = ClassStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ClassStatus$;
(function (ClassStatus$) {
    /** @deprecated use `ClassStatus$inboundSchema` instead. */
    ClassStatus$.inboundSchema = ClassStatus$inboundSchema;
    /** @deprecated use `ClassStatus$outboundSchema` instead. */
    ClassStatus$.outboundSchema = ClassStatus$outboundSchema;
})(ClassStatus$ || (ClassStatus$ = {}));
/** @internal */
export const ClassType$inboundSchema = z
    .nativeEnum(ClassType);
/** @internal */
export const ClassType$outboundSchema = ClassType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ClassType$;
(function (ClassType$) {
    /** @deprecated use `ClassType$inboundSchema` instead. */
    ClassType$.inboundSchema = ClassType$inboundSchema;
    /** @deprecated use `ClassType$outboundSchema` instead. */
    ClassType$.outboundSchema = ClassType$outboundSchema;
})(ClassType$ || (ClassType$ = {}));
/** @internal */
export const ClassCourse$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
export const ClassCourse$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: 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 ClassCourse$;
(function (ClassCourse$) {
    /** @deprecated use `ClassCourse$inboundSchema` instead. */
    ClassCourse$.inboundSchema = ClassCourse$inboundSchema;
    /** @deprecated use `ClassCourse$outboundSchema` instead. */
    ClassCourse$.outboundSchema = ClassCourse$outboundSchema;
})(ClassCourse$ || (ClassCourse$ = {}));
export function classCourseToJSON(classCourse) {
    return JSON.stringify(ClassCourse$outboundSchema.parse(classCourse));
}
export function classCourseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ClassCourse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassCourse' from JSON`);
}
/** @internal */
export const ClassSchool$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
export const ClassSchool$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: 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 ClassSchool$;
(function (ClassSchool$) {
    /** @deprecated use `ClassSchool$inboundSchema` instead. */
    ClassSchool$.inboundSchema = ClassSchool$inboundSchema;
    /** @deprecated use `ClassSchool$outboundSchema` instead. */
    ClassSchool$.outboundSchema = ClassSchool$outboundSchema;
})(ClassSchool$ || (ClassSchool$ = {}));
export function classSchoolToJSON(classSchool) {
    return JSON.stringify(ClassSchool$outboundSchema.parse(classSchool));
}
export function classSchoolFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ClassSchool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassSchool' from JSON`);
}
/** @internal */
export const Term$inboundSchema = z
    .object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
export const Term$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: 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 Term$;
(function (Term$) {
    /** @deprecated use `Term$inboundSchema` instead. */
    Term$.inboundSchema = Term$inboundSchema;
    /** @deprecated use `Term$outboundSchema` instead. */
    Term$.outboundSchema = Term$outboundSchema;
})(Term$ || (Term$ = {}));
export function termToJSON(term) {
    return JSON.stringify(Term$outboundSchema.parse(term));
}
export function termFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Term$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Term' from JSON`);
}
/** @internal */
export const ClassResource$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
export const ClassResource$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: 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 ClassResource$;
(function (ClassResource$) {
    /** @deprecated use `ClassResource$inboundSchema` instead. */
    ClassResource$.inboundSchema = ClassResource$inboundSchema;
    /** @deprecated use `ClassResource$outboundSchema` instead. */
    ClassResource$.outboundSchema = ClassResource$outboundSchema;
})(ClassResource$ || (ClassResource$ = {}));
export function classResourceToJSON(classResource) {
    return JSON.stringify(ClassResource$outboundSchema.parse(classResource));
}
export function classResourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ClassResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassResource' from JSON`);
}
/** @internal */
export const Class$inboundSchema = z
    .object({
    sourcedId: z.string(),
    status: ClassStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    classCode: z.nullable(z.string()),
    classType: ClassType$inboundSchema,
    location: z.nullable(z.string()),
    grades: z.array(z.string()).optional(),
    subjects: z.array(z.string()).optional(),
    course: z.nullable(z.lazy(() => ClassCourse$inboundSchema)),
    school: z.nullable(z.lazy(() => ClassSchool$inboundSchema)),
    terms: z.array(z.lazy(() => Term$inboundSchema)),
    subjectCodes: z.array(z.string()).optional(),
    periods: z.array(z.string()).optional(),
    resources: z.array(z.lazy(() => ClassResource$inboundSchema)).optional(),
});
/** @internal */
export const Class$outboundSchema = z.object({
    sourcedId: z.string(),
    status: ClassStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    classCode: z.nullable(z.string()),
    classType: ClassType$outboundSchema,
    location: z.nullable(z.string()),
    grades: z.array(z.string()).optional(),
    subjects: z.array(z.string()).optional(),
    course: z.nullable(z.lazy(() => ClassCourse$outboundSchema)),
    school: z.nullable(z.lazy(() => ClassSchool$outboundSchema)),
    terms: z.array(z.lazy(() => Term$outboundSchema)),
    subjectCodes: z.array(z.string()).optional(),
    periods: z.array(z.string()).optional(),
    resources: z.array(z.lazy(() => ClassResource$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 Class$;
(function (Class$) {
    /** @deprecated use `Class$inboundSchema` instead. */
    Class$.inboundSchema = Class$inboundSchema;
    /** @deprecated use `Class$outboundSchema` instead. */
    Class$.outboundSchema = Class$outboundSchema;
})(Class$ || (Class$ = {}));
export function classToJSON(value) {
    return JSON.stringify(Class$outboundSchema.parse(value));
}
export function classFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Class$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Class' from JSON`);
}
//# sourceMappingURL=class.js.map