"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.messageMessageContentFromJSON = exports.messageMessageContentToJSON = exports.MessageMessageContent$ = exports.MessageMessageContent$outboundSchema = exports.MessageMessageContent$inboundSchema = exports.createMessageFromJSON = exports.createMessageToJSON = exports.CreateMessage$ = exports.CreateMessage$outboundSchema = exports.CreateMessage$inboundSchema = exports.messageTypeFromJSON = exports.messageTypeToJSON = exports.MessageType$ = exports.MessageType$outboundSchema = exports.MessageType$inboundSchema = exports.CreateMessageValue$ = exports.CreateMessageValue$outboundSchema = exports.CreateMessageValue$inboundSchema = exports.createMessageSourceValueFromJSON = exports.createMessageSourceValueToJSON = exports.CreateMessageSourceValue$ = exports.CreateMessageSourceValue$outboundSchema = exports.CreateMessageSourceValue$inboundSchema = exports.createMessage4FromJSON = exports.createMessage4ToJSON = exports.CreateMessage4$ = exports.CreateMessage4$outboundSchema = exports.CreateMessage4$inboundSchema = exports.messageContentFromJSON = exports.messageContentToJSON = exports.MessageContent$ = exports.MessageContent$outboundSchema = exports.MessageContent$inboundSchema = exports.smsMessageContentsSchemasFromJSON = exports.smsMessageContentsSchemasToJSON = exports.SmsMessageContentsSchemas$ = exports.SmsMessageContentsSchemas$outboundSchema = exports.SmsMessageContentsSchemas$inboundSchema = exports.schemasFromJSON = exports.schemasToJSON = exports.Schemas$ = exports.Schemas$outboundSchema = exports.Schemas$inboundSchema = exports.pushMessageContentsSchemasFromJSON = exports.pushMessageContentsSchemasToJSON = exports.PushMessageContentsSchemas$ = exports.PushMessageContentsSchemas$outboundSchema = exports.PushMessageContentsSchemas$inboundSchema = exports.MessageValue = exports.CreateMessageValue = void 0;
exports.messageFromJSON = exports.messageToJSON = exports.Message$ = exports.Message$outboundSchema = exports.Message$inboundSchema = exports.messageMessageTypeFromJSON = exports.messageMessageTypeToJSON = exports.MessageMessageType$ = exports.MessageMessageType$outboundSchema = exports.MessageMessageType$inboundSchema = exports.MessageValue$ = exports.MessageValue$outboundSchema = exports.MessageValue$inboundSchema = exports.messageSourceValueFromJSON = exports.messageSourceValueToJSON = exports.MessageSourceValue$ = exports.MessageSourceValue$outboundSchema = exports.MessageSourceValue$inboundSchema = exports.message4FromJSON = exports.message4ToJSON = exports.Message4$ = exports.Message4$outboundSchema = exports.Message4$inboundSchema = 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 CreateMessageValue;
(function (CreateMessageValue) {
    CreateMessageValue["Email"] = "email";
    CreateMessageValue["Sms"] = "sms";
    CreateMessageValue["Push"] = "push";
    CreateMessageValue["WebPush"] = "web_push";
    CreateMessageValue["IosPush"] = "ios_push";
    CreateMessageValue["AndroidPush"] = "android_push";
    CreateMessageValue["AppPush"] = "app_push";
    CreateMessageValue["OmniChannel"] = "omni_channel";
    CreateMessageValue["ContentBlock"] = "content_block";
    CreateMessageValue["InApp"] = "in_app";
    CreateMessageValue["Unknown"] = "unknown";
    CreateMessageValue["UnmappedValue"] = "unmapped_value";
})(CreateMessageValue || (exports.CreateMessageValue = CreateMessageValue = {}));
/**
 * The unified message type.
 */
