"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.lmsUpsertContentRequestDtoFromJSON = exports.lmsUpsertContentRequestDtoToJSON = exports.LmsUpsertContentRequestDto$ = exports.LmsUpsertContentRequestDto$outboundSchema = exports.LmsUpsertContentRequestDto$inboundSchema = exports.lmsUpsertContentRequestDtoContentTypeFromJSON = exports.lmsUpsertContentRequestDtoContentTypeToJSON = exports.LmsUpsertContentRequestDtoContentType$ = exports.LmsUpsertContentRequestDtoContentType$outboundSchema = exports.LmsUpsertContentRequestDtoContentType$inboundSchema = exports.LmsUpsertContentRequestDtoValue$ = exports.LmsUpsertContentRequestDtoValue$outboundSchema = exports.LmsUpsertContentRequestDtoValue$inboundSchema = exports.lmsUpsertContentRequestDtoSourceValueFromJSON = exports.lmsUpsertContentRequestDtoSourceValueToJSON = exports.LmsUpsertContentRequestDtoSourceValue$ = exports.LmsUpsertContentRequestDtoSourceValue$outboundSchema = exports.LmsUpsertContentRequestDtoSourceValue$inboundSchema = exports.lmsUpsertContentRequestDto4FromJSON = exports.lmsUpsertContentRequestDto4ToJSON = exports.LmsUpsertContentRequestDto4$ = exports.LmsUpsertContentRequestDto4$outboundSchema = exports.LmsUpsertContentRequestDto4$inboundSchema = exports.LmsUpsertContentRequestDtoValue = 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");
const additionaldata_js_1 = require("./additionaldata.js");
const createcategoriesapimodel_js_1 = require("./createcategoriesapimodel.js");
const createskillsapimodel_js_1 = require("./createskillsapimodel.js");
const languageenum_js_1 = require("./languageenum.js");
const localizationmodel_js_1 = require("./localizationmodel.js");
var LmsUpsertContentRequestDtoValue;
(function (LmsUpsertContentRequestDtoValue) {
    LmsUpsertContentRequestDtoValue["Video"] = "video";
    LmsUpsertContentRequestDtoValue["Quiz"] = "quiz";
    LmsUpsertContentRequestDtoValue["Document"] = "document";
    LmsUpsertContentRequestDtoValue["Audio"] = "audio";
    LmsUpsertContentRequestDtoValue["Article"] = "article";
    LmsUpsertContentRequestDtoValue["UnmappedValue"] = "unmapped_value";
})(LmsUpsertContentRequestDtoValue || (exports.LmsUpsertContentRequestDtoValue = LmsUpsertContentRequestDtoValue = {}));
/** @internal */
exports.LmsUpsertContentRequestDto4$inboundSchema = z.object({});
/** @internal */
exports.LmsUpsertContentRequestDto4$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 LmsUpsertContentRequestDto4$;
(function (LmsUpsertContentRequestDto4$) {
    /** @deprecated use `LmsUpsertContentRequestDto4$inboundSchema` instead. */
    LmsUpsertContentRequestDto4$.inboundSchema = exports.LmsUpsertContentRequestDto4$inboundSchema;
    /** @deprecated use `LmsUpsertContentRequestDto4$outboundSchema` instead. */
    LmsUpsertContentRequestDto4$.outboundSchema = exports.LmsUpsertContentRequestDto4$outboundSchema;
})(LmsUpsertContentRequestDto4$ || (exports.LmsUpsertContentRequestDto4$ = LmsUpsertContentRequestDto4$ = {}));
function lmsUpsertContentRequestDto4ToJSON(lmsUpsertContentRequestDto4) {
    return JSON.stringify(exports.LmsUpsertContentRequestDto4$outboundSchema.parse(lmsUpsertContentRequestDto4));
}
exports.lmsUpsertContentRequestDto4ToJSON = lmsUpsertContentRequestDto4ToJSON;
function lmsUpsertContentRequestDto4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LmsUpsertContentRequestDto4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LmsUpsertContentRequestDto4' from JSON`);
}
exports.lmsUpsertContentRequestDto4FromJSON = lmsUpsertContentRequestDto4FromJSON;
/** @internal */
exports.LmsUpsertContentRequestDtoSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.LmsUpsertContentRequestDto4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.LmsUpsertContentRequestDtoSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.LmsUpsertContentRequestDto4$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 LmsUpsertContentRequestDtoSourceValue$;
(function (LmsUpsertContentRequestDtoSourceValue$) {
    /** @deprecated use `LmsUpsertContentRequestDtoSourceValue$inboundSchema` instead. */
    LmsUpsertContentRequestDtoSourceValue$.inboundSchema = exports.LmsUpsertContentRequestDtoSourceValue$inboundSchema;
    /** @deprecated use `LmsUpsertContentRequestDtoSourceValue$outboundSchema` instead. */
    LmsUpsertContentRequestDtoSourceValue$.outboundSchema = exports.LmsUpsertContentRequestDtoSourceValue$outboundSchema;
})(LmsUpsertContentRequestDtoSourceValue$ || (exports.LmsUpsertContentRequestDtoSourceValue$ = LmsUpsertContentRequestDtoSourceValue$ = {}));
function lmsUpsertContentRequestDtoSourceValueToJSON(lmsUpsertContentRequestDtoSourceValue) {
    return JSON.stringify(exports.LmsUpsertContentRequestDtoSourceValue$outboundSchema.parse(lmsUpsertContentRequestDtoSourceValue));
}
exports.lmsUpsertContentRequestDtoSourceValueToJSON = lmsUpsertContentRequestDtoSourceValueToJSON;
function lmsUpsertContentRequestDtoSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LmsUpsertContentRequestDtoSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LmsUpsertContentRequestDtoSourceValue' from JSON`);
}
exports.lmsUpsertContentRequestDtoSourceValueFromJSON = lmsUpsertContentRequestDtoSourceValueFromJSON;
/** @internal */
exports.LmsUpsertContentRequestDtoValue$inboundSchema = z
    .union([
    z.nativeEnum(LmsUpsertContentRequestDtoValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.LmsUpsertContentRequestDtoValue$outboundSchema = z.union([
    z.nativeEnum(LmsUpsertContentRequestDtoValue),
    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 LmsUpsertContentRequestDtoValue$;
(function (LmsUpsertContentRequestDtoValue$) {
    /** @deprecated use `LmsUpsertContentRequestDtoValue$inboundSchema` instead. */
    LmsUpsertContentRequestDtoValue$.inboundSchema = exports.LmsUpsertContentRequestDtoValue$inboundSchema;
    /** @deprecated use `LmsUpsertContentRequestDtoValue$outboundSchema` instead. */
    LmsUpsertContentRequestDtoValue$.outboundSchema = exports.LmsUpsertContentRequestDtoValue$outboundSchema;
})(LmsUpsertContentRequestDtoValue$ || (exports.LmsUpsertContentRequestDtoValue$ = LmsUpsertContentRequestDtoValue$ = {}));
/** @internal */
exports.LmsUpsertContentRequestDtoContentType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.LmsUpsertContentRequestDto4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.LmsUpsertContentRequestDtoValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.LmsUpsertContentRequestDtoContentType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.LmsUpsertContentRequestDto4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.LmsUpsertContentRequestDtoValue$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 LmsUpsertContentRequestDtoContentType$;
(function (LmsUpsertContentRequestDtoContentType$) {
    /** @deprecated use `LmsUpsertContentRequestDtoContentType$inboundSchema` instead. */
    LmsUpsertContentRequestDtoContentType$.inboundSchema = exports.LmsUpsertContentRequestDtoContentType$inboundSchema;
    /** @deprecated use `LmsUpsertContentRequestDtoContentType$outboundSchema` instead. */
    LmsUpsertContentRequestDtoContentType$.outboundSchema = exports.LmsUpsertContentRequestDtoContentType$outboundSchema;
})(LmsUpsertContentRequestDtoContentType$ || (exports.LmsUpsertContentRequestDtoContentType$ = LmsUpsertContentRequestDtoContentType$ = {}));
function lmsUpsertContentRequestDtoContentTypeToJSON(lmsUpsertContentRequestDtoContentType) {
    return JSON.stringify(exports.LmsUpsertContentRequestDtoContentType$outboundSchema.parse(lmsUpsertContentRequestDtoContentType));
}
exports.lmsUpsertContentRequestDtoContentTypeToJSON = lmsUpsertContentRequestDtoContentTypeToJSON;
function lmsUpsertContentRequestDtoContentTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LmsUpsertContentRequestDtoContentType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LmsUpsertContentRequestDtoContentType' from JSON`);
}
exports.lmsUpsertContentRequestDtoContentTypeFromJSON = lmsUpsertContentRequestDtoContentTypeFromJSON;
/** @internal */
exports.LmsUpsertContentRequestDto$inboundSchema = z.object({
    active: z.nullable(z.boolean()).optional(),
    additional_data: z.nullable(z.array(additionaldata_js_1.AdditionalData$inboundSchema)).optional(),
    categories: z.nullable(z.array(createcategoriesapimodel_js_1.CreateCategoriesApiModel$inboundSchema))
        .optional(),
    content_type: z.nullable(z.lazy(() => exports.LmsUpsertContentRequestDtoContentType$inboundSchema)).optional(),
    content_url: z.nullable(z.string()).optional(),
    cover_url: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    duration: z.nullable(z.string()).optional(),
    external_reference: z.nullable(z.string()).optional(),
    languages: z.nullable(z.array(languageenum_js_1.LanguageEnum$inboundSchema)).optional(),
    localizations: z.nullable(z.array(localizationmodel_js_1.LocalizationModel$inboundSchema))
        .optional(),
    mobile_launch_content_url: z.nullable(z.string()).optional(),
    order: z.nullable(z.number()).optional(),
    short_description: z.nullable(z.string()).optional(),
    skills: z.nullable(z.array(createskillsapimodel_js_1.CreateSkillsApiModel$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    title: 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(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "additional_data": "additionalData",
        "content_type": "contentType",
        "content_url": "contentUrl",
        "cover_url": "coverUrl",
        "created_at": "createdAt",
        "external_reference": "externalReference",
        "mobile_launch_content_url": "mobileLaunchContentUrl",
        "short_description": "shortDescription",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.LmsUpsertContentRequestDto$outboundSchema = z.object({
    active: z.nullable(z.boolean()).optional(),
    additionalData: z.nullable(z.array(additionaldata_js_1.AdditionalData$outboundSchema)).optional(),
    categories: z.nullable(z.array(createcategoriesapimodel_js_1.CreateCategoriesApiModel$outboundSchema))
        .optional(),
    contentType: z.nullable(z.lazy(() => exports.LmsUpsertContentRequestDtoContentType$outboundSchema)).optional(),
    contentUrl: z.nullable(z.string()).optional(),
    coverUrl: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    duration: z.nullable(z.string()).optional(),
    externalReference: z.nullable(z.string()).optional(),
    languages: z.nullable(z.array(languageenum_js_1.LanguageEnum$outboundSchema)).optional(),
    localizations: z.nullable(z.array(localizationmodel_js_1.LocalizationModel$outboundSchema))
        .optional(),
    mobileLaunchContentUrl: z.nullable(z.string()).optional(),
    order: z.nullable(z.number()).optional(),
    shortDescription: z.nullable(z.string()).optional(),
    skills: z.nullable(z.array(createskillsapimodel_js_1.CreateSkillsApiModel$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    title: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        additionalData: "additional_data",
        contentType: "content_type",
        contentUrl: "content_url",
        coverUrl: "cover_url",
        createdAt: "created_at",
        externalReference: "external_reference",
        mobileLaunchContentUrl: "mobile_launch_content_url",
        shortDescription: "short_description",
        unifiedCustomFields: "unified_custom_fields",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var LmsUpsertContentRequestDto$;
(function (LmsUpsertContentRequestDto$) {
    /** @deprecated use `LmsUpsertContentRequestDto$inboundSchema` instead. */
    LmsUpsertContentRequestDto$.inboundSchema = exports.LmsUpsertContentRequestDto$inboundSchema;
    /** @deprecated use `LmsUpsertContentRequestDto$outboundSchema` instead. */
    LmsUpsertContentRequestDto$.outboundSchema = exports.LmsUpsertContentRequestDto$outboundSchema;
})(LmsUpsertContentRequestDto$ || (exports.LmsUpsertContentRequestDto$ = LmsUpsertContentRequestDto$ = {}));
function lmsUpsertContentRequestDtoToJSON(lmsUpsertContentRequestDto) {
    return JSON.stringify(exports.LmsUpsertContentRequestDto$outboundSchema.parse(lmsUpsertContentRequestDto));
}
exports.lmsUpsertContentRequestDtoToJSON = lmsUpsertContentRequestDtoToJSON;
function lmsUpsertContentRequestDtoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LmsUpsertContentRequestDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LmsUpsertContentRequestDto' from JSON`);
}
exports.lmsUpsertContentRequestDtoFromJSON = lmsUpsertContentRequestDtoFromJSON;
//# sourceMappingURL=lmsupsertcontentrequestdto.js.map