"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.completionFromJSON = exports.completionToJSON = exports.Completion$ = exports.Completion$outboundSchema = exports.Completion$inboundSchema = exports.completionSchemasResultFromJSON = exports.completionSchemasResultToJSON = exports.CompletionSchemasResult$ = exports.CompletionSchemasResult$outboundSchema = exports.CompletionSchemasResult$inboundSchema = exports.CompletionSchemasValue$ = exports.CompletionSchemasValue$outboundSchema = exports.CompletionSchemasValue$inboundSchema = exports.completionSchemasSourceValueFromJSON = exports.completionSchemasSourceValueToJSON = exports.CompletionSchemasSourceValue$ = exports.CompletionSchemasSourceValue$outboundSchema = exports.CompletionSchemasSourceValue$inboundSchema = exports.completionSchemas4FromJSON = exports.completionSchemas4ToJSON = exports.CompletionSchemas4$ = exports.CompletionSchemas4$outboundSchema = exports.CompletionSchemas4$inboundSchema = exports.completionLearningObjectTypeFromJSON = exports.completionLearningObjectTypeToJSON = exports.CompletionLearningObjectType$ = exports.CompletionLearningObjectType$outboundSchema = exports.CompletionLearningObjectType$inboundSchema = exports.CompletionValue$ = exports.CompletionValue$outboundSchema = exports.CompletionValue$inboundSchema = exports.completionSourceValueFromJSON = exports.completionSourceValueToJSON = exports.CompletionSourceValue$ = exports.CompletionSourceValue$outboundSchema = exports.CompletionSourceValue$inboundSchema = exports.completion4FromJSON = exports.completion4ToJSON = exports.Completion4$ = exports.Completion4$outboundSchema = exports.Completion4$inboundSchema = exports.CompletionSchemasValue = exports.CompletionValue = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const enums_js_1 = require("../../types/enums.js");
var CompletionValue;
(function (CompletionValue) {
    CompletionValue["Content"] = "content";
    CompletionValue["Course"] = "course";
    CompletionValue["Collection"] = "collection";
    CompletionValue["UnmappedValue"] = "unmapped_value";
})(CompletionValue || (exports.CompletionValue = CompletionValue = {}));
var CompletionSchemasValue;
(function (CompletionSchemasValue) {
    CompletionSchemasValue["Pass"] = "Pass";
    CompletionSchemasValue["Fail"] = "Fail";
    CompletionSchemasValue["UnmappedValue"] = "unmapped_value";
})(CompletionSchemasValue || (exports.CompletionSchemasValue = CompletionSchemasValue = {}));
/** @internal */
exports.Completion4$inboundSchema = z.object({});
/** @internal */
exports.Completion4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Completion4$;
(function (Completion4$) {
    /** @deprecated use `Completion4$inboundSchema` instead. */
    Completion4$.inboundSchema = exports.Completion4$inboundSchema;
    /** @deprecated use `Completion4$outboundSchema` instead. */
    Completion4$.outboundSchema = exports.Completion4$outboundSchema;
})(Completion4$ || (exports.Completion4$ = Completion4$ = {}));
function completion4ToJSON(completion4) {
    return JSON.stringify(exports.Completion4$outboundSchema.parse(completion4));
}
exports.completion4ToJSON = completion4ToJSON;
function completion4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Completion4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Completion4' from JSON`);
}
exports.completion4FromJSON = completion4FromJSON;
/** @internal */
exports.CompletionSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Completion4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.CompletionSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Completion4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionSourceValue$;
(function (CompletionSourceValue$) {
    /** @deprecated use `CompletionSourceValue$inboundSchema` instead. */
    CompletionSourceValue$.inboundSchema = exports.CompletionSourceValue$inboundSchema;
    /** @deprecated use `CompletionSourceValue$outboundSchema` instead. */
    CompletionSourceValue$.outboundSchema = exports.CompletionSourceValue$outboundSchema;
})(CompletionSourceValue$ || (exports.CompletionSourceValue$ = CompletionSourceValue$ = {}));
function completionSourceValueToJSON(completionSourceValue) {
    return JSON.stringify(exports.CompletionSourceValue$outboundSchema.parse(completionSourceValue));
}
exports.completionSourceValueToJSON = completionSourceValueToJSON;
function completionSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSourceValue' from JSON`);
}
exports.completionSourceValueFromJSON = completionSourceValueFromJSON;
/** @internal */
exports.CompletionValue$inboundSchema = z
    .union([
    z.nativeEnum(CompletionValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.CompletionValue$outboundSchema = z.union([
    z.nativeEnum(CompletionValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionValue$;
(function (CompletionValue$) {
    /** @deprecated use `CompletionValue$inboundSchema` instead. */
    CompletionValue$.inboundSchema = exports.CompletionValue$inboundSchema;
    /** @deprecated use `CompletionValue$outboundSchema` instead. */
    CompletionValue$.outboundSchema = exports.CompletionValue$outboundSchema;
})(CompletionValue$ || (exports.CompletionValue$ = CompletionValue$ = {}));
/** @internal */
exports.CompletionLearningObjectType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Completion4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.CompletionLearningObjectType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Completion4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionLearningObjectType$;
(function (CompletionLearningObjectType$) {
    /** @deprecated use `CompletionLearningObjectType$inboundSchema` instead. */
    CompletionLearningObjectType$.inboundSchema = exports.CompletionLearningObjectType$inboundSchema;
    /** @deprecated use `CompletionLearningObjectType$outboundSchema` instead. */
    CompletionLearningObjectType$.outboundSchema = exports.CompletionLearningObjectType$outboundSchema;
})(CompletionLearningObjectType$ || (exports.CompletionLearningObjectType$ = CompletionLearningObjectType$ = {}));
function completionLearningObjectTypeToJSON(completionLearningObjectType) {
    return JSON.stringify(exports.CompletionLearningObjectType$outboundSchema.parse(completionLearningObjectType));
}
exports.completionLearningObjectTypeToJSON = completionLearningObjectTypeToJSON;
function completionLearningObjectTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionLearningObjectType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionLearningObjectType' from JSON`);
}
exports.completionLearningObjectTypeFromJSON = completionLearningObjectTypeFromJSON;
/** @internal */
exports.CompletionSchemas4$inboundSchema = z.object({});
/** @internal */
exports.CompletionSchemas4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionSchemas4$;
(function (CompletionSchemas4$) {
    /** @deprecated use `CompletionSchemas4$inboundSchema` instead. */
    CompletionSchemas4$.inboundSchema = exports.CompletionSchemas4$inboundSchema;
    /** @deprecated use `CompletionSchemas4$outboundSchema` instead. */
    CompletionSchemas4$.outboundSchema = exports.CompletionSchemas4$outboundSchema;
})(CompletionSchemas4$ || (exports.CompletionSchemas4$ = CompletionSchemas4$ = {}));
function completionSchemas4ToJSON(completionSchemas4) {
    return JSON.stringify(exports.CompletionSchemas4$outboundSchema.parse(completionSchemas4));
}
exports.completionSchemas4ToJSON = completionSchemas4ToJSON;
function completionSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemas4' from JSON`);
}
exports.completionSchemas4FromJSON = completionSchemas4FromJSON;
/** @internal */
exports.CompletionSchemasSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.CompletionSchemas4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.CompletionSchemasSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.CompletionSchemas4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionSchemasSourceValue$;
(function (CompletionSchemasSourceValue$) {
    /** @deprecated use `CompletionSchemasSourceValue$inboundSchema` instead. */
    CompletionSchemasSourceValue$.inboundSchema = exports.CompletionSchemasSourceValue$inboundSchema;
    /** @deprecated use `CompletionSchemasSourceValue$outboundSchema` instead. */
    CompletionSchemasSourceValue$.outboundSchema = exports.CompletionSchemasSourceValue$outboundSchema;
})(CompletionSchemasSourceValue$ || (exports.CompletionSchemasSourceValue$ = CompletionSchemasSourceValue$ = {}));
function completionSchemasSourceValueToJSON(completionSchemasSourceValue) {
    return JSON.stringify(exports.CompletionSchemasSourceValue$outboundSchema.parse(completionSchemasSourceValue));
}
exports.completionSchemasSourceValueToJSON = completionSchemasSourceValueToJSON;
function completionSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemasSourceValue' from JSON`);
}
exports.completionSchemasSourceValueFromJSON = completionSchemasSourceValueFromJSON;
/** @internal */
exports.CompletionSchemasValue$inboundSchema = z
    .union([
    z.nativeEnum(CompletionSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.CompletionSchemasValue$outboundSchema = z.union([
    z.nativeEnum(CompletionSchemasValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionSchemasValue$;
(function (CompletionSchemasValue$) {
    /** @deprecated use `CompletionSchemasValue$inboundSchema` instead. */
    CompletionSchemasValue$.inboundSchema = exports.CompletionSchemasValue$inboundSchema;
    /** @deprecated use `CompletionSchemasValue$outboundSchema` instead. */
    CompletionSchemasValue$.outboundSchema = exports.CompletionSchemasValue$outboundSchema;
})(CompletionSchemasValue$ || (exports.CompletionSchemasValue$ = CompletionSchemasValue$ = {}));
/** @internal */
exports.CompletionSchemasResult$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.CompletionSchemas4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.CompletionSchemasResult$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.CompletionSchemas4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionSchemasValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CompletionSchemasResult$;
(function (CompletionSchemasResult$) {
    /** @deprecated use `CompletionSchemasResult$inboundSchema` instead. */
    CompletionSchemasResult$.inboundSchema = exports.CompletionSchemasResult$inboundSchema;
    /** @deprecated use `CompletionSchemasResult$outboundSchema` instead. */
    CompletionSchemasResult$.outboundSchema = exports.CompletionSchemasResult$outboundSchema;
})(CompletionSchemasResult$ || (exports.CompletionSchemasResult$ = CompletionSchemasResult$ = {}));
function completionSchemasResultToJSON(completionSchemasResult) {
    return JSON.stringify(exports.CompletionSchemasResult$outboundSchema.parse(completionSchemasResult));
}
exports.completionSchemasResultToJSON = completionSchemasResultToJSON;
function completionSchemasResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemasResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemasResult' from JSON`);
}
exports.completionSchemasResultFromJSON = completionSchemasResultFromJSON;
/** @internal */
exports.Completion$inboundSchema = z.object({
    completed_at: z.nullable(z.string()).optional(),
    content_external_reference: z.nullable(z.string()).optional(),
    content_id: z.nullable(z.string()).optional(),
    course_id: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string()).optional(),
    external_id: z.nullable(z.string()).optional(),
    external_reference: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    learning_object_external_reference: z.nullable(z.string()).optional(),
    learning_object_id: z.nullable(z.string()).optional(),
    learning_object_type: z.nullable(z.lazy(() => exports.CompletionLearningObjectType$inboundSchema)).optional(),
    remote_content_id: z.nullable(z.string()).optional(),
    remote_course_id: z.nullable(z.string()).optional(),
    remote_external_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_learning_object_id: z.nullable(z.string()).optional(),
    remote_user_id: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.CompletionSchemasResult$inboundSchema))
        .optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
    updated_at: z.nullable(z.string()).optional(),
    user_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "completed_at": "completedAt",
        "content_external_reference": "contentExternalReference",
        "content_id": "contentId",
        "course_id": "courseId",
        "created_at": "createdAt",
        "external_id": "externalId",
        "external_reference": "externalReference",
        "learning_object_external_reference": "learningObjectExternalReference",
        "learning_object_id": "learningObjectId",
        "learning_object_type": "learningObjectType",
        "remote_content_id": "remoteContentId",
        "remote_course_id": "remoteCourseId",
        "remote_external_id": "remoteExternalId",
        "remote_id": "remoteId",
        "remote_learning_object_id": "remoteLearningObjectId",
        "remote_user_id": "remoteUserId",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
        "user_id": "userId",
    });
});
/** @internal */
exports.Completion$outboundSchema = z.object({
    completedAt: z.nullable(z.string()).optional(),
    contentExternalReference: z.nullable(z.string()).optional(),
    contentId: z.nullable(z.string()).optional(),
    courseId: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.string()).optional(),
    externalId: z.nullable(z.string()).optional(),
    externalReference: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    learningObjectExternalReference: z.nullable(z.string()).optional(),
    learningObjectId: z.nullable(z.string()).optional(),
    learningObjectType: z.nullable(z.lazy(() => exports.CompletionLearningObjectType$outboundSchema)).optional(),
    remoteContentId: z.nullable(z.string()).optional(),
    remoteCourseId: z.nullable(z.string()).optional(),
    remoteExternalId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteLearningObjectId: z.nullable(z.string()).optional(),
    remoteUserId: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.CompletionSchemasResult$outboundSchema))
        .optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.string()).optional(),
    userId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        completedAt: "completed_at",
        contentExternalReference: "content_external_reference",
        contentId: "content_id",
        courseId: "course_id",
        createdAt: "created_at",
        externalId: "external_id",
        externalReference: "external_reference",
        learningObjectExternalReference: "learning_object_external_reference",
        learningObjectId: "learning_object_id",
        learningObjectType: "learning_object_type",
        remoteContentId: "remote_content_id",
        remoteCourseId: "remote_course_id",
        remoteExternalId: "remote_external_id",
        remoteId: "remote_id",
        remoteLearningObjectId: "remote_learning_object_id",
        remoteUserId: "remote_user_id",
        unifiedCustomFields: "unified_custom_fields",
        updatedAt: "updated_at",
        userId: "user_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Completion$;
(function (Completion$) {
    /** @deprecated use `Completion$inboundSchema` instead. */
    Completion$.inboundSchema = exports.Completion$inboundSchema;
    /** @deprecated use `Completion$outboundSchema` instead. */
    Completion$.outboundSchema = exports.Completion$outboundSchema;
})(Completion$ || (exports.Completion$ = Completion$ = {}));
function completionToJSON(completion) {
    return JSON.stringify(exports.Completion$outboundSchema.parse(completion));
}
exports.completionToJSON = completionToJSON;
function completionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Completion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Completion' from JSON`);
}
exports.completionFromJSON = completionFromJSON;
//# sourceMappingURL=completion.js.map