"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.backgroundCheckResultFromJSON = exports.backgroundCheckResultToJSON = exports.BackgroundCheckResult$ = exports.BackgroundCheckResult$outboundSchema = exports.BackgroundCheckResult$inboundSchema = exports.backgroundCheckResultScoreFromJSON = exports.backgroundCheckResultScoreToJSON = exports.BackgroundCheckResultScore$ = exports.BackgroundCheckResultScore$outboundSchema = exports.BackgroundCheckResultScore$inboundSchema = exports.backgroundCheckResultResultFromJSON = exports.backgroundCheckResultResultToJSON = exports.BackgroundCheckResultResult$ = exports.BackgroundCheckResultResult$outboundSchema = exports.BackgroundCheckResultResult$inboundSchema = exports.BackgroundCheckResultValue$ = exports.BackgroundCheckResultValue$outboundSchema = exports.BackgroundCheckResultValue$inboundSchema = exports.backgroundCheckResultSourceValueFromJSON = exports.backgroundCheckResultSourceValueToJSON = exports.BackgroundCheckResultSourceValue$ = exports.BackgroundCheckResultSourceValue$outboundSchema = exports.BackgroundCheckResultSourceValue$inboundSchema = exports.backgroundCheckResult4FromJSON = exports.backgroundCheckResult4ToJSON = exports.BackgroundCheckResult4$ = exports.BackgroundCheckResult4$outboundSchema = exports.BackgroundCheckResult4$inboundSchema = exports.backgroundCheckResultCandidateFromJSON = exports.backgroundCheckResultCandidateToJSON = exports.BackgroundCheckResultCandidate$ = exports.BackgroundCheckResultCandidate$outboundSchema = exports.BackgroundCheckResultCandidate$inboundSchema = exports.BackgroundCheckResultValue = 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");
const attachment_js_1 = require("./attachment.js");
/**
 * The result of the test.
 */
var BackgroundCheckResultValue;
(function (BackgroundCheckResultValue) {
    BackgroundCheckResultValue["Cancelled"] = "cancelled";
    BackgroundCheckResultValue["Expired"] = "expired";
    BackgroundCheckResultValue["Failed"] = "failed";
    BackgroundCheckResultValue["Passed"] = "passed";
})(BackgroundCheckResultValue || (exports.BackgroundCheckResultValue = BackgroundCheckResultValue = {}));
/** @internal */
exports.BackgroundCheckResultCandidate$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    profile_url: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "profile_url": "profileUrl",
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.BackgroundCheckResultCandidate$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    profileUrl: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        profileUrl: "profile_url",
        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 BackgroundCheckResultCandidate$;
