"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.emailMessagesFromJSON = exports.emailMessagesToJSON = exports.EmailMessages$ = exports.EmailMessages$outboundSchema = exports.EmailMessages$inboundSchema = exports.emailMessagesMessageTypeFromJSON = exports.emailMessagesMessageTypeToJSON = exports.EmailMessagesMessageType$ = exports.EmailMessagesMessageType$outboundSchema = exports.EmailMessagesMessageType$inboundSchema = exports.EmailMessagesValue$ = exports.EmailMessagesValue$outboundSchema = exports.EmailMessagesValue$inboundSchema = exports.emailMessagesSourceValueFromJSON = exports.emailMessagesSourceValueToJSON = exports.EmailMessagesSourceValue$ = exports.EmailMessagesSourceValue$outboundSchema = exports.EmailMessagesSourceValue$inboundSchema = exports.emailMessages4FromJSON = exports.emailMessages4ToJSON = exports.EmailMessages4$ = exports.EmailMessages4$outboundSchema = exports.EmailMessages4$inboundSchema = exports.emailMessagesMessageContentFromJSON = exports.emailMessagesMessageContentToJSON = exports.EmailMessagesMessageContent$ = exports.EmailMessagesMessageContent$outboundSchema = exports.EmailMessagesMessageContent$inboundSchema = exports.EmailMessagesValue = 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 unified message type.
 */
var EmailMessagesValue;
(function (EmailMessagesValue) {
    EmailMessagesValue["Email"] = "email";
    EmailMessagesValue["Sms"] = "sms";
    EmailMessagesValue["Push"] = "push";
    EmailMessagesValue["WebPush"] = "web_push";
    EmailMessagesValue["IosPush"] = "ios_push";
    EmailMessagesValue["AndroidPush"] = "android_push";
    EmailMessagesValue["AppPush"] = "app_push";
    EmailMessagesValue["OmniChannel"] = "omni_channel";
    EmailMessagesValue["ContentBlock"] = "content_block";
    EmailMessagesValue["InApp"] = "in_app";
    EmailMessagesValue["Unknown"] = "unknown";
    EmailMessagesValue["UnmappedValue"] = "unmapped_value";
})(EmailMessagesValue || (exports.EmailMessagesValue = EmailMessagesValue = {}));
/** @internal */
exports.EmailMessagesMessageContent$inboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    from: z.nullable(z.string()).optional(),
    preheader: z.nullable(z.string()).optional(),
    "reply-to": z.nullable(z.string()).optional(),
    subject: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "reply-to": "replyTo",
    });
});
/** @internal */
exports.EmailMessagesMessageContent$outboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    from: z.nullable(z.string()).optional(),
    preheader: z.nullable(z.string()).optional(),
    replyTo: z.nullable(z.string()).optional(),
    subject: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        replyTo: "reply-to",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var EmailMessagesMessageContent$;
