"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.Content$outboundSchema = exports.Content$inboundSchema = exports.ContentContentType$outboundSchema = exports.ContentContentType$inboundSchema = exports.ContentValue$outboundSchema = exports.ContentValue$inboundSchema = exports.ContentSourceValue$outboundSchema = exports.ContentSourceValue$inboundSchema = exports.Content4$outboundSchema = exports.Content4$inboundSchema = exports.ContentActive$outboundSchema = exports.ContentActive$inboundSchema = exports.Content2$outboundSchema = exports.Content2$inboundSchema = exports.ContentValue = exports.Content2 = void 0;
exports.contentActiveToJSON = contentActiveToJSON;
exports.contentActiveFromJSON = contentActiveFromJSON;
exports.content4ToJSON = content4ToJSON;
exports.content4FromJSON = content4FromJSON;
exports.contentSourceValueToJSON = contentSourceValueToJSON;
exports.contentSourceValueFromJSON = contentSourceValueFromJSON;
exports.contentContentTypeToJSON = contentContentTypeToJSON;
exports.contentContentTypeFromJSON = contentContentTypeFromJSON;
exports.contentToJSON = contentToJSON;
exports.contentFromJSON = contentFromJSON;
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"));
const authormodel_js_1 = require("./authormodel.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 Content2;
(function (Content2) {
    Content2["True"] = "true";
    Content2["False"] = "false";
})(Content2 || (exports.Content2 = Content2 = {}));
/**
 * The StackOne unified content type.
 */
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.Content2$inboundSchema = z
    .nativeEnum(Content2);
/** @internal */
exports.Content2$outboundSchema = exports.Content2$inboundSchema;
/** @internal */
exports.ContentActive$inboundSchema = z.union([z.boolean(), exports.Content2$inboundSchema]);
/** @internal */
exports.ContentActive$outboundSchema = z.union([z.boolean(), exports.Content2$outboundSchema]);
function contentActiveToJSON(contentActive) {
    return JSON.stringify(exports.ContentActive$outboundSchema.parse(contentActive));
}
function contentActiveFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentActive$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentActive' from JSON`);
}
/** @internal */
exports.Content4$inboundSchema = z.object({});
/** @internal */
exports.Content4$outboundSchema = z.object({});
function content4ToJSON(content4) {
    return JSON.stringify(exports.Content4$outboundSchema.parse(content4));
}
function content4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Content4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Content4' from JSON`);
}
/** @internal */
exports.ContentSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Content4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.ContentSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Content4$outboundSchema),
    z.array(z.any()),
]);
function contentSourceValueToJSON(contentSourceValue) {
    return JSON.stringify(exports.ContentSourceValue$outboundSchema.parse(contentSourceValue));
}
function contentSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentSourceValue' from JSON`);
}
/** @internal */
exports.ContentValue$inboundSchema = openEnums.inboundSchema(ContentValue);
/** @internal */
exports.ContentValue$outboundSchema = openEnums.outboundSchema(ContentValue);
/** @internal */
exports.ContentContentType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Content4$inboundSchema),
        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.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Content4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ContentValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
function contentContentTypeToJSON(contentContentType) {
    return JSON.stringify(exports.ContentContentType$outboundSchema.parse(contentContentType));
}
function contentContentTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentContentType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentContentType' from JSON`);
}
/** @internal */
exports.Content$inboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.Content2$inboundSchema]))
        .optional(),
    authors: z.nullable(z.array(authormodel_js_1.AuthorModel$inboundSchema)).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.union([z.boolean(), exports.Content2$outboundSchema]))
        .optional(),
    authors: z.nullable(z.array(authormodel_js_1.AuthorModel$outboundSchema)).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",
    });
});
function contentToJSON(content) {
    return JSON.stringify(exports.Content$outboundSchema.parse(content));
}
function contentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Content$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Content' from JSON`);
}
//# sourceMappingURL=content.js.map