"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.InAppMessages$ = exports.InAppMessages$outboundSchema = exports.InAppMessages$inboundSchema = exports.InAppMessagesMessageType$ = exports.InAppMessagesMessageType$outboundSchema = exports.InAppMessagesMessageType$inboundSchema = exports.InAppMessagesValue$ = exports.InAppMessagesValue$outboundSchema = exports.InAppMessagesValue$inboundSchema = exports.InAppMessagesSourceValue$ = exports.InAppMessagesSourceValue$outboundSchema = exports.InAppMessagesSourceValue$inboundSchema = exports.InAppMessages4$ = exports.InAppMessages4$outboundSchema = exports.InAppMessages4$inboundSchema = exports.InAppMessagesMessageContent$ = exports.InAppMessagesMessageContent$outboundSchema = exports.InAppMessagesMessageContent$inboundSchema = exports.InAppMessagesValue = void 0;
exports.inAppMessagesMessageContentToJSON = inAppMessagesMessageContentToJSON;
exports.inAppMessagesMessageContentFromJSON = inAppMessagesMessageContentFromJSON;
exports.inAppMessages4ToJSON = inAppMessages4ToJSON;
exports.inAppMessages4FromJSON = inAppMessages4FromJSON;
exports.inAppMessagesSourceValueToJSON = inAppMessagesSourceValueToJSON;
exports.inAppMessagesSourceValueFromJSON = inAppMessagesSourceValueFromJSON;
exports.inAppMessagesMessageTypeToJSON = inAppMessagesMessageTypeToJSON;
exports.inAppMessagesMessageTypeFromJSON = inAppMessagesMessageTypeFromJSON;
exports.inAppMessagesToJSON = inAppMessagesToJSON;
exports.inAppMessagesFromJSON = inAppMessagesFromJSON;
const z = __importStar(require("zod/v3"));
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));
}
function inAppMessagesMessageContentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesMessageContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesMessageContent' from JSON`);
}
/** @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));
}
function inAppMessages4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessages4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessages4' from JSON`);
}
/** @internal */
exports.InAppMessagesSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.InAppMessages4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.InAppMessagesSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.InAppMessages4$outboundSchema),
    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));
}
function inAppMessagesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesSourceValue' from JSON`);
}
/** @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.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.InAppMessages4$inboundSchema),
        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.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.InAppMessages4$outboundSchema),
        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));
}
function inAppMessagesMessageTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessagesMessageType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessagesMessageType' from JSON`);
}
/** @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));
}
function inAppMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.InAppMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppMessages' from JSON`);
}
//# sourceMappingURL=inappmessages.js.map