"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.Enrollment$ = exports.Enrollment$outboundSchema = exports.Enrollment$inboundSchema = exports.EnrollmentClass$ = exports.EnrollmentClass$outboundSchema = exports.EnrollmentClass$inboundSchema = exports.User$ = exports.User$outboundSchema = exports.User$inboundSchema = exports.EnrollmentRole$ = exports.EnrollmentRole$outboundSchema = exports.EnrollmentRole$inboundSchema = exports.EnrollmentStatus$ = exports.EnrollmentStatus$outboundSchema = exports.EnrollmentStatus$inboundSchema = exports.EnrollmentRole = exports.EnrollmentStatus = void 0;
exports.userToJSON = userToJSON;
exports.userFromJSON = userFromJSON;
exports.enrollmentClassToJSON = enrollmentClassToJSON;
exports.enrollmentClassFromJSON = enrollmentClassFromJSON;
exports.enrollmentToJSON = enrollmentToJSON;
exports.enrollmentFromJSON = enrollmentFromJSON;
const z = __importStar(require("zod"));
const schemas_js_1 = require("../../lib/schemas.js");
exports.EnrollmentStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
exports.EnrollmentRole = {
    Administrator: "administrator",
    Proctor: "proctor",
    Student: "student",
    Teacher: "teacher",
};
/** @internal */
exports.EnrollmentStatus$inboundSchema = z.nativeEnum(exports.EnrollmentStatus);
/** @internal */
exports.EnrollmentStatus$outboundSchema = exports.EnrollmentStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var EnrollmentStatus$;
(function (EnrollmentStatus$) {
    /** @deprecated use `EnrollmentStatus$inboundSchema` instead. */
    EnrollmentStatus$.inboundSchema = exports.EnrollmentStatus$inboundSchema;
    /** @deprecated use `EnrollmentStatus$outboundSchema` instead. */
    EnrollmentStatus$.outboundSchema = exports.EnrollmentStatus$outboundSchema;
})(EnrollmentStatus$ || (exports.EnrollmentStatus$ = EnrollmentStatus$ = {}));
/** @internal */
exports.EnrollmentRole$inboundSchema = z.nativeEnum(exports.EnrollmentRole);
/** @internal */
exports.EnrollmentRole$outboundSchema = exports.EnrollmentRole$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var EnrollmentRole$;
(function (EnrollmentRole$) {
    /** @deprecated use `EnrollmentRole$inboundSchema` instead. */
    EnrollmentRole$.inboundSchema = exports.EnrollmentRole$inboundSchema;
    /** @deprecated use `EnrollmentRole$outboundSchema` instead. */
    EnrollmentRole$.outboundSchema = exports.EnrollmentRole$outboundSchema;
})(EnrollmentRole$ || (exports.EnrollmentRole$ = EnrollmentRole$ = {}));
/** @internal */
exports.User$inboundSchema = z
    .object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.User$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 User$;
(function (User$) {
    /** @deprecated use `User$inboundSchema` instead. */
    User$.inboundSchema = exports.User$inboundSchema;
    /** @deprecated use `User$outboundSchema` instead. */
    User$.outboundSchema = exports.User$outboundSchema;
})(User$ || (exports.User$ = User$ = {}));
function userToJSON(user) {
    return JSON.stringify(exports.User$outboundSchema.parse(user));
}
function userFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.User$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'User' from JSON`);
}
/** @internal */
exports.EnrollmentClass$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.EnrollmentClass$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 EnrollmentClass$;
(function (EnrollmentClass$) {
    /** @deprecated use `EnrollmentClass$inboundSchema` instead. */
    EnrollmentClass$.inboundSchema = exports.EnrollmentClass$inboundSchema;
    /** @deprecated use `EnrollmentClass$outboundSchema` instead. */
    EnrollmentClass$.outboundSchema = exports.EnrollmentClass$outboundSchema;
})(EnrollmentClass$ || (exports.EnrollmentClass$ = EnrollmentClass$ = {}));
function enrollmentClassToJSON(enrollmentClass) {
    return JSON.stringify(exports.EnrollmentClass$outboundSchema.parse(enrollmentClass));
}
function enrollmentClassFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EnrollmentClass$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnrollmentClass' from JSON`);
}
/** @internal */
exports.Enrollment$inboundSchema = z.object({
    sourcedId: z.string(),
    status: exports.EnrollmentStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    role: exports.EnrollmentRole$inboundSchema,
    primary: z.boolean(),
    beginDate: z.nullable(z.string()),
    endDate: z.nullable(z.string()),
    user: z.lazy(() => exports.User$inboundSchema),
    class: z.lazy(() => exports.EnrollmentClass$inboundSchema),
});
/** @internal */
exports.Enrollment$outboundSchema = z.object({
    sourcedId: z.string(),
    status: exports.EnrollmentStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    role: exports.EnrollmentRole$outboundSchema,
    primary: z.boolean(),
    beginDate: z.nullable(z.string()),
    endDate: z.nullable(z.string()),
    user: z.lazy(() => exports.User$outboundSchema),
    class: z.lazy(() => exports.EnrollmentClass$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Enrollment$;
(function (Enrollment$) {
    /** @deprecated use `Enrollment$inboundSchema` instead. */
    Enrollment$.inboundSchema = exports.Enrollment$inboundSchema;
    /** @deprecated use `Enrollment$outboundSchema` instead. */
    Enrollment$.outboundSchema = exports.Enrollment$outboundSchema;
})(Enrollment$ || (exports.Enrollment$ = Enrollment$ = {}));
function enrollmentToJSON(enrollment) {
    return JSON.stringify(exports.Enrollment$outboundSchema.parse(enrollment));
}
function enrollmentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Enrollment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Enrollment' from JSON`);
}
//# sourceMappingURL=enrollment.js.map