"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.MessagingUserResult$inboundSchema = exports.MessagingUserResultData$inboundSchema = exports.MessagingUserResultBot$inboundSchema = exports.MessagingUserResultSchemas2$inboundSchema = exports.MessagingUserResultActive$inboundSchema = exports.MessagingUserResult2$inboundSchema = exports.MessagingUserResultSchemas2 = exports.MessagingUserResult2 = void 0;
exports.messagingUserResultActiveFromJSON = messagingUserResultActiveFromJSON;
exports.messagingUserResultBotFromJSON = messagingUserResultBotFromJSON;
exports.messagingUserResultDataFromJSON = messagingUserResultDataFromJSON;
exports.messagingUserResultFromJSON = messagingUserResultFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const rawresponse_js_1 = require("./rawresponse.js");
var MessagingUserResult2;
(function (MessagingUserResult2) {
    MessagingUserResult2["True"] = "true";
    MessagingUserResult2["False"] = "false";
})(MessagingUserResult2 || (exports.MessagingUserResult2 = MessagingUserResult2 = {}));
var MessagingUserResultSchemas2;
(function (MessagingUserResultSchemas2) {
    MessagingUserResultSchemas2["True"] = "true";
    MessagingUserResultSchemas2["False"] = "false";
})(MessagingUserResultSchemas2 || (exports.MessagingUserResultSchemas2 = MessagingUserResultSchemas2 = {}));
/** @internal */
exports.MessagingUserResult2$inboundSchema = z.nativeEnum(MessagingUserResult2);
/** @internal */
exports.MessagingUserResultActive$inboundSchema = z.union([z.boolean(), exports.MessagingUserResult2$inboundSchema]);
function messagingUserResultActiveFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUserResultActive$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUserResultActive' from JSON`);
}
/** @internal */
exports.MessagingUserResultSchemas2$inboundSchema = z.nativeEnum(MessagingUserResultSchemas2);
/** @internal */
exports.MessagingUserResultBot$inboundSchema = z.union([z.boolean(), exports.MessagingUserResultSchemas2$inboundSchema]);
function messagingUserResultBotFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUserResultBot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUserResultBot' from JSON`);
}
/** @internal */
exports.MessagingUserResultData$inboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.MessagingUserResult2$inboundSchema]))
        .optional(),
    bot: z.nullable(z.union([z.boolean(), exports.MessagingUserResultSchemas2$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",
    });
});
function messagingUserResultDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUserResultData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUserResultData' from JSON`);
}
/** @internal */
exports.MessagingUserResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.MessagingUserResultData$inboundSchema))
        .optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
function messagingUserResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MessagingUserResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessagingUserResult' from JSON`);
}
//# sourceMappingURL=messaginguserresult.js.map