"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.Campaign$inboundSchema = exports.CampaignStatus$inboundSchema = exports.CampaignSchemasValue$inboundSchema = exports.CampaignSchemasSourceValue$inboundSchema = exports.CampaignSchemas4$inboundSchema = exports.ScheduleType$inboundSchema = exports.CampaignValue$inboundSchema = exports.CampaignSourceValue$inboundSchema = exports.Campaign4$inboundSchema = exports.Draft$inboundSchema = exports.CampaignSchemas2$inboundSchema = exports.Archived$inboundSchema = exports.Campaign2$inboundSchema = exports.CampaignSchemasValue = exports.CampaignValue = exports.CampaignSchemas2 = exports.Campaign2 = void 0;
exports.archivedFromJSON = archivedFromJSON;
exports.draftFromJSON = draftFromJSON;
exports.campaign4FromJSON = campaign4FromJSON;
exports.campaignSourceValueFromJSON = campaignSourceValueFromJSON;
exports.scheduleTypeFromJSON = scheduleTypeFromJSON;
exports.campaignSchemas4FromJSON = campaignSchemas4FromJSON;
exports.campaignSchemasSourceValueFromJSON = campaignSchemasSourceValueFromJSON;
exports.campaignStatusFromJSON = campaignStatusFromJSON;
exports.campaignFromJSON = campaignFromJSON;
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"));
const channelsenum_js_1 = require("./channelsenum.js");
const createmessage_js_1 = require("./createmessage.js");
var Campaign2;
(function (Campaign2) {
    Campaign2["True"] = "true";
    Campaign2["False"] = "false";
})(Campaign2 || (exports.Campaign2 = Campaign2 = {}));
var CampaignSchemas2;
(function (CampaignSchemas2) {
    CampaignSchemas2["True"] = "true";
    CampaignSchemas2["False"] = "false";
})(CampaignSchemas2 || (exports.CampaignSchemas2 = CampaignSchemas2 = {}));
/**
 * The schedule type of the campaign.
 */
var CampaignValue;
(function (CampaignValue) {
    CampaignValue["Immediate"] = "immediate";
    CampaignValue["Scheduled"] = "scheduled";
    CampaignValue["Recurring"] = "recurring";
    CampaignValue["Custom"] = "custom";
    CampaignValue["Triggered"] = "triggered";
    CampaignValue["UnmappedValue"] = "unmapped_value";
})(CampaignValue || (exports.CampaignValue = CampaignValue = {}));
/**
 * The Status of the campaign.
 */
var CampaignSchemasValue;
(function (CampaignSchemasValue) {
    CampaignSchemasValue["Draft"] = "draft";
    CampaignSchemasValue["Archived"] = "archived";
    CampaignSchemasValue["Live"] = "live";
    CampaignSchemasValue["UnmappedValue"] = "unmapped_value";
})(CampaignSchemasValue || (exports.CampaignSchemasValue = CampaignSchemasValue = {}));
/** @internal */
exports.Campaign2$inboundSchema = z
    .nativeEnum(Campaign2);
/** @internal */
exports.Archived$inboundSchema = z.union([z.boolean(), exports.Campaign2$inboundSchema]);
function archivedFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Archived$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Archived' from JSON`);
}
/** @internal */
exports.CampaignSchemas2$inboundSchema = z.nativeEnum(CampaignSchemas2);
/** @internal */
exports.Draft$inboundSchema = z
    .union([z.boolean(), exports.CampaignSchemas2$inboundSchema]);
function draftFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Draft$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Draft' from JSON`);
}
/** @internal */
exports.Campaign4$inboundSchema = z.object({});
function campaign4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Campaign4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Campaign4' from JSON`);
}
/** @internal */
exports.CampaignSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Campaign4$inboundSchema),
    z.array(z.any()),
]);
function campaignSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CampaignSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CampaignSourceValue' from JSON`);
}
/** @internal */
exports.CampaignValue$inboundSchema = openEnums.inboundSchema(CampaignValue);
/** @internal */
exports.ScheduleType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Campaign4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CampaignValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function scheduleTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ScheduleType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ScheduleType' from JSON`);
}
/** @internal */
exports.CampaignSchemas4$inboundSchema = z.object({});
function campaignSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CampaignSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CampaignSchemas4' from JSON`);
}
/** @internal */
exports.CampaignSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.CampaignSchemas4$inboundSchema),
    z.array(z.any()),
]);
function campaignSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CampaignSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CampaignSchemasSourceValue' from JSON`);
}
/** @internal */
exports.CampaignSchemasValue$inboundSchema = openEnums.inboundSchema(CampaignSchemasValue);
/** @internal */
exports.CampaignStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.CampaignSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CampaignSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function campaignStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CampaignStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CampaignStatus' from JSON`);
}
/** @internal */
exports.Campaign$inboundSchema = z.object({
    archived: z.nullable(z.union([z.boolean(), exports.Campaign2$inboundSchema]))
        .optional(),
    channels: z.nullable(z.array(channelsenum_js_1.ChannelsEnum$inboundSchema)).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    draft: z.nullable(z.union([z.boolean(), exports.CampaignSchemas2$inboundSchema]))
        .optional(),
    first_sent_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    id: z.nullable(z.string()).optional(),
    last_sent_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    messages: z.nullable(z.array(createmessage_js_1.Message$inboundSchema)).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    schedule_type: z.nullable(z.lazy(() => exports.ScheduleType$inboundSchema))
        .optional(),
    status: z.nullable(z.lazy(() => exports.CampaignStatus$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "first_sent_at": "firstSentAt",
        "last_sent_at": "lastSentAt",
        "remote_id": "remoteId",
        "schedule_type": "scheduleType",
        "updated_at": "updatedAt",
    });
});
function campaignFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Campaign$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Campaign' from JSON`);
}
//# sourceMappingURL=campaign.js.map