var MessageValue;
(function (MessageValue) {
    MessageValue["Email"] = "email";
    MessageValue["Sms"] = "sms";
    MessageValue["Push"] = "push";
    MessageValue["WebPush"] = "web_push";
    MessageValue["IosPush"] = "ios_push";
    MessageValue["AndroidPush"] = "android_push";
    MessageValue["AppPush"] = "app_push";
    MessageValue["OmniChannel"] = "omni_channel";
    MessageValue["ContentBlock"] = "content_block";
    MessageValue["InApp"] = "in_app";
    MessageValue["Unknown"] = "unknown";
    MessageValue["UnmappedValue"] = "unmapped_value";
})(MessageValue || (exports.MessageValue = MessageValue = {}));
/** @internal */
exports.PushMessageContentsSchemas$inboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    subtitle: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
});
/** @internal */
exports.PushMessageContentsSchemas$outboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    subtitle: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var PushMessageContentsSchemas$;
(function (PushMessageContentsSchemas$) {
    /** @deprecated use `PushMessageContentsSchemas$inboundSchema` instead. */
    PushMessageContentsSchemas$.inboundSchema = exports.PushMessageContentsSchemas$inboundSchema;
    /** @deprecated use `PushMessageContentsSchemas$outboundSchema` instead. */
    PushMessageContentsSchemas$.outboundSchema = exports.PushMessageContentsSchemas$outboundSchema;
})(PushMessageContentsSchemas$ || (exports.PushMessageContentsSchemas$ = PushMessageContentsSchemas$ = {}));
function pushMessageContentsSchemasToJSON(pushMessageContentsSchemas) {
    return JSON.stringify(exports.PushMessageContentsSchemas$outboundSchema.parse(pushMessageContentsSchemas));
}
exports.pushMessageContentsSchemasToJSON = pushMessageContentsSchemasToJSON;
function pushMessageContentsSchemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessageContentsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessageContentsSchemas' from JSON`);
}
exports.pushMessageContentsSchemasFromJSON = pushMessageContentsSchemasFromJSON;
/** @internal */
exports.Schemas$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.Schemas$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 Schemas$;
(function (Schemas$) {
    /** @deprecated use `Schemas$inboundSchema` instead. */
    Schemas$.inboundSchema = exports.Schemas$inboundSchema;
    /** @deprecated use `Schemas$outboundSchema` instead. */
    Schemas$.outboundSchema = exports.Schemas$outboundSchema;
})(Schemas$ || (exports.Schemas$ = Schemas$ = {}));
function schemasToJSON(schemas) {
    return JSON.stringify(exports.Schemas$outboundSchema.parse(schemas));
}
exports.schemasToJSON = schemasToJSON;
function schemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Schemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schemas' from JSON`);
}
exports.schemasFromJSON = schemasFromJSON;
/** @internal */
exports.SmsMessageContentsSchemas$inboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    from: z.nullable(z.string()).optional(),
});
/** @internal */
exports.SmsMessageContentsSchemas$outboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    from: z.nullable(z.string()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var SmsMessageContentsSchemas$;
(function (SmsMessageContentsSchemas$) {
    /** @deprecated use `SmsMessageContentsSchemas$inboundSchema` instead. */
    SmsMessageContentsSchemas$.inboundSchema = exports.SmsMessageContentsSchemas$inboundSchema;
    /** @deprecated use `SmsMessageContentsSchemas$outboundSchema` instead. */
    SmsMessageContentsSchemas$.outboundSchema = exports.SmsMessageContentsSchemas$outboundSchema;
})(SmsMessageContentsSchemas$ || (exports.SmsMessageContentsSchemas$ = SmsMessageContentsSchemas$ = {}));
function smsMessageContentsSchemasToJSON(smsMessageContentsSchemas) {
    return JSON.stringify(exports.SmsMessageContentsSchemas$outboundSchema.parse(smsMessageContentsSchemas));
}
exports.smsMessageContentsSchemasToJSON = smsMessageContentsSchemasToJSON;
function smsMessageContentsSchemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SmsMessageContentsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessageContentsSchemas' from JSON`);
}
exports.smsMessageContentsSchemasFromJSON = smsMessageContentsSchemasFromJSON;
/** @internal */
exports.MessageContent$inboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$inboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$inboundSchema),
    z.lazy(() => exports.Schemas$inboundSchema),
]);
/** @internal */
exports.MessageContent$outboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$outboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$outboundSchema),
    z.lazy(() => exports.Schemas$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MessageContent$;
(function (MessageContent$) {
    /** @deprecated use `MessageContent$inboundSchema` instead. */
    MessageContent$.inboundSchema = exports.MessageContent$inboundSchema;
    /** @deprecated use `MessageContent$outboundSchema` instead. */
    MessageContent$.outboundSchema = exports.MessageContent$outboundSchema;
})(MessageContent$ || (exports.MessageContent$ = MessageContent$ = {}));
function messageContentToJSON(messageContent) {
    return JSON.stringify(exports.MessageContent$outboundSchema.parse(messageContent));
}
exports.messageContentToJSON = messageContentToJSON;
function messageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageContent' from JSON`);
}
exports.messageContentFromJSON = messageContentFromJSON;
/** @internal */
exports.CreateMessage4$inboundSchema = z.object({});
/** @internal */
exports.CreateMessage4$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 CreateMessage4$;
(function (CreateMessage4$) {
    /** @deprecated use `CreateMessage4$inboundSchema` instead. */
    CreateMessage4$.inboundSchema = exports.CreateMessage4$inboundSchema;
    /** @deprecated use `CreateMessage4$outboundSchema` instead. */
    CreateMessage4$.outboundSchema = exports.CreateMessage4$outboundSchema;
})(CreateMessage4$ || (exports.CreateMessage4$ = CreateMessage4$ = {}));
function createMessage4ToJSON(createMessage4) {
    return JSON.stringify(exports.CreateMessage4$outboundSchema.parse(createMessage4));
}
exports.createMessage4ToJSON = createMessage4ToJSON;
function createMessage4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateMessage4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateMessage4' from JSON`);
}
exports.createMessage4FromJSON = createMessage4FromJSON;
/** @internal */
exports.CreateMessageSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.CreateMessage4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.CreateMessageSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.CreateMessage4$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 CreateMessageSourceValue$;
(function (CreateMessageSourceValue$) {
    /** @deprecated use `CreateMessageSourceValue$inboundSchema` instead. */
    CreateMessageSourceValue$.inboundSchema = exports.CreateMessageSourceValue$inboundSchema;
    /** @deprecated use `CreateMessageSourceValue$outboundSchema` instead. */
    CreateMessageSourceValue$.outboundSchema = exports.CreateMessageSourceValue$outboundSchema;
})(CreateMessageSourceValue$ || (exports.CreateMessageSourceValue$ = CreateMessageSourceValue$ = {}));
function createMessageSourceValueToJSON(createMessageSourceValue) {
    return JSON.stringify(exports.CreateMessageSourceValue$outboundSchema.parse(createMessageSourceValue));
}
exports.createMessageSourceValueToJSON = createMessageSourceValueToJSON;
function createMessageSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateMessageSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateMessageSourceValue' from JSON`);
}
exports.createMessageSourceValueFromJSON = createMessageSourceValueFromJSON;
/** @internal */
exports.CreateMessageValue$inboundSchema = z
    .union([
    z.nativeEnum(CreateMessageValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.CreateMessageValue$outboundSchema = z.union([
    z.nativeEnum(CreateMessageValue),
    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 CreateMessageValue$;
(function (CreateMessageValue$) {
    /** @deprecated use `CreateMessageValue$inboundSchema` instead. */
    CreateMessageValue$.inboundSchema = exports.CreateMessageValue$inboundSchema;
    /** @deprecated use `CreateMessageValue$outboundSchema` instead. */
    CreateMessageValue$.outboundSchema = exports.CreateMessageValue$outboundSchema;
})(CreateMessageValue$ || (exports.CreateMessageValue$ = CreateMessageValue$ = {}));
/** @internal */
exports.MessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.CreateMessage4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CreateMessageValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.MessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.CreateMessage4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CreateMessageValue$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 MessageType$;
(function (MessageType$) {
    /** @deprecated use `MessageType$inboundSchema` instead. */
    MessageType$.inboundSchema = exports.MessageType$inboundSchema;
    /** @deprecated use `MessageType$outboundSchema` instead. */
    MessageType$.outboundSchema = exports.MessageType$outboundSchema;
})(MessageType$ || (exports.MessageType$ = MessageType$ = {}));
function messageTypeToJSON(messageType) {
    return JSON.stringify(exports.MessageType$outboundSchema.parse(messageType));
}
exports.messageTypeToJSON = messageTypeToJSON;
function messageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageType' from JSON`);
}
exports.messageTypeFromJSON = messageTypeFromJSON;
/** @internal */
exports.CreateMessage$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    message_content: z.nullable(z.union([
        z.lazy(() => exports.SmsMessageContentsSchemas$inboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$inboundSchema),
        z.lazy(() => exports.Schemas$inboundSchema),
    ])).optional(),
    message_type: z.nullable(z.lazy(() => exports.MessageType$inboundSchema)).optional(),
    name: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "message_content": "messageContent",
        "message_type": "messageType",
    });
});
/** @internal */
exports.CreateMessage$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    messageContent: z.nullable(z.union([
        z.lazy(() => exports.SmsMessageContentsSchemas$outboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$outboundSchema),
        z.lazy(() => exports.Schemas$outboundSchema),
    ])).optional(),
    messageType: z.nullable(z.lazy(() => exports.MessageType$outboundSchema)).optional(),
    name: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        messageContent: "message_content",
        messageType: "message_type",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var CreateMessage$;
