"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.updateUserApiModelFromJSON = exports.updateUserApiModelToJSON = exports.UpdateUserApiModel$ = exports.UpdateUserApiModel$outboundSchema = exports.UpdateUserApiModel$inboundSchema = exports.updateUserApiModelStatusFromJSON = exports.updateUserApiModelStatusToJSON = exports.UpdateUserApiModelStatus$ = exports.UpdateUserApiModelStatus$outboundSchema = exports.UpdateUserApiModelStatus$inboundSchema = exports.UpdateUserApiModelValue$ = exports.UpdateUserApiModelValue$outboundSchema = exports.UpdateUserApiModelValue$inboundSchema = exports.updateUserApiModelSourceValueFromJSON = exports.updateUserApiModelSourceValueToJSON = exports.UpdateUserApiModelSourceValue$ = exports.UpdateUserApiModelSourceValue$outboundSchema = exports.UpdateUserApiModelSourceValue$inboundSchema = exports.updateUserApiModel4FromJSON = exports.updateUserApiModel4ToJSON = exports.UpdateUserApiModel4$ = exports.UpdateUserApiModel4$outboundSchema = exports.UpdateUserApiModel4$inboundSchema = exports.updateUserApiModelIsBotUserFromJSON = exports.updateUserApiModelIsBotUserToJSON = exports.UpdateUserApiModelIsBotUser$ = exports.UpdateUserApiModelIsBotUser$outboundSchema = exports.UpdateUserApiModelIsBotUser$inboundSchema = exports.UpdateUserApiModel2$ = exports.UpdateUserApiModel2$outboundSchema = exports.UpdateUserApiModel2$inboundSchema = exports.UpdateUserApiModelValue = exports.UpdateUserApiModel2 = 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");
var UpdateUserApiModel2;
(function (UpdateUserApiModel2) {
    UpdateUserApiModel2["True"] = "true";
    UpdateUserApiModel2["False"] = "false";
})(UpdateUserApiModel2 || (exports.UpdateUserApiModel2 = UpdateUserApiModel2 = {}));
/**
 * The status of the user, e.g. whether the user is enabled, has been disabled (eg. by an admin), or is pending (ie: awaiting approval by the user or an admin).
 */
