"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.Completion$inboundSchema = exports.CompletionSchemasResult$inboundSchema = exports.CompletionSchemasValue$inboundSchema = exports.CompletionSchemasSourceValue$inboundSchema = exports.CompletionSchemas4$inboundSchema = exports.CompletionLearningObjectType$inboundSchema = exports.CompletionValue$inboundSchema = exports.CompletionSourceValue$inboundSchema = exports.Completion4$inboundSchema = exports.CompletionSchemasValue = exports.CompletionValue = void 0;
exports.completion4FromJSON = completion4FromJSON;
exports.completionSourceValueFromJSON = completionSourceValueFromJSON;
exports.completionLearningObjectTypeFromJSON = completionLearningObjectTypeFromJSON;
exports.completionSchemas4FromJSON = completionSchemas4FromJSON;
exports.completionSchemasSourceValueFromJSON = completionSchemasSourceValueFromJSON;
exports.completionSchemasResultFromJSON = completionSchemasResultFromJSON;
exports.completionFromJSON = completionFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
/**
 * The StackOne unified learning object type.
 */
var CompletionValue;
(function (CompletionValue) {
    CompletionValue["Content"] = "content";
    CompletionValue["Course"] = "course";
    CompletionValue["Collection"] = "collection";
    CompletionValue["UnmappedValue"] = "unmapped_value";
})(CompletionValue || (exports.CompletionValue = CompletionValue = {}));
/**
 * The StackOne unified result status.
 */
var CompletionSchemasValue;
(function (CompletionSchemasValue) {
    CompletionSchemasValue["Pass"] = "Pass";
    CompletionSchemasValue["Fail"] = "Fail";
    CompletionSchemasValue["UnmappedValue"] = "unmapped_value";
})(CompletionSchemasValue || (exports.CompletionSchemasValue = CompletionSchemasValue = {}));
/** @internal */
exports.Completion4$inboundSchema = z.object({});
function completion4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Completion4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Completion4' from JSON`);
}
/** @internal */
exports.CompletionSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Completion4$inboundSchema),
    z.array(z.any()),
]);
function completionSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSourceValue' from JSON`);
}
/** @internal */
exports.CompletionValue$inboundSchema = openEnums.inboundSchema(CompletionValue);
/** @internal */
exports.CompletionLearningObjectType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Completion4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function completionLearningObjectTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionLearningObjectType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionLearningObjectType' from JSON`);
}
/** @internal */
exports.CompletionSchemas4$inboundSchema = z.object({});
function completionSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemas4' from JSON`);
}
/** @internal */
exports.CompletionSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.CompletionSchemas4$inboundSchema),
    z.array(z.any()),
]);
function completionSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemasSourceValue' from JSON`);
}
/** @internal */
exports.CompletionSchemasValue$inboundSchema = openEnums.inboundSchema(CompletionSchemasValue);
/** @internal */
exports.CompletionSchemasResult$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.CompletionSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CompletionSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function completionSchemasResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionSchemasResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionSchemasResult' from JSON`);
}
/** @internal */
exports.Completion$inboundSchema = z.object({
    certificate_url: z.nullable(z.string()).optional(),
    completed_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).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().datetime({ offset: true }).transform(v => new Date(v))).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(),
    time_spent: z.nullable(z.string()).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    user_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "certificate_url": "certificateUrl",
        "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",
        "time_spent": "timeSpent",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
        "user_id": "userId",
    });
});
function completionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Completion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Completion' from JSON`);
}
//# sourceMappingURL=completion.js.map