(function (EmailMessagesMessageContent$) {
    /** @deprecated use `EmailMessagesMessageContent$inboundSchema` instead. */
    EmailMessagesMessageContent$.inboundSchema = exports.EmailMessagesMessageContent$inboundSchema;
    /** @deprecated use `EmailMessagesMessageContent$outboundSchema` instead. */
    EmailMessagesMessageContent$.outboundSchema = exports.EmailMessagesMessageContent$outboundSchema;
})(EmailMessagesMessageContent$ || (exports.EmailMessagesMessageContent$ = EmailMessagesMessageContent$ = {}));
function emailMessagesMessageContentToJSON(emailMessagesMessageContent) {
    return JSON.stringify(exports.EmailMessagesMessageContent$outboundSchema.parse(emailMessagesMessageContent));
}
exports.emailMessagesMessageContentToJSON = emailMessagesMessageContentToJSON;
function emailMessagesMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmailMessagesMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailMessagesMessageContent' from JSON`);
}
exports.emailMessagesMessageContentFromJSON = emailMessagesMessageContentFromJSON;
/** @internal */
exports.EmailMessages4$inboundSchema = z.object({});
/** @internal */
exports.EmailMessages4$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 EmailMessages4$;
(function (EmailMessages4$) {
    /** @deprecated use `EmailMessages4$inboundSchema` instead. */
    EmailMessages4$.inboundSchema = exports.EmailMessages4$inboundSchema;
    /** @deprecated use `EmailMessages4$outboundSchema` instead. */
    EmailMessages4$.outboundSchema = exports.EmailMessages4$outboundSchema;
})(EmailMessages4$ || (exports.EmailMessages4$ = EmailMessages4$ = {}));
function emailMessages4ToJSON(emailMessages4) {
    return JSON.stringify(exports.EmailMessages4$outboundSchema.parse(emailMessages4));
}
exports.emailMessages4ToJSON = emailMessages4ToJSON;
function emailMessages4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmailMessages4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailMessages4' from JSON`);
}
exports.emailMessages4FromJSON = emailMessages4FromJSON;
/** @internal */
exports.EmailMessagesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.EmailMessages4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.EmailMessagesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.EmailMessages4$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 EmailMessagesSourceValue$;
(function (EmailMessagesSourceValue$) {
    /** @deprecated use `EmailMessagesSourceValue$inboundSchema` instead. */
    EmailMessagesSourceValue$.inboundSchema = exports.EmailMessagesSourceValue$inboundSchema;
    /** @deprecated use `EmailMessagesSourceValue$outboundSchema` instead. */
    EmailMessagesSourceValue$.outboundSchema = exports.EmailMessagesSourceValue$outboundSchema;
})(EmailMessagesSourceValue$ || (exports.EmailMessagesSourceValue$ = EmailMessagesSourceValue$ = {}));
function emailMessagesSourceValueToJSON(emailMessagesSourceValue) {
    return JSON.stringify(exports.EmailMessagesSourceValue$outboundSchema.parse(emailMessagesSourceValue));
}
exports.emailMessagesSourceValueToJSON = emailMessagesSourceValueToJSON;
function emailMessagesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmailMessagesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailMessagesSourceValue' from JSON`);
}
exports.emailMessagesSourceValueFromJSON = emailMessagesSourceValueFromJSON;
/** @internal */
exports.EmailMessagesValue$inboundSchema = z
    .union([
    z.nativeEnum(EmailMessagesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.EmailMessagesValue$outboundSchema = z.union([
    z.nativeEnum(EmailMessagesValue),
    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 EmailMessagesValue$;
(function (EmailMessagesValue$) {
    /** @deprecated use `EmailMessagesValue$inboundSchema` instead. */
    EmailMessagesValue$.inboundSchema = exports.EmailMessagesValue$inboundSchema;
    /** @deprecated use `EmailMessagesValue$outboundSchema` instead. */
    EmailMessagesValue$.outboundSchema = exports.EmailMessagesValue$outboundSchema;
})(EmailMessagesValue$ || (exports.EmailMessagesValue$ = EmailMessagesValue$ = {}));
/** @internal */
exports.EmailMessagesMessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.EmailMessages4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.EmailMessagesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.EmailMessagesMessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.EmailMessages4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.EmailMessagesValue$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 EmailMessagesMessageType$;
(function (EmailMessagesMessageType$) {
    /** @deprecated use `EmailMessagesMessageType$inboundSchema` instead. */
    EmailMessagesMessageType$.inboundSchema = exports.EmailMessagesMessageType$inboundSchema;
    /** @deprecated use `EmailMessagesMessageType$outboundSchema` instead. */
    EmailMessagesMessageType$.outboundSchema = exports.EmailMessagesMessageType$outboundSchema;
})(EmailMessagesMessageType$ || (exports.EmailMessagesMessageType$ = EmailMessagesMessageType$ = {}));
function emailMessagesMessageTypeToJSON(emailMessagesMessageType) {
    return JSON.stringify(exports.EmailMessagesMessageType$outboundSchema.parse(emailMessagesMessageType));
}
exports.emailMessagesMessageTypeToJSON = emailMessagesMessageTypeToJSON;
function emailMessagesMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmailMessagesMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailMessagesMessageType' from JSON`);
}
exports.emailMessagesMessageTypeFromJSON = emailMessagesMessageTypeFromJSON;
/** @internal */
exports.EmailMessages$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    message_content: z.nullable(z.lazy(() => exports.EmailMessagesMessageContent$inboundSchema)).optional(),
    message_type: z.nullable(z.lazy(() => exports.EmailMessagesMessageType$inboundSchema))
        .optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "message_content": "messageContent",
        "message_type": "messageType",
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.EmailMessages$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    messageContent: z.nullable(z.lazy(() => exports.EmailMessagesMessageContent$outboundSchema)).optional(),
    messageType: z.nullable(z.lazy(() => exports.EmailMessagesMessageType$outboundSchema))
        .optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        messageContent: "message_content",
        messageType: "message_type",
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var EmailMessages$;
(function (EmailMessages$) {
    /** @deprecated use `EmailMessages$inboundSchema` instead. */
    EmailMessages$.inboundSchema = exports.EmailMessages$inboundSchema;
    /** @deprecated use `EmailMessages$outboundSchema` instead. */
    EmailMessages$.outboundSchema = exports.EmailMessages$outboundSchema;
})(EmailMessages$ || (exports.EmailMessages$ = EmailMessages$ = {}));
function emailMessagesToJSON(emailMessages) {
    return JSON.stringify(exports.EmailMessages$outboundSchema.parse(emailMessages));
}
exports.emailMessagesToJSON = emailMessagesToJSON;
function emailMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmailMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailMessages' from JSON`);
}
exports.emailMessagesFromJSON = emailMessagesFromJSON;
//# sourceMappingURL=emailmessages.js.map