var UpdateUserApiModelValue;
(function (UpdateUserApiModelValue) {
    UpdateUserApiModelValue["Enabled"] = "enabled";
    UpdateUserApiModelValue["Disabled"] = "disabled";
    UpdateUserApiModelValue["Pending"] = "pending";
    UpdateUserApiModelValue["UnmappedValue"] = "unmapped_value";
})(UpdateUserApiModelValue || (exports.UpdateUserApiModelValue = UpdateUserApiModelValue = {}));
/** @internal */
exports.UpdateUserApiModel2$inboundSchema = z.nativeEnum(UpdateUserApiModel2);
/** @internal */
exports.UpdateUserApiModel2$outboundSchema = exports.UpdateUserApiModel2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateUserApiModel2$;
(function (UpdateUserApiModel2$) {
    /** @deprecated use `UpdateUserApiModel2$inboundSchema` instead. */
    UpdateUserApiModel2$.inboundSchema = exports.UpdateUserApiModel2$inboundSchema;
    /** @deprecated use `UpdateUserApiModel2$outboundSchema` instead. */
    UpdateUserApiModel2$.outboundSchema = exports.UpdateUserApiModel2$outboundSchema;
})(UpdateUserApiModel2$ || (exports.UpdateUserApiModel2$ = UpdateUserApiModel2$ = {}));
/** @internal */
exports.UpdateUserApiModelIsBotUser$inboundSchema = z.union([z.boolean(), exports.UpdateUserApiModel2$inboundSchema]);
/** @internal */
exports.UpdateUserApiModelIsBotUser$outboundSchema = z.union([z.boolean(), exports.UpdateUserApiModel2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateUserApiModelIsBotUser$;
(function (UpdateUserApiModelIsBotUser$) {
    /** @deprecated use `UpdateUserApiModelIsBotUser$inboundSchema` instead. */
    UpdateUserApiModelIsBotUser$.inboundSchema = exports.UpdateUserApiModelIsBotUser$inboundSchema;
    /** @deprecated use `UpdateUserApiModelIsBotUser$outboundSchema` instead. */
    UpdateUserApiModelIsBotUser$.outboundSchema = exports.UpdateUserApiModelIsBotUser$outboundSchema;
})(UpdateUserApiModelIsBotUser$ || (exports.UpdateUserApiModelIsBotUser$ = UpdateUserApiModelIsBotUser$ = {}));
function updateUserApiModelIsBotUserToJSON(updateUserApiModelIsBotUser) {
    return JSON.stringify(exports.UpdateUserApiModelIsBotUser$outboundSchema.parse(updateUserApiModelIsBotUser));
}
exports.updateUserApiModelIsBotUserToJSON = updateUserApiModelIsBotUserToJSON;
function updateUserApiModelIsBotUserFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateUserApiModelIsBotUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUserApiModelIsBotUser' from JSON`);
}
exports.updateUserApiModelIsBotUserFromJSON = updateUserApiModelIsBotUserFromJSON;
/** @internal */
exports.UpdateUserApiModel4$inboundSchema = z.object({});
/** @internal */
exports.UpdateUserApiModel4$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 UpdateUserApiModel4$;
(function (UpdateUserApiModel4$) {
    /** @deprecated use `UpdateUserApiModel4$inboundSchema` instead. */
    UpdateUserApiModel4$.inboundSchema = exports.UpdateUserApiModel4$inboundSchema;
    /** @deprecated use `UpdateUserApiModel4$outboundSchema` instead. */
    UpdateUserApiModel4$.outboundSchema = exports.UpdateUserApiModel4$outboundSchema;
})(UpdateUserApiModel4$ || (exports.UpdateUserApiModel4$ = UpdateUserApiModel4$ = {}));
function updateUserApiModel4ToJSON(updateUserApiModel4) {
    return JSON.stringify(exports.UpdateUserApiModel4$outboundSchema.parse(updateUserApiModel4));
}
exports.updateUserApiModel4ToJSON = updateUserApiModel4ToJSON;
function updateUserApiModel4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateUserApiModel4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUserApiModel4' from JSON`);
}
exports.updateUserApiModel4FromJSON = updateUserApiModel4FromJSON;
/** @internal */
exports.UpdateUserApiModelSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.UpdateUserApiModel4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.UpdateUserApiModelSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.UpdateUserApiModel4$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 UpdateUserApiModelSourceValue$;
(function (UpdateUserApiModelSourceValue$) {
    /** @deprecated use `UpdateUserApiModelSourceValue$inboundSchema` instead. */
    UpdateUserApiModelSourceValue$.inboundSchema = exports.UpdateUserApiModelSourceValue$inboundSchema;
    /** @deprecated use `UpdateUserApiModelSourceValue$outboundSchema` instead. */
    UpdateUserApiModelSourceValue$.outboundSchema = exports.UpdateUserApiModelSourceValue$outboundSchema;
})(UpdateUserApiModelSourceValue$ || (exports.UpdateUserApiModelSourceValue$ = UpdateUserApiModelSourceValue$ = {}));
function updateUserApiModelSourceValueToJSON(updateUserApiModelSourceValue) {
    return JSON.stringify(exports.UpdateUserApiModelSourceValue$outboundSchema.parse(updateUserApiModelSourceValue));
}
exports.updateUserApiModelSourceValueToJSON = updateUserApiModelSourceValueToJSON;
function updateUserApiModelSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateUserApiModelSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUserApiModelSourceValue' from JSON`);
}
exports.updateUserApiModelSourceValueFromJSON = updateUserApiModelSourceValueFromJSON;
/** @internal */
exports.UpdateUserApiModelValue$inboundSchema = z
    .union([
    z.nativeEnum(UpdateUserApiModelValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.UpdateUserApiModelValue$outboundSchema = z.union([
    z.nativeEnum(UpdateUserApiModelValue),
    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 UpdateUserApiModelValue$;
(function (UpdateUserApiModelValue$) {
    /** @deprecated use `UpdateUserApiModelValue$inboundSchema` instead. */
    UpdateUserApiModelValue$.inboundSchema = exports.UpdateUserApiModelValue$inboundSchema;
    /** @deprecated use `UpdateUserApiModelValue$outboundSchema` instead. */
    UpdateUserApiModelValue$.outboundSchema = exports.UpdateUserApiModelValue$outboundSchema;
})(UpdateUserApiModelValue$ || (exports.UpdateUserApiModelValue$ = UpdateUserApiModelValue$ = {}));
/** @internal */
exports.UpdateUserApiModelStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.UpdateUserApiModel4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.UpdateUserApiModelValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.UpdateUserApiModelStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.UpdateUserApiModel4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.UpdateUserApiModelValue$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 UpdateUserApiModelStatus$;
(function (UpdateUserApiModelStatus$) {
    /** @deprecated use `UpdateUserApiModelStatus$inboundSchema` instead. */
    UpdateUserApiModelStatus$.inboundSchema = exports.UpdateUserApiModelStatus$inboundSchema;
    /** @deprecated use `UpdateUserApiModelStatus$outboundSchema` instead. */
    UpdateUserApiModelStatus$.outboundSchema = exports.UpdateUserApiModelStatus$outboundSchema;
})(UpdateUserApiModelStatus$ || (exports.UpdateUserApiModelStatus$ = UpdateUserApiModelStatus$ = {}));
function updateUserApiModelStatusToJSON(updateUserApiModelStatus) {
    return JSON.stringify(exports.UpdateUserApiModelStatus$outboundSchema.parse(updateUserApiModelStatus));
}
exports.updateUserApiModelStatusToJSON = updateUserApiModelStatusToJSON;
function updateUserApiModelStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateUserApiModelStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUserApiModelStatus' from JSON`);
}
exports.updateUserApiModelStatusFromJSON = updateUserApiModelStatusFromJSON;
/** @internal */
exports.UpdateUserApiModel$inboundSchema = z.object({
    first_name: z.nullable(z.string()).optional(),
    is_bot_user: z.nullable(z.union([z.boolean(), exports.UpdateUserApiModel2$inboundSchema])).optional(),
    last_name: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    primary_email_address: z.nullable(z.string()).optional(),
    status: z.nullable(z.lazy(() => exports.UpdateUserApiModelStatus$inboundSchema))
        .optional(),
    username: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "first_name": "firstName",
        "is_bot_user": "isBotUser",
        "last_name": "lastName",
        "primary_email_address": "primaryEmailAddress",
    });
});
/** @internal */
exports.UpdateUserApiModel$outboundSchema = z.object({
    firstName: z.nullable(z.string()).optional(),
    isBotUser: z.nullable(z.union([z.boolean(), exports.UpdateUserApiModel2$outboundSchema])).optional(),
    lastName: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    primaryEmailAddress: z.nullable(z.string()).optional(),
    status: z.nullable(z.lazy(() => exports.UpdateUserApiModelStatus$outboundSchema))
        .optional(),
    username: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        firstName: "first_name",
        isBotUser: "is_bot_user",
        lastName: "last_name",
        primaryEmailAddress: "primary_email_address",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UpdateUserApiModel$;
(function (UpdateUserApiModel$) {
    /** @deprecated use `UpdateUserApiModel$inboundSchema` instead. */
    UpdateUserApiModel$.inboundSchema = exports.UpdateUserApiModel$inboundSchema;
    /** @deprecated use `UpdateUserApiModel$outboundSchema` instead. */
    UpdateUserApiModel$.outboundSchema = exports.UpdateUserApiModel$outboundSchema;
})(UpdateUserApiModel$ || (exports.UpdateUserApiModel$ = UpdateUserApiModel$ = {}));
function updateUserApiModelToJSON(updateUserApiModel) {
    return JSON.stringify(exports.UpdateUserApiModel$outboundSchema.parse(updateUserApiModel));
}
exports.updateUserApiModelToJSON = updateUserApiModelToJSON;
function updateUserApiModelFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateUserApiModel$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUserApiModel' from JSON`);
}
exports.updateUserApiModelFromJSON = updateUserApiModelFromJSON;
//# sourceMappingURL=updateuserapimodel.js.map