(function (BackgroundCheckResultCandidate$) {
    /** @deprecated use `BackgroundCheckResultCandidate$inboundSchema` instead. */
    BackgroundCheckResultCandidate$.inboundSchema = exports.BackgroundCheckResultCandidate$inboundSchema;
    /** @deprecated use `BackgroundCheckResultCandidate$outboundSchema` instead. */
    BackgroundCheckResultCandidate$.outboundSchema = exports.BackgroundCheckResultCandidate$outboundSchema;
})(BackgroundCheckResultCandidate$ || (exports.BackgroundCheckResultCandidate$ = BackgroundCheckResultCandidate$ = {}));
function backgroundCheckResultCandidateToJSON(backgroundCheckResultCandidate) {
    return JSON.stringify(exports.BackgroundCheckResultCandidate$outboundSchema.parse(backgroundCheckResultCandidate));
}
exports.backgroundCheckResultCandidateToJSON = backgroundCheckResultCandidateToJSON;
function backgroundCheckResultCandidateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResultCandidate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResultCandidate' from JSON`);
}
exports.backgroundCheckResultCandidateFromJSON = backgroundCheckResultCandidateFromJSON;
/** @internal */
exports.BackgroundCheckResult4$inboundSchema = z.object({});
/** @internal */
exports.BackgroundCheckResult4$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 BackgroundCheckResult4$;
(function (BackgroundCheckResult4$) {
    /** @deprecated use `BackgroundCheckResult4$inboundSchema` instead. */
    BackgroundCheckResult4$.inboundSchema = exports.BackgroundCheckResult4$inboundSchema;
    /** @deprecated use `BackgroundCheckResult4$outboundSchema` instead. */
    BackgroundCheckResult4$.outboundSchema = exports.BackgroundCheckResult4$outboundSchema;
})(BackgroundCheckResult4$ || (exports.BackgroundCheckResult4$ = BackgroundCheckResult4$ = {}));
function backgroundCheckResult4ToJSON(backgroundCheckResult4) {
    return JSON.stringify(exports.BackgroundCheckResult4$outboundSchema.parse(backgroundCheckResult4));
}
exports.backgroundCheckResult4ToJSON = backgroundCheckResult4ToJSON;
function backgroundCheckResult4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResult4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResult4' from JSON`);
}
exports.backgroundCheckResult4FromJSON = backgroundCheckResult4FromJSON;
/** @internal */
exports.BackgroundCheckResultSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.BackgroundCheckResult4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.BackgroundCheckResultSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.BackgroundCheckResult4$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 BackgroundCheckResultSourceValue$;
(function (BackgroundCheckResultSourceValue$) {
    /** @deprecated use `BackgroundCheckResultSourceValue$inboundSchema` instead. */
    BackgroundCheckResultSourceValue$.inboundSchema = exports.BackgroundCheckResultSourceValue$inboundSchema;
    /** @deprecated use `BackgroundCheckResultSourceValue$outboundSchema` instead. */
    BackgroundCheckResultSourceValue$.outboundSchema = exports.BackgroundCheckResultSourceValue$outboundSchema;
})(BackgroundCheckResultSourceValue$ || (exports.BackgroundCheckResultSourceValue$ = BackgroundCheckResultSourceValue$ = {}));
function backgroundCheckResultSourceValueToJSON(backgroundCheckResultSourceValue) {
    return JSON.stringify(exports.BackgroundCheckResultSourceValue$outboundSchema.parse(backgroundCheckResultSourceValue));
}
exports.backgroundCheckResultSourceValueToJSON = backgroundCheckResultSourceValueToJSON;
function backgroundCheckResultSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResultSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResultSourceValue' from JSON`);
}
exports.backgroundCheckResultSourceValueFromJSON = backgroundCheckResultSourceValueFromJSON;
/** @internal */
exports.BackgroundCheckResultValue$inboundSchema = z
    .union([
    z.nativeEnum(BackgroundCheckResultValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.BackgroundCheckResultValue$outboundSchema = z.union([
    z.nativeEnum(BackgroundCheckResultValue),
    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 BackgroundCheckResultValue$;
(function (BackgroundCheckResultValue$) {
    /** @deprecated use `BackgroundCheckResultValue$inboundSchema` instead. */
    BackgroundCheckResultValue$.inboundSchema = exports.BackgroundCheckResultValue$inboundSchema;
    /** @deprecated use `BackgroundCheckResultValue$outboundSchema` instead. */
    BackgroundCheckResultValue$.outboundSchema = exports.BackgroundCheckResultValue$outboundSchema;
})(BackgroundCheckResultValue$ || (exports.BackgroundCheckResultValue$ = BackgroundCheckResultValue$ = {}));
/** @internal */
exports.BackgroundCheckResultResult$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.BackgroundCheckResult4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.BackgroundCheckResultValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.BackgroundCheckResultResult$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.BackgroundCheckResult4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.BackgroundCheckResultValue$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 BackgroundCheckResultResult$;
(function (BackgroundCheckResultResult$) {
    /** @deprecated use `BackgroundCheckResultResult$inboundSchema` instead. */
    BackgroundCheckResultResult$.inboundSchema = exports.BackgroundCheckResultResult$inboundSchema;
    /** @deprecated use `BackgroundCheckResultResult$outboundSchema` instead. */
    BackgroundCheckResultResult$.outboundSchema = exports.BackgroundCheckResultResult$outboundSchema;
})(BackgroundCheckResultResult$ || (exports.BackgroundCheckResultResult$ = BackgroundCheckResultResult$ = {}));
function backgroundCheckResultResultToJSON(backgroundCheckResultResult) {
    return JSON.stringify(exports.BackgroundCheckResultResult$outboundSchema.parse(backgroundCheckResultResult));
}
exports.backgroundCheckResultResultToJSON = backgroundCheckResultResultToJSON;
function backgroundCheckResultResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResultResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResultResult' from JSON`);
}
exports.backgroundCheckResultResultFromJSON = backgroundCheckResultResultFromJSON;
/** @internal */
exports.BackgroundCheckResultScore$inboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    max: z.nullable(z.string()).optional(),
    min: z.nullable(z.string()).optional(),
    value: z.nullable(z.string()).optional(),
});
/** @internal */
exports.BackgroundCheckResultScore$outboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    max: z.nullable(z.string()).optional(),
    min: z.nullable(z.string()).optional(),
    value: z.nullable(z.string()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var BackgroundCheckResultScore$;
(function (BackgroundCheckResultScore$) {
    /** @deprecated use `BackgroundCheckResultScore$inboundSchema` instead. */
    BackgroundCheckResultScore$.inboundSchema = exports.BackgroundCheckResultScore$inboundSchema;
    /** @deprecated use `BackgroundCheckResultScore$outboundSchema` instead. */
    BackgroundCheckResultScore$.outboundSchema = exports.BackgroundCheckResultScore$outboundSchema;
})(BackgroundCheckResultScore$ || (exports.BackgroundCheckResultScore$ = BackgroundCheckResultScore$ = {}));
function backgroundCheckResultScoreToJSON(backgroundCheckResultScore) {
    return JSON.stringify(exports.BackgroundCheckResultScore$outboundSchema.parse(backgroundCheckResultScore));
}
exports.backgroundCheckResultScoreToJSON = backgroundCheckResultScoreToJSON;
function backgroundCheckResultScoreFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResultScore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResultScore' from JSON`);
}
exports.backgroundCheckResultScoreFromJSON = backgroundCheckResultScoreFromJSON;
/** @internal */
exports.BackgroundCheckResult$inboundSchema = z.object({
    attachments: z.nullable(z.array(attachment_js_1.Attachment$inboundSchema)).optional(),
    candidate: z.nullable(z.lazy(() => exports.BackgroundCheckResultCandidate$inboundSchema)).optional(),
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.BackgroundCheckResultResult$inboundSchema))
        .optional(),
    result_url: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.BackgroundCheckResultScore$inboundSchema))
        .optional(),
    start_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    submission_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    summary: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
        "result_url": "resultUrl",
        "start_date": "startDate",
        "submission_date": "submissionDate",
    });
});
/** @internal */
exports.BackgroundCheckResult$outboundSchema = z.object({
    attachments: z.nullable(z.array(attachment_js_1.Attachment$outboundSchema)).optional(),
    candidate: z.nullable(z.lazy(() => exports.BackgroundCheckResultCandidate$outboundSchema)).optional(),
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.BackgroundCheckResultResult$outboundSchema))
        .optional(),
    resultUrl: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.BackgroundCheckResultScore$outboundSchema))
        .optional(),
    startDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    submissionDate: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    summary: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        remoteId: "remote_id",
        resultUrl: "result_url",
        startDate: "start_date",
        submissionDate: "submission_date",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var BackgroundCheckResult$;
(function (BackgroundCheckResult$) {
    /** @deprecated use `BackgroundCheckResult$inboundSchema` instead. */
    BackgroundCheckResult$.inboundSchema = exports.BackgroundCheckResult$inboundSchema;
    /** @deprecated use `BackgroundCheckResult$outboundSchema` instead. */
    BackgroundCheckResult$.outboundSchema = exports.BackgroundCheckResult$outboundSchema;
})(BackgroundCheckResult$ || (exports.BackgroundCheckResult$ = BackgroundCheckResult$ = {}));
function backgroundCheckResultToJSON(backgroundCheckResult) {
    return JSON.stringify(exports.BackgroundCheckResult$outboundSchema.parse(backgroundCheckResult));
}
exports.backgroundCheckResultToJSON = backgroundCheckResultToJSON;
function backgroundCheckResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BackgroundCheckResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BackgroundCheckResult' from JSON`);
}
exports.backgroundCheckResultFromJSON = backgroundCheckResultFromJSON;
//# sourceMappingURL=backgroundcheckresult.js.map