"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.channelsEnumFromJSON = exports.channelsEnumToJSON = exports.ChannelsEnum$ = exports.ChannelsEnum$outboundSchema = exports.ChannelsEnum$inboundSchema = exports.Value$ = exports.Value$outboundSchema = exports.Value$inboundSchema = exports.sourceValueFromJSON = exports.sourceValueToJSON = exports.SourceValue$ = exports.SourceValue$outboundSchema = exports.SourceValue$inboundSchema = exports.fourFromJSON = exports.fourToJSON = exports.Four$ = exports.Four$outboundSchema = exports.Four$inboundSchema = exports.Value = 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 Channels of the campaign.
 */
var Value;
(function (Value) {
    Value["Email"] = "email";
    Value["Sms"] = "sms";
    Value["WebPush"] = "web_push";
    Value["IosPush"] = "ios_push";
    Value["AndroidPush"] = "android_push";
    Value["Unknown"] = "unknown";
    Value["UnmappedValue"] = "unmapped_value";
})(Value || (exports.Value = Value = {}));
/** @internal */
exports.Four$inboundSchema = z
    .object({});
/** @internal */
exports.Four$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 Four$;
(function (Four$) {
    /** @deprecated use `Four$inboundSchema` instead. */
    Four$.inboundSchema = exports.Four$inboundSchema;
    /** @deprecated use `Four$outboundSchema` instead. */
    Four$.outboundSchema = exports.Four$outboundSchema;
})(Four$ || (exports.Four$ = Four$ = {}));
function fourToJSON(four) {
    return JSON.stringify(exports.Four$outboundSchema.parse(four));
}
exports.fourToJSON = fourToJSON;
function fourFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Four$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Four' from JSON`);
}
exports.fourFromJSON = fourFromJSON;
/** @internal */
exports.SourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Four$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.SourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Four$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 SourceValue$;
(function (SourceValue$) {
    /** @deprecated use `SourceValue$inboundSchema` instead. */
    SourceValue$.inboundSchema = exports.SourceValue$inboundSchema;
    /** @deprecated use `SourceValue$outboundSchema` instead. */
    SourceValue$.outboundSchema = exports.SourceValue$outboundSchema;
})(SourceValue$ || (exports.SourceValue$ = SourceValue$ = {}));
function sourceValueToJSON(sourceValue) {
    return JSON.stringify(exports.SourceValue$outboundSchema.parse(sourceValue));
}
exports.sourceValueToJSON = sourceValueToJSON;
function sourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SourceValue' from JSON`);
}
exports.sourceValueFromJSON = sourceValueFromJSON;
/** @internal */
exports.Value$inboundSchema = z
    .union([
    z.nativeEnum(Value),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.Value$outboundSchema = z.union([
    z.nativeEnum(Value),
    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 Value$;
(function (Value$) {
    /** @deprecated use `Value$inboundSchema` instead. */
    Value$.inboundSchema = exports.Value$inboundSchema;
    /** @deprecated use `Value$outboundSchema` instead. */
    Value$.outboundSchema = exports.Value$outboundSchema;
})(Value$ || (exports.Value$ = Value$ = {}));
/** @internal */
exports.ChannelsEnum$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Four$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.Value$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.ChannelsEnum$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Four$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.Value$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 ChannelsEnum$;
(function (ChannelsEnum$) {
    /** @deprecated use `ChannelsEnum$inboundSchema` instead. */
    ChannelsEnum$.inboundSchema = exports.ChannelsEnum$inboundSchema;
    /** @deprecated use `ChannelsEnum$outboundSchema` instead. */
    ChannelsEnum$.outboundSchema = exports.ChannelsEnum$outboundSchema;
})(ChannelsEnum$ || (exports.ChannelsEnum$ = ChannelsEnum$ = {}));
function channelsEnumToJSON(channelsEnum) {
    return JSON.stringify(exports.ChannelsEnum$outboundSchema.parse(channelsEnum));
}
exports.channelsEnumToJSON = channelsEnumToJSON;
function channelsEnumFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChannelsEnum$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChannelsEnum' from JSON`);
}
exports.channelsEnumFromJSON = channelsEnumFromJSON;
//# sourceMappingURL=channelsenum.js.map