(function (CreateMessage$) {
    /** @deprecated use `CreateMessage$inboundSchema` instead. */
    CreateMessage$.inboundSchema = exports.CreateMessage$inboundSchema;
    /** @deprecated use `CreateMessage$outboundSchema` instead. */
    CreateMessage$.outboundSchema = exports.CreateMessage$outboundSchema;
})(CreateMessage$ || (exports.CreateMessage$ = CreateMessage$ = {}));
function createMessageToJSON(createMessage) {
    return JSON.stringify(exports.CreateMessage$outboundSchema.parse(createMessage));
}
exports.createMessageToJSON = createMessageToJSON;
function createMessageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateMessage' from JSON`);
}
exports.createMessageFromJSON = createMessageFromJSON;
/** @internal */
exports.MessageMessageContent$inboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$inboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$inboundSchema),
    z.lazy(() => exports.Schemas$inboundSchema),
]);
/** @internal */
exports.MessageMessageContent$outboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$outboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$outboundSchema),
    z.lazy(() => exports.Schemas$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MessageMessageContent$;
(function (MessageMessageContent$) {
    /** @deprecated use `MessageMessageContent$inboundSchema` instead. */
    MessageMessageContent$.inboundSchema = exports.MessageMessageContent$inboundSchema;
    /** @deprecated use `MessageMessageContent$outboundSchema` instead. */
    MessageMessageContent$.outboundSchema = exports.MessageMessageContent$outboundSchema;
})(MessageMessageContent$ || (exports.MessageMessageContent$ = MessageMessageContent$ = {}));
function messageMessageContentToJSON(messageMessageContent) {
    return JSON.stringify(exports.MessageMessageContent$outboundSchema.parse(messageMessageContent));
}
exports.messageMessageContentToJSON = messageMessageContentToJSON;
function messageMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageMessageContent' from JSON`);
}
exports.messageMessageContentFromJSON = messageMessageContentFromJSON;
/** @internal */
exports.Message4$inboundSchema = z.object({});
/** @internal */
exports.Message4$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 Message4$;
(function (Message4$) {
    /** @deprecated use `Message4$inboundSchema` instead. */
    Message4$.inboundSchema = exports.Message4$inboundSchema;
    /** @deprecated use `Message4$outboundSchema` instead. */
    Message4$.outboundSchema = exports.Message4$outboundSchema;
})(Message4$ || (exports.Message4$ = Message4$ = {}));
function message4ToJSON(message4) {
    return JSON.stringify(exports.Message4$outboundSchema.parse(message4));
}
exports.message4ToJSON = message4ToJSON;
function message4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message4' from JSON`);
}
exports.message4FromJSON = message4FromJSON;
/** @internal */
exports.MessageSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Message4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.MessageSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Message4$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 MessageSourceValue$;
(function (MessageSourceValue$) {
    /** @deprecated use `MessageSourceValue$inboundSchema` instead. */
    MessageSourceValue$.inboundSchema = exports.MessageSourceValue$inboundSchema;
    /** @deprecated use `MessageSourceValue$outboundSchema` instead. */
    MessageSourceValue$.outboundSchema = exports.MessageSourceValue$outboundSchema;
})(MessageSourceValue$ || (exports.MessageSourceValue$ = MessageSourceValue$ = {}));
function messageSourceValueToJSON(messageSourceValue) {
    return JSON.stringify(exports.MessageSourceValue$outboundSchema.parse(messageSourceValue));
}
exports.messageSourceValueToJSON = messageSourceValueToJSON;
function messageSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageSourceValue' from JSON`);
}
exports.messageSourceValueFromJSON = messageSourceValueFromJSON;
/** @internal */
exports.MessageValue$inboundSchema = z
    .union([
    z.nativeEnum(MessageValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.MessageValue$outboundSchema = z.union([
    z.nativeEnum(MessageValue),
    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 MessageValue$;
(function (MessageValue$) {
    /** @deprecated use `MessageValue$inboundSchema` instead. */
    MessageValue$.inboundSchema = exports.MessageValue$inboundSchema;
    /** @deprecated use `MessageValue$outboundSchema` instead. */
    MessageValue$.outboundSchema = exports.MessageValue$outboundSchema;
})(MessageValue$ || (exports.MessageValue$ = MessageValue$ = {}));
/** @internal */
exports.MessageMessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Message4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.MessageValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.MessageMessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Message4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.MessageValue$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 MessageMessageType$;
(function (MessageMessageType$) {
    /** @deprecated use `MessageMessageType$inboundSchema` instead. */
    MessageMessageType$.inboundSchema = exports.MessageMessageType$inboundSchema;
    /** @deprecated use `MessageMessageType$outboundSchema` instead. */
    MessageMessageType$.outboundSchema = exports.MessageMessageType$outboundSchema;
})(MessageMessageType$ || (exports.MessageMessageType$ = MessageMessageType$ = {}));
function messageMessageTypeToJSON(messageMessageType) {
    return JSON.stringify(exports.MessageMessageType$outboundSchema.parse(messageMessageType));
}
exports.messageMessageTypeToJSON = messageMessageTypeToJSON;
function messageMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageMessageType' from JSON`);
}
exports.messageMessageTypeFromJSON = messageMessageTypeFromJSON;
/** @internal */
exports.Message$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    message_content: z.nullable(z.union([
        z.lazy(() => exports.SmsMessageContentsSchemas$inboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$inboundSchema),
        z.lazy(() => exports.Schemas$inboundSchema),
    ])).optional(),
    message_type: z.nullable(z.lazy(() => exports.MessageMessageType$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.Message$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    messageContent: z.nullable(z.union([
        z.lazy(() => exports.SmsMessageContentsSchemas$outboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$outboundSchema),
        z.lazy(() => exports.Schemas$outboundSchema),
    ])).optional(),
    messageType: z.nullable(z.lazy(() => exports.MessageMessageType$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 Message$;
(function (Message$) {
    /** @deprecated use `Message$inboundSchema` instead. */
    Message$.inboundSchema = exports.Message$inboundSchema;
    /** @deprecated use `Message$outboundSchema` instead. */
    Message$.outboundSchema = exports.Message$outboundSchema;
})(Message$ || (exports.Message$ = Message$ = {}));
function messageToJSON(message) {
    return JSON.stringify(exports.Message$outboundSchema.parse(message));
}
exports.messageToJSON = messageToJSON;
function messageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message' from JSON`);
}
exports.messageFromJSON = messageFromJSON;
//# sourceMappingURL=createmessage.js.map