"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.attachmentFromJSON = exports.attachmentToJSON = exports.Attachment$ = exports.Attachment$outboundSchema = exports.Attachment$inboundSchema = exports.attachmentContentTypeFromJSON = exports.attachmentContentTypeToJSON = exports.AttachmentContentType$ = exports.AttachmentContentType$outboundSchema = exports.AttachmentContentType$inboundSchema = exports.AttachmentValue$ = exports.AttachmentValue$outboundSchema = exports.AttachmentValue$inboundSchema = exports.attachmentSourceValueFromJSON = exports.attachmentSourceValueToJSON = exports.AttachmentSourceValue$ = exports.AttachmentSourceValue$outboundSchema = exports.AttachmentSourceValue$inboundSchema = exports.attachment4FromJSON = exports.attachment4ToJSON = exports.Attachment4$ = exports.Attachment4$outboundSchema = exports.Attachment4$inboundSchema = exports.AttachmentValue = 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 AttachmentValue;
(function (AttachmentValue) {
    AttachmentValue["Text"] = "text";
    AttachmentValue["UnmappedValue"] = "unmapped_value";
})(AttachmentValue || (exports.AttachmentValue = AttachmentValue = {}));
/** @internal */
exports.Attachment4$inboundSchema = z.object({});
/** @internal */
exports.Attachment4$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 Attachment4$;
(function (Attachment4$) {
    /** @deprecated use `Attachment4$inboundSchema` instead. */
    Attachment4$.inboundSchema = exports.Attachment4$inboundSchema;
    /** @deprecated use `Attachment4$outboundSchema` instead. */
    Attachment4$.outboundSchema = exports.Attachment4$outboundSchema;
})(Attachment4$ || (exports.Attachment4$ = Attachment4$ = {}));
function attachment4ToJSON(attachment4) {
    return JSON.stringify(exports.Attachment4$outboundSchema.parse(attachment4));
}
exports.attachment4ToJSON = attachment4ToJSON;
function attachment4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Attachment4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Attachment4' from JSON`);
}
exports.attachment4FromJSON = attachment4FromJSON;
/** @internal */
exports.AttachmentSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Attachment4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.AttachmentSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Attachment4$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 AttachmentSourceValue$;
(function (AttachmentSourceValue$) {
    /** @deprecated use `AttachmentSourceValue$inboundSchema` instead. */
    AttachmentSourceValue$.inboundSchema = exports.AttachmentSourceValue$inboundSchema;
    /** @deprecated use `AttachmentSourceValue$outboundSchema` instead. */
    AttachmentSourceValue$.outboundSchema = exports.AttachmentSourceValue$outboundSchema;
})(AttachmentSourceValue$ || (exports.AttachmentSourceValue$ = AttachmentSourceValue$ = {}));
function attachmentSourceValueToJSON(attachmentSourceValue) {
    return JSON.stringify(exports.AttachmentSourceValue$outboundSchema.parse(attachmentSourceValue));
}
exports.attachmentSourceValueToJSON = attachmentSourceValueToJSON;
function attachmentSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AttachmentSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AttachmentSourceValue' from JSON`);
}
exports.attachmentSourceValueFromJSON = attachmentSourceValueFromJSON;
/** @internal */
exports.AttachmentValue$inboundSchema = z
    .union([
    z.nativeEnum(AttachmentValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.AttachmentValue$outboundSchema = z.union([
    z.nativeEnum(AttachmentValue),
    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 AttachmentValue$;
(function (AttachmentValue$) {
    /** @deprecated use `AttachmentValue$inboundSchema` instead. */
    AttachmentValue$.inboundSchema = exports.AttachmentValue$inboundSchema;
    /** @deprecated use `AttachmentValue$outboundSchema` instead. */
    AttachmentValue$.outboundSchema = exports.AttachmentValue$outboundSchema;
})(AttachmentValue$ || (exports.AttachmentValue$ = AttachmentValue$ = {}));
/** @internal */
exports.AttachmentContentType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Attachment4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AttachmentValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.AttachmentContentType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Attachment4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AttachmentValue$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 AttachmentContentType$;
(function (AttachmentContentType$) {
    /** @deprecated use `AttachmentContentType$inboundSchema` instead. */
    AttachmentContentType$.inboundSchema = exports.AttachmentContentType$inboundSchema;
    /** @deprecated use `AttachmentContentType$outboundSchema` instead. */
    AttachmentContentType$.outboundSchema = exports.AttachmentContentType$outboundSchema;
})(AttachmentContentType$ || (exports.AttachmentContentType$ = AttachmentContentType$ = {}));
function attachmentContentTypeToJSON(attachmentContentType) {
    return JSON.stringify(exports.AttachmentContentType$outboundSchema.parse(attachmentContentType));
}
exports.attachmentContentTypeToJSON = attachmentContentTypeToJSON;
function attachmentContentTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AttachmentContentType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AttachmentContentType' from JSON`);
}
exports.attachmentContentTypeFromJSON = attachmentContentTypeFromJSON;
/** @internal */
exports.Attachment$inboundSchema = z.object({
    content_type: z.nullable(z.lazy(() => exports.AttachmentContentType$inboundSchema))
        .optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "content_type": "contentType",
    });
});
/** @internal */
exports.Attachment$outboundSchema = z.object({
    contentType: z.nullable(z.lazy(() => exports.AttachmentContentType$outboundSchema))
        .optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        contentType: "content_type",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Attachment$;
(function (Attachment$) {
    /** @deprecated use `Attachment$inboundSchema` instead. */
    Attachment$.inboundSchema = exports.Attachment$inboundSchema;
    /** @deprecated use `Attachment$outboundSchema` instead. */
    Attachment$.outboundSchema = exports.Attachment$outboundSchema;
})(Attachment$ || (exports.Attachment$ = Attachment$ = {}));
function attachmentToJSON(attachment) {
    return JSON.stringify(exports.Attachment$outboundSchema.parse(attachment));
}
exports.attachmentToJSON = attachmentToJSON;
function attachmentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Attachment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Attachment' from JSON`);
}
exports.attachmentFromJSON = attachmentFromJSON;
//# sourceMappingURL=attachment.js.map