"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.rejectedReasonFromJSON = exports.rejectedReasonToJSON = exports.RejectedReason$ = exports.RejectedReason$outboundSchema = exports.RejectedReason$inboundSchema = exports.rejectedReasonTypeFromJSON = exports.rejectedReasonTypeToJSON = exports.RejectedReasonType$ = exports.RejectedReasonType$outboundSchema = exports.RejectedReasonType$inboundSchema = exports.RejectedReasonValue$ = exports.RejectedReasonValue$outboundSchema = exports.RejectedReasonValue$inboundSchema = exports.rejectedReasonSourceValueFromJSON = exports.rejectedReasonSourceValueToJSON = exports.RejectedReasonSourceValue$ = exports.RejectedReasonSourceValue$outboundSchema = exports.RejectedReasonSourceValue$inboundSchema = exports.rejectedReason4FromJSON = exports.rejectedReason4ToJSON = exports.RejectedReason4$ = exports.RejectedReason4$outboundSchema = exports.RejectedReason4$inboundSchema = exports.RejectedReasonValue = 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 type of the rejected reason.
 */
var RejectedReasonValue;
(function (RejectedReasonValue) {
    RejectedReasonValue["RejectedByCandidate"] = "rejected_by_candidate";
    RejectedReasonValue["RejectedByOrganization"] = "rejected_by_organization";
    RejectedReasonValue["Other"] = "other";
    RejectedReasonValue["Unknown"] = "unknown";
    RejectedReasonValue["UnmappedValue"] = "unmapped_value";
})(RejectedReasonValue || (exports.RejectedReasonValue = RejectedReasonValue = {}));
/** @internal */
exports.RejectedReason4$inboundSchema = z.object({});
/** @internal */
exports.RejectedReason4$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 RejectedReason4$;
(function (RejectedReason4$) {
    /** @deprecated use `RejectedReason4$inboundSchema` instead. */
    RejectedReason4$.inboundSchema = exports.RejectedReason4$inboundSchema;
    /** @deprecated use `RejectedReason4$outboundSchema` instead. */
    RejectedReason4$.outboundSchema = exports.RejectedReason4$outboundSchema;
})(RejectedReason4$ || (exports.RejectedReason4$ = RejectedReason4$ = {}));
function rejectedReason4ToJSON(rejectedReason4) {
    return JSON.stringify(exports.RejectedReason4$outboundSchema.parse(rejectedReason4));
}
exports.rejectedReason4ToJSON = rejectedReason4ToJSON;
function rejectedReason4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RejectedReason4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectedReason4' from JSON`);
}
exports.rejectedReason4FromJSON = rejectedReason4FromJSON;
/** @internal */
exports.RejectedReasonSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.RejectedReason4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.RejectedReasonSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.RejectedReason4$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 RejectedReasonSourceValue$;
(function (RejectedReasonSourceValue$) {
    /** @deprecated use `RejectedReasonSourceValue$inboundSchema` instead. */
    RejectedReasonSourceValue$.inboundSchema = exports.RejectedReasonSourceValue$inboundSchema;
    /** @deprecated use `RejectedReasonSourceValue$outboundSchema` instead. */
    RejectedReasonSourceValue$.outboundSchema = exports.RejectedReasonSourceValue$outboundSchema;
})(RejectedReasonSourceValue$ || (exports.RejectedReasonSourceValue$ = RejectedReasonSourceValue$ = {}));
function rejectedReasonSourceValueToJSON(rejectedReasonSourceValue) {
    return JSON.stringify(exports.RejectedReasonSourceValue$outboundSchema.parse(rejectedReasonSourceValue));
}
exports.rejectedReasonSourceValueToJSON = rejectedReasonSourceValueToJSON;
function rejectedReasonSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RejectedReasonSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectedReasonSourceValue' from JSON`);
}
exports.rejectedReasonSourceValueFromJSON = rejectedReasonSourceValueFromJSON;
/** @internal */
exports.RejectedReasonValue$inboundSchema = z
    .union([
    z.nativeEnum(RejectedReasonValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.RejectedReasonValue$outboundSchema = z.union([
    z.nativeEnum(RejectedReasonValue),
    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 RejectedReasonValue$;
(function (RejectedReasonValue$) {
    /** @deprecated use `RejectedReasonValue$inboundSchema` instead. */
    RejectedReasonValue$.inboundSchema = exports.RejectedReasonValue$inboundSchema;
    /** @deprecated use `RejectedReasonValue$outboundSchema` instead. */
    RejectedReasonValue$.outboundSchema = exports.RejectedReasonValue$outboundSchema;
})(RejectedReasonValue$ || (exports.RejectedReasonValue$ = RejectedReasonValue$ = {}));
/** @internal */
exports.RejectedReasonType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.RejectedReason4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.RejectedReasonValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.RejectedReasonType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.RejectedReason4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.RejectedReasonValue$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 RejectedReasonType$;
(function (RejectedReasonType$) {
    /** @deprecated use `RejectedReasonType$inboundSchema` instead. */
    RejectedReasonType$.inboundSchema = exports.RejectedReasonType$inboundSchema;
    /** @deprecated use `RejectedReasonType$outboundSchema` instead. */
    RejectedReasonType$.outboundSchema = exports.RejectedReasonType$outboundSchema;
})(RejectedReasonType$ || (exports.RejectedReasonType$ = RejectedReasonType$ = {}));
function rejectedReasonTypeToJSON(rejectedReasonType) {
    return JSON.stringify(exports.RejectedReasonType$outboundSchema.parse(rejectedReasonType));
}
exports.rejectedReasonTypeToJSON = rejectedReasonTypeToJSON;
function rejectedReasonTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RejectedReasonType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectedReasonType' from JSON`);
}
exports.rejectedReasonTypeFromJSON = rejectedReasonTypeFromJSON;
/** @internal */
exports.RejectedReason$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    label: z.nullable(z.string()).optional(),
    rejected_reason_type: z.nullable(z.lazy(() => exports.RejectedReasonType$inboundSchema)).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.string()).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "rejected_reason_type": "rejectedReasonType",
        "remote_id": "remoteId",
        "unified_custom_fields": "unifiedCustomFields",
    });
});
/** @internal */
exports.RejectedReason$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    label: z.nullable(z.string()).optional(),
    rejectedReasonType: z.nullable(z.lazy(() => exports.RejectedReasonType$outboundSchema)).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        rejectedReasonType: "rejected_reason_type",
        remoteId: "remote_id",
        unifiedCustomFields: "unified_custom_fields",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var RejectedReason$;
(function (RejectedReason$) {
    /** @deprecated use `RejectedReason$inboundSchema` instead. */
    RejectedReason$.inboundSchema = exports.RejectedReason$inboundSchema;
    /** @deprecated use `RejectedReason$outboundSchema` instead. */
    RejectedReason$.outboundSchema = exports.RejectedReason$outboundSchema;
})(RejectedReason$ || (exports.RejectedReason$ = RejectedReason$ = {}));
function rejectedReasonToJSON(rejectedReason) {
    return JSON.stringify(exports.RejectedReason$outboundSchema.parse(rejectedReason));
}
exports.rejectedReasonToJSON = rejectedReasonToJSON;
function rejectedReasonFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RejectedReason$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectedReason' from JSON`);
}
exports.rejectedReasonFromJSON = rejectedReasonFromJSON;
//# sourceMappingURL=rejectedreason.js.map