"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.inAppMessagesFromJSON = exports.inAppMessagesToJSON = exports.InAppMessages$ = exports.InAppMessages$outboundSchema = exports.InAppMessages$inboundSchema = exports.inAppMessagesMessageTypeFromJSON = exports.inAppMessagesMessageTypeToJSON = exports.InAppMessagesMessageType$ = exports.InAppMessagesMessageType$outboundSchema = exports.InAppMessagesMessageType$inboundSchema = exports.InAppMessagesValue$ = exports.InAppMessagesValue$outboundSchema = exports.InAppMessagesValue$inboundSchema = exports.inAppMessagesSourceValueFromJSON = exports.inAppMessagesSourceValueToJSON = exports.InAppMessagesSourceValue$ = exports.InAppMessagesSourceValue$outboundSchema = exports.InAppMessagesSourceValue$inboundSchema = exports.inAppMessages4FromJSON = exports.inAppMessages4ToJSON = exports.InAppMessages4$ = exports.InAppMessages4$outboundSchema = exports.InAppMessages4$inboundSchema = exports.inAppMessagesMessageContentFromJSON = exports.inAppMessagesMessageContentToJSON = exports.InAppMessagesMessageContent$ = exports.InAppMessagesMessageContent$outboundSchema = exports.InAppMessagesMessageContent$inboundSchema = exports.InAppMessagesValue = 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 InAppMessagesValue;
(function (InAppMessagesValue) {
    InAppMessagesValue["Email"] = "email";
    InAppMessagesValue["Sms"] = "sms";
    InAppMessagesValue["Push"] = "push";
    InAppMessagesValue["WebPush"] = "web_push";
    InAppMessagesValue["IosPush"] = "ios_push";
    InAppMessagesValue["AndroidPush"] = "android_push";
    InAppMessagesValue["AppPush"] = "app_push";
    InAppMessagesValue["OmniChannel"] = "omni_channel";
    InAppMessagesValue["ContentBlock"] = "content_block";
    InAppMessagesValue["InApp"] = "in_app";
    InAppMessagesValue["Unknown"] = "unknown";
    InAppMessagesValue["UnmappedValue"] = "unmapped_value";
})(InAppMessagesValue || (exports.InAppMessagesValue = InAppMessagesValue = {}));
/** @internal */
exports.InAppMessagesMessageContent$inboundSchema = z.object({
    body: z.nullable(z.string()).optional(),
});
/** @internal */
exports.InAppMessagesMessageContent$outboundSchema = z.object({
    body: 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 InAppMessagesMessageContent$;
(function (InAppMessagesMessageContent$) {
    /** @deprecated use `InAppMessagesMessageContent$inboundSchema` instead. */
    InAppMessagesMessageContent$.inboundSchema = exports.InAppMessagesMessageContent$inboundSchema;
    /** @deprecated use `InAppMessagesMessageContent$outboundSchema` instead. */
    InAppMessagesMessageContent$.outboundSchema = exports.InAppMessagesMessageContent$outboundSchema;
})(InAppMessagesMessageContent$ || (exports.InAppMessagesMessageContent$ = InAppMessagesMessageContent$ = {}));
function inAppMessagesMessageContentToJSON(inAppMessagesMessageContent) {
    return JSON.stringify(exports.InAppMessagesMessageContent$outboundSchema.parse(inAppMessagesMessageContent));
}
exports.inAppMessagesMessageContentToJSON = inAppMessagesMessageContentToJSON;
function inAppMessagesMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesMessageContent' from JSON`);
}
exports.inAppMessagesMessageContentFromJSON = inAppMessagesMessageContentFromJSON;
/** @internal */
exports.InAppMessages4$inboundSchema = z.object({});
/** @internal */
exports.InAppMessages4$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 InAppMessages4$;
(function (InAppMessages4$) {
    /** @deprecated use `InAppMessages4$inboundSchema` instead. */
    InAppMessages4$.inboundSchema = exports.InAppMessages4$inboundSchema;
    /** @deprecated use `InAppMessages4$outboundSchema` instead. */
    InAppMessages4$.outboundSchema = exports.InAppMessages4$outboundSchema;
})(InAppMessages4$ || (exports.InAppMessages4$ = InAppMessages4$ = {}));
function inAppMessages4ToJSON(inAppMessages4) {
    return JSON.stringify(exports.InAppMessages4$outboundSchema.parse(inAppMessages4));
}
exports.inAppMessages4ToJSON = inAppMessages4ToJSON;
function inAppMessages4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessages4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessages4' from JSON`);
}
exports.inAppMessages4FromJSON = inAppMessages4FromJSON;
/** @internal */
exports.InAppMessagesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.InAppMessages4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.InAppMessagesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.InAppMessages4$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 InAppMessagesSourceValue$;
(function (InAppMessagesSourceValue$) {
    /** @deprecated use `InAppMessagesSourceValue$inboundSchema` instead. */
    InAppMessagesSourceValue$.inboundSchema = exports.InAppMessagesSourceValue$inboundSchema;
    /** @deprecated use `InAppMessagesSourceValue$outboundSchema` instead. */
    InAppMessagesSourceValue$.outboundSchema = exports.InAppMessagesSourceValue$outboundSchema;
})(InAppMessagesSourceValue$ || (exports.InAppMessagesSourceValue$ = InAppMessagesSourceValue$ = {}));
function inAppMessagesSourceValueToJSON(inAppMessagesSourceValue) {
    return JSON.stringify(exports.InAppMessagesSourceValue$outboundSchema.parse(inAppMessagesSourceValue));
}
exports.inAppMessagesSourceValueToJSON = inAppMessagesSourceValueToJSON;
function inAppMessagesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesSourceValue' from JSON`);
}
exports.inAppMessagesSourceValueFromJSON = inAppMessagesSourceValueFromJSON;
/** @internal */
exports.InAppMessagesValue$inboundSchema = z
    .union([
    z.nativeEnum(InAppMessagesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.InAppMessagesValue$outboundSchema = z.union([
    z.nativeEnum(InAppMessagesValue),
    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 InAppMessagesValue$;
(function (InAppMessagesValue$) {
    /** @deprecated use `InAppMessagesValue$inboundSchema` instead. */
    InAppMessagesValue$.inboundSchema = exports.InAppMessagesValue$inboundSchema;
    /** @deprecated use `InAppMessagesValue$outboundSchema` instead. */
    InAppMessagesValue$.outboundSchema = exports.InAppMessagesValue$outboundSchema;
})(InAppMessagesValue$ || (exports.InAppMessagesValue$ = InAppMessagesValue$ = {}));
/** @internal */
exports.InAppMessagesMessageType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.InAppMessages4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.InAppMessagesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.InAppMessagesMessageType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.InAppMessages4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.InAppMessagesValue$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 InAppMessagesMessageType$;
(function (InAppMessagesMessageType$) {
    /** @deprecated use `InAppMessagesMessageType$inboundSchema` instead. */
    InAppMessagesMessageType$.inboundSchema = exports.InAppMessagesMessageType$inboundSchema;
    /** @deprecated use `InAppMessagesMessageType$outboundSchema` instead. */
    InAppMessagesMessageType$.outboundSchema = exports.InAppMessagesMessageType$outboundSchema;
})(InAppMessagesMessageType$ || (exports.InAppMessagesMessageType$ = InAppMessagesMessageType$ = {}));
function inAppMessagesMessageTypeToJSON(inAppMessagesMessageType) {
    return JSON.stringify(exports.InAppMessagesMessageType$outboundSchema.parse(inAppMessagesMessageType));
}
exports.inAppMessagesMessageTypeToJSON = inAppMessagesMessageTypeToJSON;
function inAppMessagesMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesMessageType' from JSON`);
}
exports.inAppMessagesMessageTypeFromJSON = inAppMessagesMessageTypeFromJSON;
/** @internal */
exports.InAppMessages$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    message_content: z.nullable(z.lazy(() => exports.InAppMessagesMessageContent$inboundSchema)).optional(),
    message_type: z.nullable(z.lazy(() => exports.InAppMessagesMessageType$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.InAppMessages$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    messageContent: z.nullable(z.lazy(() => exports.InAppMessagesMessageContent$outboundSchema)).optional(),
    messageType: z.nullable(z.lazy(() => exports.InAppMessagesMessageType$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 InAppMessages$;
(function (InAppMessages$) {
    /** @deprecated use `InAppMessages$inboundSchema` instead. */
    InAppMessages$.inboundSchema = exports.InAppMessages$inboundSchema;
    /** @deprecated use `InAppMessages$outboundSchema` instead. */
    InAppMessages$.outboundSchema = exports.InAppMessages$outboundSchema;
})(InAppMessages$ || (exports.InAppMessages$ = InAppMessages$ = {}));
function inAppMessagesToJSON(inAppMessages) {
    return JSON.stringify(exports.InAppMessages$outboundSchema.parse(inAppMessages));
}
exports.inAppMessagesToJSON = inAppMessagesToJSON;
function inAppMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessages' from JSON`);
}
exports.inAppMessagesFromJSON = inAppMessagesFromJSON;
//# sourceMappingURL=inappmessages.js.map