"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.applicationAttachmentFromJSON = exports.applicationAttachmentToJSON = exports.ApplicationAttachment$ = exports.ApplicationAttachment$outboundSchema = exports.ApplicationAttachment$inboundSchema = exports.contentTypeFromJSON = exports.contentTypeToJSON = exports.ContentType$ = exports.ContentType$outboundSchema = exports.ContentType$inboundSchema = exports.ApplicationAttachmentValue$ = exports.ApplicationAttachmentValue$outboundSchema = exports.ApplicationAttachmentValue$inboundSchema = exports.applicationAttachmentSourceValueFromJSON = exports.applicationAttachmentSourceValueToJSON = exports.ApplicationAttachmentSourceValue$ = exports.ApplicationAttachmentSourceValue$outboundSchema = exports.ApplicationAttachmentSourceValue$inboundSchema = exports.applicationAttachment4FromJSON = exports.applicationAttachment4ToJSON = exports.ApplicationAttachment4$ = exports.ApplicationAttachment4$outboundSchema = exports.ApplicationAttachment4$inboundSchema = exports.ApplicationAttachmentValue = 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");
/**
 * The content type of the attachment.
 */
var ApplicationAttachmentValue;
(function (ApplicationAttachmentValue) {
    ApplicationAttachmentValue["Text"] = "text";
    ApplicationAttachmentValue["UnmappedValue"] = "unmapped_value";
})(ApplicationAttachmentValue || (exports.ApplicationAttachmentValue = ApplicationAttachmentValue = {}));
/** @internal */
exports.ApplicationAttachment4$inboundSchema = z.object({});
/** @internal */
exports.ApplicationAttachment4$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 ApplicationAttachment4$;
(function (ApplicationAttachment4$) {
    /** @deprecated use `ApplicationAttachment4$inboundSchema` instead. */
    ApplicationAttachment4$.inboundSchema = exports.ApplicationAttachment4$inboundSchema;
    /** @deprecated use `ApplicationAttachment4$outboundSchema` instead. */
    ApplicationAttachment4$.outboundSchema = exports.ApplicationAttachment4$outboundSchema;
})(ApplicationAttachment4$ || (exports.ApplicationAttachment4$ = ApplicationAttachment4$ = {}));
function applicationAttachment4ToJSON(applicationAttachment4) {
    return JSON.stringify(exports.ApplicationAttachment4$outboundSchema.parse(applicationAttachment4));
}
exports.applicationAttachment4ToJSON = applicationAttachment4ToJSON;
function applicationAttachment4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationAttachment4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationAttachment4' from JSON`);
}
exports.applicationAttachment4FromJSON = applicationAttachment4FromJSON;
/** @internal */
exports.ApplicationAttachmentSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.ApplicationAttachment4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.ApplicationAttachmentSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.ApplicationAttachment4$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 ApplicationAttachmentSourceValue$;
(function (ApplicationAttachmentSourceValue$) {
    /** @deprecated use `ApplicationAttachmentSourceValue$inboundSchema` instead. */
    ApplicationAttachmentSourceValue$.inboundSchema = exports.ApplicationAttachmentSourceValue$inboundSchema;
    /** @deprecated use `ApplicationAttachmentSourceValue$outboundSchema` instead. */
    ApplicationAttachmentSourceValue$.outboundSchema = exports.ApplicationAttachmentSourceValue$outboundSchema;
})(ApplicationAttachmentSourceValue$ || (exports.ApplicationAttachmentSourceValue$ = ApplicationAttachmentSourceValue$ = {}));
function applicationAttachmentSourceValueToJSON(applicationAttachmentSourceValue) {
    return JSON.stringify(exports.ApplicationAttachmentSourceValue$outboundSchema.parse(applicationAttachmentSourceValue));
}
exports.applicationAttachmentSourceValueToJSON = applicationAttachmentSourceValueToJSON;
function applicationAttachmentSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationAttachmentSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationAttachmentSourceValue' from JSON`);
}
exports.applicationAttachmentSourceValueFromJSON = applicationAttachmentSourceValueFromJSON;
/** @internal */
exports.ApplicationAttachmentValue$inboundSchema = z
    .union([
    z.nativeEnum(ApplicationAttachmentValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.ApplicationAttachmentValue$outboundSchema = z.union([
    z.nativeEnum(ApplicationAttachmentValue),
    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 ApplicationAttachmentValue$;
(function (ApplicationAttachmentValue$) {
    /** @deprecated use `ApplicationAttachmentValue$inboundSchema` instead. */
    ApplicationAttachmentValue$.inboundSchema = exports.ApplicationAttachmentValue$inboundSchema;
    /** @deprecated use `ApplicationAttachmentValue$outboundSchema` instead. */
    ApplicationAttachmentValue$.outboundSchema = exports.ApplicationAttachmentValue$outboundSchema;
})(ApplicationAttachmentValue$ || (exports.ApplicationAttachmentValue$ = ApplicationAttachmentValue$ = {}));
/** @internal */
exports.ContentType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.ApplicationAttachment4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ApplicationAttachmentValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.ContentType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.ApplicationAttachment4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ApplicationAttachmentValue$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 ContentType$;
(function (ContentType$) {
    /** @deprecated use `ContentType$inboundSchema` instead. */
    ContentType$.inboundSchema = exports.ContentType$inboundSchema;
    /** @deprecated use `ContentType$outboundSchema` instead. */
    ContentType$.outboundSchema = exports.ContentType$outboundSchema;
})(ContentType$ || (exports.ContentType$ = ContentType$ = {}));
function contentTypeToJSON(contentType) {
    return JSON.stringify(exports.ContentType$outboundSchema.parse(contentType));
}
exports.contentTypeToJSON = contentTypeToJSON;
function contentTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ContentType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContentType' from JSON`);
}
exports.contentTypeFromJSON = contentTypeFromJSON;
/** @internal */
exports.ApplicationAttachment$inboundSchema = z.object({
    content: z.nullable(z.string()).optional(),
    content_type: z.nullable(z.lazy(() => exports.ContentType$inboundSchema)).optional(),
    file_name: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "content_type": "contentType",
        "file_name": "fileName",
    });
});
/** @internal */
exports.ApplicationAttachment$outboundSchema = z.object({
    content: z.nullable(z.string()).optional(),
    contentType: z.nullable(z.lazy(() => exports.ContentType$outboundSchema)).optional(),
    fileName: z.nullable(z.string()).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        contentType: "content_type",
        fileName: "file_name",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ApplicationAttachment$;
(function (ApplicationAttachment$) {
    /** @deprecated use `ApplicationAttachment$inboundSchema` instead. */
    ApplicationAttachment$.inboundSchema = exports.ApplicationAttachment$inboundSchema;
    /** @deprecated use `ApplicationAttachment$outboundSchema` instead. */
    ApplicationAttachment$.outboundSchema = exports.ApplicationAttachment$outboundSchema;
})(ApplicationAttachment$ || (exports.ApplicationAttachment$ = ApplicationAttachment$ = {}));
function applicationAttachmentToJSON(applicationAttachment) {
    return JSON.stringify(exports.ApplicationAttachment$outboundSchema.parse(applicationAttachment));
}
exports.applicationAttachmentToJSON = applicationAttachmentToJSON;
function applicationAttachmentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationAttachment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationAttachment' from JSON`);
}
exports.applicationAttachmentFromJSON = applicationAttachmentFromJSON;
//# sourceMappingURL=applicationattachment.js.map