"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.Message$inboundSchema = exports.MessageMessageType$inboundSchema = exports.MessageValue$inboundSchema = exports.MessageSourceValue$inboundSchema = exports.Message4$inboundSchema = exports.MessageMessageContent$inboundSchema = exports.CreateMessage$outboundSchema = exports.MessageType$outboundSchema = exports.CreateMessageValue$outboundSchema = exports.CreateMessageSourceValue$outboundSchema = exports.CreateMessage4$outboundSchema = exports.MessageContent$outboundSchema = exports.SmsMessageContentsSchemas$outboundSchema = exports.SmsMessageContentsSchemas$inboundSchema = exports.Schemas$outboundSchema = exports.Schemas$inboundSchema = exports.PushMessageContentsSchemas$outboundSchema = exports.PushMessageContentsSchemas$inboundSchema = exports.MessageValue = exports.CreateMessageValue = void 0;
exports.pushMessageContentsSchemasToJSON = pushMessageContentsSchemasToJSON;
exports.pushMessageContentsSchemasFromJSON = pushMessageContentsSchemasFromJSON;
exports.schemasToJSON = schemasToJSON;
exports.schemasFromJSON = schemasFromJSON;
exports.smsMessageContentsSchemasToJSON = smsMessageContentsSchemasToJSON;
exports.smsMessageContentsSchemasFromJSON = smsMessageContentsSchemasFromJSON;
exports.messageContentToJSON = messageContentToJSON;
exports.createMessage4ToJSON = createMessage4ToJSON;
exports.createMessageSourceValueToJSON = createMessageSourceValueToJSON;
exports.messageTypeToJSON = messageTypeToJSON;
exports.createMessageToJSON = createMessageToJSON;
exports.messageMessageContentFromJSON = messageMessageContentFromJSON;
exports.message4FromJSON = message4FromJSON;
exports.messageSourceValueFromJSON = messageSourceValueFromJSON;
exports.messageMessageTypeFromJSON = messageMessageTypeFromJSON;
exports.messageFromJSON = messageFromJSON;
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"));
/**
 * 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(),
});
function pushMessageContentsSchemasToJSON(pushMessageContentsSchemas) {
    return JSON.stringify(exports.PushMessageContentsSchemas$outboundSchema.parse(pushMessageContentsSchemas));
}
function pushMessageContentsSchemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessageContentsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessageContentsSchemas' from JSON`);
}
/** @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",
    });
});
function schemasToJSON(schemas) {
    return JSON.stringify(exports.Schemas$outboundSchema.parse(schemas));
}
function schemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Schemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schemas' from JSON`);
}
/** @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(),
});
function smsMessageContentsSchemasToJSON(smsMessageContentsSchemas) {
    return JSON.stringify(exports.SmsMessageContentsSchemas$outboundSchema.parse(smsMessageContentsSchemas));
}
function smsMessageContentsSchemasFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SmsMessageContentsSchemas$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SmsMessageContentsSchemas' from JSON`);
}
/** @internal */
exports.MessageContent$outboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$outboundSchema),
    z.lazy(() => exports.Schemas$outboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$outboundSchema),
]);
function messageContentToJSON(messageContent) {
    return JSON.stringify(exports.MessageContent$outboundSchema.parse(messageContent));
}
/** @internal */
exports.CreateMessage4$outboundSchema = z.object({});
function createMessage4ToJSON(createMessage4) {
    return JSON.stringify(exports.CreateMessage4$outboundSchema.parse(createMessage4));
}
/** @internal */
exports.CreateMessageSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.CreateMessage4$outboundSchema),
    z.array(z.any()),
]);
function createMessageSourceValueToJSON(createMessageSourceValue) {
    return JSON.stringify(exports.CreateMessageSourceValue$outboundSchema.parse(createMessageSourceValue));
}
/** @internal */
exports.CreateMessageValue$outboundSchema = openEnums.outboundSchema(CreateMessageValue);
/** @internal */
exports.MessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.CreateMessage4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CreateMessageValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
function messageTypeToJSON(messageType) {
    return JSON.stringify(exports.MessageType$outboundSchema.parse(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.Schemas$outboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$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",
    });
});
function createMessageToJSON(createMessage) {
    return JSON.stringify(exports.CreateMessage$outboundSchema.parse(createMessage));
}
/** @internal */
exports.MessageMessageContent$inboundSchema = z.union([
    z.lazy(() => exports.SmsMessageContentsSchemas$inboundSchema),
    z.lazy(() => exports.Schemas$inboundSchema),
    z.lazy(() => exports.PushMessageContentsSchemas$inboundSchema),
]);
function messageMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageMessageContent' from JSON`);
}
/** @internal */
exports.Message4$inboundSchema = z.object({});
function message4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message4' from JSON`);
}
/** @internal */
exports.MessageSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Message4$inboundSchema),
    z.array(z.any()),
]);
function messageSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageSourceValue' from JSON`);
}
/** @internal */
exports.MessageValue$inboundSchema = openEnums.inboundSchema(MessageValue);
/** @internal */
exports.MessageMessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Message4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.MessageValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function messageMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessageMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageMessageType' from JSON`);
}
/** @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.Schemas$inboundSchema),
        z.lazy(() => exports.PushMessageContentsSchemas$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",
    });
});
function messageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Message$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Message' from JSON`);
}
//# sourceMappingURL=createmessage.js.map