"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Class$ = exports.Class$outboundSchema = exports.Class$inboundSchema = exports.ClassResource$ = exports.ClassResource$outboundSchema = exports.ClassResource$inboundSchema = exports.Term$ = exports.Term$outboundSchema = exports.Term$inboundSchema = exports.ClassSchool$ = exports.ClassSchool$outboundSchema = exports.ClassSchool$inboundSchema = exports.ClassCourse$ = exports.ClassCourse$outboundSchema = exports.ClassCourse$inboundSchema = exports.ClassType$ = exports.ClassType$outboundSchema = exports.ClassType$inboundSchema = exports.ClassStatus$ = exports.ClassStatus$outboundSchema = exports.ClassStatus$inboundSchema = exports.ClassType = exports.ClassStatus = void 0;
exports.classCourseToJSON = classCourseToJSON;
exports.classCourseFromJSON = classCourseFromJSON;
exports.classSchoolToJSON = classSchoolToJSON;
exports.classSchoolFromJSON = classSchoolFromJSON;
exports.termToJSON = termToJSON;
exports.termFromJSON = termFromJSON;
exports.classResourceToJSON = classResourceToJSON;
exports.classResourceFromJSON = classResourceFromJSON;
exports.classToJSON = classToJSON;
exports.classFromJSON = classFromJSON;
const z = __importStar(require("zod"));
const schemas_js_1 = require("../../lib/schemas.js");
exports.ClassStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
exports.ClassType = {
    Homeroom: "homeroom",
    Scheduled: "scheduled",
};
/** @internal */
exports.ClassStatus$inboundSchema = z
    .nativeEnum(exports.ClassStatus);
/** @internal */
exports.ClassStatus$outboundSchema = exports.ClassStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ClassStatus$;
(function (ClassStatus$) {
    /** @deprecated use `ClassStatus$inboundSchema` instead. */
    ClassStatus$.inboundSchema = exports.ClassStatus$inboundSchema;
    /** @deprecated use `ClassStatus$outboundSchema` instead. */
    ClassStatus$.outboundSchema = exports.ClassStatus$outboundSchema;
})(ClassStatus$ || (exports.ClassStatus$ = ClassStatus$ = {}));
/** @internal */
exports.ClassType$inboundSchema = z
    .nativeEnum(exports.ClassType);
/** @internal */
exports.ClassType$outboundSchema = exports.ClassType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ClassType$;
(function (ClassType$) {
    /** @deprecated use `ClassType$inboundSchema` instead. */
    ClassType$.inboundSchema = exports.ClassType$inboundSchema;
    /** @deprecated use `ClassType$outboundSchema` instead. */
    ClassType$.outboundSchema = exports.ClassType$outboundSchema;
})(ClassType$ || (exports.ClassType$ = ClassType$ = {}));
/** @internal */
exports.ClassCourse$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.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.
 */
var ClassCourse$;
(function (ClassCourse$) {
    /** @deprecated use `ClassCourse$inboundSchema` instead. */
    ClassCourse$.inboundSchema = exports.ClassCourse$inboundSchema;
    /** @deprecated use `ClassCourse$outboundSchema` instead. */
    ClassCourse$.outboundSchema = exports.ClassCourse$outboundSchema;
})(ClassCourse$ || (exports.ClassCourse$ = ClassCourse$ = {}));
function classCourseToJSON(classCourse) {
    return JSON.stringify(exports.ClassCourse$outboundSchema.parse(classCourse));
}
function classCourseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClassCourse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassCourse' from JSON`);
}
/** @internal */
exports.ClassSchool$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.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.
 */
var ClassSchool$;
(function (ClassSchool$) {
    /** @deprecated use `ClassSchool$inboundSchema` instead. */
    ClassSchool$.inboundSchema = exports.ClassSchool$inboundSchema;
    /** @deprecated use `ClassSchool$outboundSchema` instead. */
    ClassSchool$.outboundSchema = exports.ClassSchool$outboundSchema;
})(ClassSchool$ || (exports.ClassSchool$ = ClassSchool$ = {}));
function classSchoolToJSON(classSchool) {
    return JSON.stringify(exports.ClassSchool$outboundSchema.parse(classSchool));
}
function classSchoolFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClassSchool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassSchool' from JSON`);
}
/** @internal */
exports.Term$inboundSchema = z
    .object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.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.
 */
var Term$;
(function (Term$) {
    /** @deprecated use `Term$inboundSchema` instead. */
    Term$.inboundSchema = exports.Term$inboundSchema;
    /** @deprecated use `Term$outboundSchema` instead. */
    Term$.outboundSchema = exports.Term$outboundSchema;
})(Term$ || (exports.Term$ = Term$ = {}));
function termToJSON(term) {
    return JSON.stringify(exports.Term$outboundSchema.parse(term));
}
function termFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Term$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Term' from JSON`);
}
/** @internal */
exports.ClassResource$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.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.
 */
var ClassResource$;
(function (ClassResource$) {
    /** @deprecated use `ClassResource$inboundSchema` instead. */
    ClassResource$.inboundSchema = exports.ClassResource$inboundSchema;
    /** @deprecated use `ClassResource$outboundSchema` instead. */
    ClassResource$.outboundSchema = exports.ClassResource$outboundSchema;
})(ClassResource$ || (exports.ClassResource$ = ClassResource$ = {}));
function classResourceToJSON(classResource) {
    return JSON.stringify(exports.ClassResource$outboundSchema.parse(classResource));
}
function classResourceFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ClassResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ClassResource' from JSON`);
}
/** @internal */
exports.Class$inboundSchema = z
    .object({
    sourcedId: z.string(),
    status: exports.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: exports.ClassType$inboundSchema,
    location: z.nullable(z.string()),
    grades: z.array(z.string()).optional(),
    subjects: z.array(z.string()).optional(),
    course: z.nullable(z.lazy(() => exports.ClassCourse$inboundSchema)),
    school: z.nullable(z.lazy(() => exports.ClassSchool$inboundSchema)),
    terms: z.array(z.lazy(() => exports.Term$inboundSchema)),
    subjectCodes: z.array(z.string()).optional(),
    periods: z.array(z.string()).optional(),
    resources: z.array(z.lazy(() => exports.ClassResource$inboundSchema)).optional(),
});
/** @internal */
exports.Class$outboundSchema = z.object({
    sourcedId: z.string(),
    status: exports.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: exports.ClassType$outboundSchema,
    location: z.nullable(z.string()),
    grades: z.array(z.string()).optional(),
    subjects: z.array(z.string()).optional(),
    course: z.nullable(z.lazy(() => exports.ClassCourse$outboundSchema)),
    school: z.nullable(z.lazy(() => exports.ClassSchool$outboundSchema)),
    terms: z.array(z.lazy(() => exports.Term$outboundSchema)),
    subjectCodes: z.array(z.string()).optional(),
    periods: z.array(z.string()).optional(),
    resources: z.array(z.lazy(() => exports.ClassResource$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Class$;
(function (Class$) {
    /** @deprecated use `Class$inboundSchema` instead. */
    Class$.inboundSchema = exports.Class$inboundSchema;
    /** @deprecated use `Class$outboundSchema` instead. */
    Class$.outboundSchema = exports.Class$outboundSchema;
})(Class$ || (exports.Class$ = Class$ = {}));
function classToJSON(value) {
    return JSON.stringify(exports.Class$outboundSchema.parse(value));
}
function classFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Class$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Class' from JSON`);
}
//# sourceMappingURL=class.js.map