"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.ScreeningResult$outboundSchema = exports.ScreeningResult$inboundSchema = exports.ScreeningResultStatus$outboundSchema = exports.ScreeningResultStatus$inboundSchema = exports.ScreeningResultScore$outboundSchema = exports.ScreeningResultScore$inboundSchema = exports.ScreeningResultStatus = void 0;
exports.screeningResultScoreToJSON = screeningResultScoreToJSON;
exports.screeningResultScoreFromJSON = screeningResultScoreFromJSON;
exports.screeningResultToJSON = screeningResultToJSON;
exports.screeningResultFromJSON = screeningResultFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
/**
 * Result status
 */
var ScreeningResultStatus;
(function (ScreeningResultStatus) {
    ScreeningResultStatus["Pending"] = "pending";
    ScreeningResultStatus["InProgress"] = "in_progress";
    ScreeningResultStatus["Completed"] = "completed";
    ScreeningResultStatus["Failed"] = "failed";
    ScreeningResultStatus["Cancelled"] = "cancelled";
    ScreeningResultStatus["UnmappedValue"] = "unmapped_value";
})(ScreeningResultStatus || (exports.ScreeningResultStatus = ScreeningResultStatus = {}));
/** @internal */
exports.ScreeningResultScore$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.ScreeningResultScore$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(),
});
function screeningResultScoreToJSON(screeningResultScore) {
    return JSON.stringify(exports.ScreeningResultScore$outboundSchema.parse(screeningResultScore));
}
function screeningResultScoreFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ScreeningResultScore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ScreeningResultScore' from JSON`);
}
/** @internal */
exports.ScreeningResultStatus$inboundSchema = openEnums.inboundSchema(ScreeningResultStatus);
/** @internal */
exports.ScreeningResultStatus$outboundSchema = openEnums.outboundSchema(ScreeningResultStatus);
/** @internal */
exports.ScreeningResult$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    order_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    result_url: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.ScreeningResultScore$inboundSchema))
        .optional(),
    start_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    status: z.nullable(exports.ScreeningResultStatus$inboundSchema).optional(),
    submission_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    summary: z.nullable(z.string()).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "order_id": "orderId",
        "remote_id": "remoteId",
        "result_url": "resultUrl",
        "start_date": "startDate",
        "submission_date": "submissionDate",
        "unified_custom_fields": "unifiedCustomFields",
    });
});
/** @internal */
exports.ScreeningResult$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    orderId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    resultUrl: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.ScreeningResultScore$outboundSchema))
        .optional(),
    startDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    status: z.nullable(exports.ScreeningResultStatus$outboundSchema).optional(),
    submissionDate: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    summary: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        orderId: "order_id",
        remoteId: "remote_id",
        resultUrl: "result_url",
        startDate: "start_date",
        submissionDate: "submission_date",
        unifiedCustomFields: "unified_custom_fields",
    });
});
function screeningResultToJSON(screeningResult) {
    return JSON.stringify(exports.ScreeningResult$outboundSchema.parse(screeningResult));
}
function screeningResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ScreeningResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ScreeningResult' from JSON`);
}
//# sourceMappingURL=screeningresult.js.map