"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.contentFromJSON = exports.contentToJSON = exports.Content$ = exports.Content$outboundSchema = exports.Content$inboundSchema = exports.contentContentTypeFromJSON = exports.contentContentTypeToJSON = exports.ContentContentType$ = exports.ContentContentType$outboundSchema = exports.ContentContentType$inboundSchema = exports.ContentValue$ = exports.ContentValue$outboundSchema = exports.ContentValue$inboundSchema = exports.contentSourceValueFromJSON = exports.contentSourceValueToJSON = exports.ContentSourceValue$ = exports.ContentSourceValue$outboundSchema = exports.ContentSourceValue$inboundSchema = exports.content4FromJSON = exports.content4ToJSON = exports.Content4$ = exports.Content4$outboundSchema = exports.Content4$inboundSchema = exports.ContentValue = 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 category_js_1 = require("./category.js");
const languageenum_js_1 = require("./languageenum.js");
const localizationmodel_js_1 = require("./localizationmodel.js");
const skills_js_1 = require("./skills.js");
var ContentValue;
(function (ContentValue) {
    ContentValue["Video"] = "video";
    ContentValue["Quiz"] = "quiz";
    ContentValue["Document"] = "document";
    ContentValue["Audio"] = "audio";
    ContentValue["Article"] = "article";
    ContentValue["UnmappedValue"] = "unmapped_value";
})(ContentValue || (exports.ContentValue = ContentValue = {}));
/** @internal */
exports.Content4$inboundSchema = z.object({});
/** @internal */
exports.Content4$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 Content4$;
(function (Content4$) {
    /** @deprecated use `Content4$inboundSchema` instead. */
    Content4$.inboundSchema = exports.Content4$inboundSchema;
    /** @deprecated use `Content4$outboundSchema` instead. */
    Content4$.outboundSchema = exports.Content4$outboundSchema;
})(Content4$ || (exports.Content4$ = Content4$ = {}));
function content4ToJSON(content4) {
    return JSON.stringify(exports.Content4$outboundSchema.parse(content4));
}
exports.content4ToJSON = content4ToJSON;
function content4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Content4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Content4' from JSON`);
}
exports.content4FromJSON = content4FromJSON;
/** @internal */
exports.ContentSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Content4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.ContentSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Content4$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 ContentSourceValue$;
(function (ContentSourceValue$) {
    /** @deprecated use `ContentSourceValue$inboundSchema` instead. */
    ContentSourceValue$.inboundSchema = exports.ContentSourceValue$inboundSchema;
    /** @deprecated use `ContentSourceValue$outboundSchema` instead. */
    ContentSourceValue$.outboundSchema = exports.ContentSourceValue$outboundSchema;
})(ContentSourceValue$ || (exports.ContentSourceValue$ = ContentSourceValue$ = {}));
function contentSourceValueToJSON(contentSourceValue) {
    return JSON.stringify(exports.ContentSourceValue$outboundSchema.parse(contentSourceValue));
}
exports.contentSourceValueToJSON = contentSourceValueToJSON;
function contentSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentSourceValue' from JSON`);
}
exports.contentSourceValueFromJSON = contentSourceValueFromJSON;
/** @internal */
exports.ContentValue$inboundSchema = z
    .union([
    z.nativeEnum(ContentValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.ContentValue$outboundSchema = z.union([
    z.nativeEnum(ContentValue),
    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 ContentValue$;
(function (ContentValue$) {
    /** @deprecated use `ContentValue$inboundSchema` instead. */
    ContentValue$.inboundSchema = exports.ContentValue$inboundSchema;
    /** @deprecated use `ContentValue$outboundSchema` instead. */
    ContentValue$.outboundSchema = exports.ContentValue$outboundSchema;
})(ContentValue$ || (exports.ContentValue$ = ContentValue$ = {}));
/** @internal */
exports.ContentContentType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Content4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ContentValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.ContentContentType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Content4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ContentValue$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 ContentContentType$;
(function (ContentContentType$) {
    /** @deprecated use `ContentContentType$inboundSchema` instead. */
    ContentContentType$.inboundSchema = exports.ContentContentType$inboundSchema;
    /** @deprecated use `ContentContentType$outboundSchema` instead. */
    ContentContentType$.outboundSchema = exports.ContentContentType$outboundSchema;
})(ContentContentType$ || (exports.ContentContentType$ = ContentContentType$ = {}));
function contentContentTypeToJSON(contentContentType) {
    return JSON.stringify(exports.ContentContentType$outboundSchema.parse(contentContentType));
}
exports.contentContentTypeToJSON = contentContentTypeToJSON;
function contentContentTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentContentType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentContentType' from JSON`);
}
exports.contentContentTypeFromJSON = contentContentTypeFromJSON;
/** @internal */
exports.Content$inboundSchema = z.object({
    active: z.nullable(z.boolean()).optional(),
    categories: z.nullable(z.array(category_js_1.Category$inboundSchema)).optional(),
    content_type: z.nullable(z.lazy(() => exports.ContentContentType$inboundSchema))
        .optional(),
    content_url: z.nullable(z.string()).optional(),
    course_ids: z.nullable(z.array(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(),
    id: 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(),
    provider: z.nullable(z.string()).optional(),
    remote_course_ids: z.nullable(z.array(z.string())).optional(),
    remote_id: z.nullable(z.string()).optional(),
    short_description: z.nullable(z.string()).optional(),
    skills: z.nullable(z.array(skills_js_1.Skills$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, {
        "content_type": "contentType",
        "content_url": "contentUrl",
        "course_ids": "courseIds",
        "cover_url": "coverUrl",
        "created_at": "createdAt",
        "external_reference": "externalReference",
        "mobile_launch_content_url": "mobileLaunchContentUrl",
        "remote_course_ids": "remoteCourseIds",
        "remote_id": "remoteId",
        "short_description": "shortDescription",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.Content$outboundSchema = z.object({
    active: z.nullable(z.boolean()).optional(),
    categories: z.nullable(z.array(category_js_1.Category$outboundSchema)).optional(),
    contentType: z.nullable(z.lazy(() => exports.ContentContentType$outboundSchema))
        .optional(),
    contentUrl: z.nullable(z.string()).optional(),
    courseIds: z.nullable(z.array(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(),
    id: 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(),
    provider: z.nullable(z.string()).optional(),
    remoteCourseIds: z.nullable(z.array(z.string())).optional(),
    remoteId: z.nullable(z.string()).optional(),
    shortDescription: z.nullable(z.string()).optional(),
    skills: z.nullable(z.array(skills_js_1.Skills$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, {
        contentType: "content_type",
        contentUrl: "content_url",
        courseIds: "course_ids",
        coverUrl: "cover_url",
        createdAt: "created_at",
        externalReference: "external_reference",
        mobileLaunchContentUrl: "mobile_launch_content_url",
        remoteCourseIds: "remote_course_ids",
        remoteId: "remote_id",
        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 Content$;
(function (Content$) {
    /** @deprecated use `Content$inboundSchema` instead. */
    Content$.inboundSchema = exports.Content$inboundSchema;
    /** @deprecated use `Content$outboundSchema` instead. */
    Content$.outboundSchema = exports.Content$outboundSchema;
})(Content$ || (exports.Content$ = Content$ = {}));
function contentToJSON(content) {
    return JSON.stringify(exports.Content$outboundSchema.parse(content));
}
exports.contentToJSON = contentToJSON;
function contentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Content$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Content' from JSON`);
}
exports.contentFromJSON = contentFromJSON;
//# sourceMappingURL=content.js.map