"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.pushMessagesFromJSON = exports.pushMessagesToJSON = exports.PushMessages$ = exports.PushMessages$outboundSchema = exports.PushMessages$inboundSchema = exports.pushMessagesMessageTypeFromJSON = exports.pushMessagesMessageTypeToJSON = exports.PushMessagesMessageType$ = exports.PushMessagesMessageType$outboundSchema = exports.PushMessagesMessageType$inboundSchema = exports.PushMessagesValue$ = exports.PushMessagesValue$outboundSchema = exports.PushMessagesValue$inboundSchema = exports.pushMessagesSourceValueFromJSON = exports.pushMessagesSourceValueToJSON = exports.PushMessagesSourceValue$ = exports.PushMessagesSourceValue$outboundSchema = exports.PushMessagesSourceValue$inboundSchema = exports.pushMessages4FromJSON = exports.pushMessages4ToJSON = exports.PushMessages4$ = exports.PushMessages4$outboundSchema = exports.PushMessages4$inboundSchema = exports.pushMessagesMessageContentFromJSON = exports.pushMessagesMessageContentToJSON = exports.PushMessagesMessageContent$ = exports.PushMessagesMessageContent$outboundSchema = exports.PushMessagesMessageContent$inboundSchema = exports.PushMessagesValue = 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 PushMessagesValue;
(function (PushMessagesValue) {
    PushMessagesValue["Email"] = "email";
    PushMessagesValue["Sms"] = "sms";
    PushMessagesValue["Push"] = "push";
    PushMessagesValue["WebPush"] = "web_push";
    PushMessagesValue["IosPush"] = "ios_push";
    PushMessagesValue["AndroidPush"] = "android_push";
    PushMessagesValue["AppPush"] = "app_push";
    PushMessagesValue["OmniChannel"] = "omni_channel";
    PushMessagesValue["ContentBlock"] = "content_block";
    PushMessagesValue["InApp"] = "in_app";
    PushMessagesValue["Unknown"] = "unknown";
    PushMessagesValue["UnmappedValue"] = "unmapped_value";
})(PushMessagesValue || (exports.PushMessagesValue = PushMessagesValue = {}));
/** @internal */
exports.PushMessagesMessageContent$inboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
    subtitle: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
});
/** @internal */
exports.PushMessagesMessageContent$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 PushMessagesMessageContent$;
(function (PushMessagesMessageContent$) {
    /** @deprecated use `PushMessagesMessageContent$inboundSchema` instead. */
    PushMessagesMessageContent$.inboundSchema = exports.PushMessagesMessageContent$inboundSchema;
    /** @deprecated use `PushMessagesMessageContent$outboundSchema` instead. */
    PushMessagesMessageContent$.outboundSchema = exports.PushMessagesMessageContent$outboundSchema;
})(PushMessagesMessageContent$ || (exports.PushMessagesMessageContent$ = PushMessagesMessageContent$ = {}));
function pushMessagesMessageContentToJSON(pushMessagesMessageContent) {
    return JSON.stringify(exports.PushMessagesMessageContent$outboundSchema.parse(pushMessagesMessageContent));
}
exports.pushMessagesMessageContentToJSON = pushMessagesMessageContentToJSON;
function pushMessagesMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessagesMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessagesMessageContent' from JSON`);
}
exports.pushMessagesMessageContentFromJSON = pushMessagesMessageContentFromJSON;
/** @internal */
exports.PushMessages4$inboundSchema = z.object({});
/** @internal */
exports.PushMessages4$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 PushMessages4$;
(function (PushMessages4$) {
    /** @deprecated use `PushMessages4$inboundSchema` instead. */
    PushMessages4$.inboundSchema = exports.PushMessages4$inboundSchema;
    /** @deprecated use `PushMessages4$outboundSchema` instead. */
    PushMessages4$.outboundSchema = exports.PushMessages4$outboundSchema;
})(PushMessages4$ || (exports.PushMessages4$ = PushMessages4$ = {}));
function pushMessages4ToJSON(pushMessages4) {
    return JSON.stringify(exports.PushMessages4$outboundSchema.parse(pushMessages4));
}
exports.pushMessages4ToJSON = pushMessages4ToJSON;
function pushMessages4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessages4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessages4' from JSON`);
}
exports.pushMessages4FromJSON = pushMessages4FromJSON;
/** @internal */
exports.PushMessagesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.PushMessages4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.PushMessagesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.PushMessages4$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 PushMessagesSourceValue$;
(function (PushMessagesSourceValue$) {
    /** @deprecated use `PushMessagesSourceValue$inboundSchema` instead. */
    PushMessagesSourceValue$.inboundSchema = exports.PushMessagesSourceValue$inboundSchema;
    /** @deprecated use `PushMessagesSourceValue$outboundSchema` instead. */
    PushMessagesSourceValue$.outboundSchema = exports.PushMessagesSourceValue$outboundSchema;
})(PushMessagesSourceValue$ || (exports.PushMessagesSourceValue$ = PushMessagesSourceValue$ = {}));
function pushMessagesSourceValueToJSON(pushMessagesSourceValue) {
    return JSON.stringify(exports.PushMessagesSourceValue$outboundSchema.parse(pushMessagesSourceValue));
}
exports.pushMessagesSourceValueToJSON = pushMessagesSourceValueToJSON;
function pushMessagesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessagesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessagesSourceValue' from JSON`);
}
exports.pushMessagesSourceValueFromJSON = pushMessagesSourceValueFromJSON;
/** @internal */
exports.PushMessagesValue$inboundSchema = z
    .union([
    z.nativeEnum(PushMessagesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.PushMessagesValue$outboundSchema = z.union([
    z.nativeEnum(PushMessagesValue),
    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 PushMessagesValue$;
(function (PushMessagesValue$) {
    /** @deprecated use `PushMessagesValue$inboundSchema` instead. */
    PushMessagesValue$.inboundSchema = exports.PushMessagesValue$inboundSchema;
    /** @deprecated use `PushMessagesValue$outboundSchema` instead. */
    PushMessagesValue$.outboundSchema = exports.PushMessagesValue$outboundSchema;
})(PushMessagesValue$ || (exports.PushMessagesValue$ = PushMessagesValue$ = {}));
/** @internal */
exports.PushMessagesMessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.PushMessages4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.PushMessagesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.PushMessagesMessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.PushMessages4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.PushMessagesValue$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 PushMessagesMessageType$;
(function (PushMessagesMessageType$) {
    /** @deprecated use `PushMessagesMessageType$inboundSchema` instead. */
    PushMessagesMessageType$.inboundSchema = exports.PushMessagesMessageType$inboundSchema;
    /** @deprecated use `PushMessagesMessageType$outboundSchema` instead. */
    PushMessagesMessageType$.outboundSchema = exports.PushMessagesMessageType$outboundSchema;
})(PushMessagesMessageType$ || (exports.PushMessagesMessageType$ = PushMessagesMessageType$ = {}));
function pushMessagesMessageTypeToJSON(pushMessagesMessageType) {
    return JSON.stringify(exports.PushMessagesMessageType$outboundSchema.parse(pushMessagesMessageType));
}
exports.pushMessagesMessageTypeToJSON = pushMessagesMessageTypeToJSON;
function pushMessagesMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessagesMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessagesMessageType' from JSON`);
}
exports.pushMessagesMessageTypeFromJSON = pushMessagesMessageTypeFromJSON;
/** @internal */
exports.PushMessages$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    message_content: z.nullable(z.lazy(() => exports.PushMessagesMessageContent$inboundSchema)).optional(),
    message_type: z.nullable(z.lazy(() => exports.PushMessagesMessageType$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.PushMessages$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    messageContent: z.nullable(z.lazy(() => exports.PushMessagesMessageContent$outboundSchema)).optional(),
    messageType: z.nullable(z.lazy(() => exports.PushMessagesMessageType$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 PushMessages$;
(function (PushMessages$) {
    /** @deprecated use `PushMessages$inboundSchema` instead. */
    PushMessages$.inboundSchema = exports.PushMessages$inboundSchema;
    /** @deprecated use `PushMessages$outboundSchema` instead. */
    PushMessages$.outboundSchema = exports.PushMessages$outboundSchema;
})(PushMessages$ || (exports.PushMessages$ = PushMessages$ = {}));
function pushMessagesToJSON(pushMessages) {
    return JSON.stringify(exports.PushMessages$outboundSchema.parse(pushMessages));
}
exports.pushMessagesToJSON = pushMessagesToJSON;
function pushMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PushMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PushMessages' from JSON`);
}
exports.pushMessagesFromJSON = pushMessagesFromJSON;
//# sourceMappingURL=pushmessages.js.map