"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.MessagingUser$ = exports.MessagingUser$outboundSchema = exports.MessagingUser$inboundSchema = exports.Bot$ = exports.Bot$outboundSchema = exports.Bot$inboundSchema = exports.MessagingUserSchemas2$ = exports.MessagingUserSchemas2$outboundSchema = exports.MessagingUserSchemas2$inboundSchema = exports.MessagingUserActive$ = exports.MessagingUserActive$outboundSchema = exports.MessagingUserActive$inboundSchema = exports.MessagingUser2$ = exports.MessagingUser2$outboundSchema = exports.MessagingUser2$inboundSchema = exports.MessagingUserSchemas2 = exports.MessagingUser2 = void 0;
exports.messagingUserActiveToJSON = messagingUserActiveToJSON;
exports.messagingUserActiveFromJSON = messagingUserActiveFromJSON;
exports.botToJSON = botToJSON;
exports.botFromJSON = botFromJSON;
exports.messagingUserToJSON = messagingUserToJSON;
exports.messagingUserFromJSON = messagingUserFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
var MessagingUser2;
(function (MessagingUser2) {
    MessagingUser2["True"] = "true";
    MessagingUser2["False"] = "false";
})(MessagingUser2 || (exports.MessagingUser2 = MessagingUser2 = {}));
var MessagingUserSchemas2;
(function (MessagingUserSchemas2) {
    MessagingUserSchemas2["True"] = "true";
    MessagingUserSchemas2["False"] = "false";
})(MessagingUserSchemas2 || (exports.MessagingUserSchemas2 = MessagingUserSchemas2 = {}));
/** @internal */
exports.MessagingUser2$inboundSchema = z.nativeEnum(MessagingUser2);
/** @internal */
exports.MessagingUser2$outboundSchema = exports.MessagingUser2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MessagingUser2$;
(function (MessagingUser2$) {
    /** @deprecated use `MessagingUser2$inboundSchema` instead. */
    MessagingUser2$.inboundSchema = exports.MessagingUser2$inboundSchema;
    /** @deprecated use `MessagingUser2$outboundSchema` instead. */
    MessagingUser2$.outboundSchema = exports.MessagingUser2$outboundSchema;
})(MessagingUser2$ || (exports.MessagingUser2$ = MessagingUser2$ = {}));
/** @internal */
exports.MessagingUserActive$inboundSchema = z.union([z.boolean(), exports.MessagingUser2$inboundSchema]);
/** @internal */
exports.MessagingUserActive$outboundSchema = z.union([z.boolean(), exports.MessagingUser2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MessagingUserActive$;
(function (MessagingUserActive$) {
    /** @deprecated use `MessagingUserActive$inboundSchema` instead. */
    MessagingUserActive$.inboundSchema = exports.MessagingUserActive$inboundSchema;
    /** @deprecated use `MessagingUserActive$outboundSchema` instead. */
    MessagingUserActive$.outboundSchema = exports.MessagingUserActive$outboundSchema;
})(MessagingUserActive$ || (exports.MessagingUserActive$ = MessagingUserActive$ = {}));
function messagingUserActiveToJSON(messagingUserActive) {
    return JSON.stringify(exports.MessagingUserActive$outboundSchema.parse(messagingUserActive));
}
function messagingUserActiveFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUserActive$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUserActive' from JSON`);
}
/** @internal */
exports.MessagingUserSchemas2$inboundSchema = z.nativeEnum(MessagingUserSchemas2);
/** @internal */
exports.MessagingUserSchemas2$outboundSchema = exports.MessagingUserSchemas2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var MessagingUserSchemas2$;
(function (MessagingUserSchemas2$) {
    /** @deprecated use `MessagingUserSchemas2$inboundSchema` instead. */
    MessagingUserSchemas2$.inboundSchema = exports.MessagingUserSchemas2$inboundSchema;
    /** @deprecated use `MessagingUserSchemas2$outboundSchema` instead. */
    MessagingUserSchemas2$.outboundSchema = exports.MessagingUserSchemas2$outboundSchema;
})(MessagingUserSchemas2$ || (exports.MessagingUserSchemas2$ = MessagingUserSchemas2$ = {}));
/** @internal */
exports.Bot$inboundSchema = z.union([z.boolean(), exports.MessagingUserSchemas2$inboundSchema]);
/** @internal */
exports.Bot$outboundSchema = z
    .union([z.boolean(), exports.MessagingUserSchemas2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Bot$;
(function (Bot$) {
    /** @deprecated use `Bot$inboundSchema` instead. */
    Bot$.inboundSchema = exports.Bot$inboundSchema;
    /** @deprecated use `Bot$outboundSchema` instead. */
    Bot$.outboundSchema = exports.Bot$outboundSchema;
})(Bot$ || (exports.Bot$ = Bot$ = {}));
function botToJSON(bot) {
    return JSON.stringify(exports.Bot$outboundSchema.parse(bot));
}
function botFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Bot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bot' from JSON`);
}
/** @internal */
exports.MessagingUser$inboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.MessagingUser2$inboundSchema]))
        .optional(),
    bot: z.nullable(z.union([z.boolean(), exports.MessagingUserSchemas2$inboundSchema]))
        .optional(),
    email: z.nullable(z.string()).optional(),
    first_name: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    last_name: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    username: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "first_name": "firstName",
        "last_name": "lastName",
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.MessagingUser$outboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.MessagingUser2$outboundSchema]))
        .optional(),
    bot: z.nullable(z.union([z.boolean(), exports.MessagingUserSchemas2$outboundSchema]))
        .optional(),
    email: z.nullable(z.string()).optional(),
    firstName: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    username: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        firstName: "first_name",
        lastName: "last_name",
        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 MessagingUser$;
(function (MessagingUser$) {
    /** @deprecated use `MessagingUser$inboundSchema` instead. */
    MessagingUser$.inboundSchema = exports.MessagingUser$inboundSchema;
    /** @deprecated use `MessagingUser$outboundSchema` instead. */
    MessagingUser$.outboundSchema = exports.MessagingUser$outboundSchema;
})(MessagingUser$ || (exports.MessagingUser$ = MessagingUser$ = {}));
function messagingUserToJSON(messagingUser) {
    return JSON.stringify(exports.MessagingUser$outboundSchema.parse(messagingUser));
}
function messagingUserFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUser' from JSON`);
}
//# sourceMappingURL=messaginguser.js.map