"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.assessmentResultFromJSON = exports.assessmentResultToJSON = exports.AssessmentResult$ = exports.AssessmentResult$outboundSchema = exports.AssessmentResult$inboundSchema = exports.scoreFromJSON = exports.scoreToJSON = exports.Score$ = exports.Score$outboundSchema = exports.Score$inboundSchema = exports.resultFromJSON = exports.resultToJSON = exports.Result$ = exports.Result$outboundSchema = exports.Result$inboundSchema = exports.AssessmentResultValue$ = exports.AssessmentResultValue$outboundSchema = exports.AssessmentResultValue$inboundSchema = exports.assessmentResultSourceValueFromJSON = exports.assessmentResultSourceValueToJSON = exports.AssessmentResultSourceValue$ = exports.AssessmentResultSourceValue$outboundSchema = exports.AssessmentResultSourceValue$inboundSchema = exports.assessmentResult4FromJSON = exports.assessmentResult4ToJSON = exports.AssessmentResult4$ = exports.AssessmentResult4$outboundSchema = exports.AssessmentResult4$inboundSchema = exports.assessmentResultCandidateFromJSON = exports.assessmentResultCandidateToJSON = exports.AssessmentResultCandidate$ = exports.AssessmentResultCandidate$outboundSchema = exports.AssessmentResultCandidate$inboundSchema = exports.AssessmentResultValue = 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 AssessmentResultValue;
(function (AssessmentResultValue) {
    AssessmentResultValue["Cancelled"] = "cancelled";
    AssessmentResultValue["Completed"] = "completed";
    AssessmentResultValue["Expired"] = "expired";
    AssessmentResultValue["Failed"] = "failed";
    AssessmentResultValue["Passed"] = "passed";
    AssessmentResultValue["UnmappedValue"] = "unmapped_value";
})(AssessmentResultValue || (exports.AssessmentResultValue = AssessmentResultValue = {}));
/** @internal */
exports.AssessmentResultCandidate$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.AssessmentResultCandidate$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 AssessmentResultCandidate$;
(function (AssessmentResultCandidate$) {
    /** @deprecated use `AssessmentResultCandidate$inboundSchema` instead. */
    AssessmentResultCandidate$.inboundSchema = exports.AssessmentResultCandidate$inboundSchema;
    /** @deprecated use `AssessmentResultCandidate$outboundSchema` instead. */
    AssessmentResultCandidate$.outboundSchema = exports.AssessmentResultCandidate$outboundSchema;
})(AssessmentResultCandidate$ || (exports.AssessmentResultCandidate$ = AssessmentResultCandidate$ = {}));
function assessmentResultCandidateToJSON(assessmentResultCandidate) {
    return JSON.stringify(exports.AssessmentResultCandidate$outboundSchema.parse(assessmentResultCandidate));
}
exports.assessmentResultCandidateToJSON = assessmentResultCandidateToJSON;
function assessmentResultCandidateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AssessmentResultCandidate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssessmentResultCandidate' from JSON`);
}
exports.assessmentResultCandidateFromJSON = assessmentResultCandidateFromJSON;
/** @internal */
exports.AssessmentResult4$inboundSchema = z.object({});
/** @internal */
exports.AssessmentResult4$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 AssessmentResult4$;
(function (AssessmentResult4$) {
    /** @deprecated use `AssessmentResult4$inboundSchema` instead. */
    AssessmentResult4$.inboundSchema = exports.AssessmentResult4$inboundSchema;
    /** @deprecated use `AssessmentResult4$outboundSchema` instead. */
    AssessmentResult4$.outboundSchema = exports.AssessmentResult4$outboundSchema;
})(AssessmentResult4$ || (exports.AssessmentResult4$ = AssessmentResult4$ = {}));
function assessmentResult4ToJSON(assessmentResult4) {
    return JSON.stringify(exports.AssessmentResult4$outboundSchema.parse(assessmentResult4));
}
exports.assessmentResult4ToJSON = assessmentResult4ToJSON;
function assessmentResult4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AssessmentResult4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssessmentResult4' from JSON`);
}
exports.assessmentResult4FromJSON = assessmentResult4FromJSON;
/** @internal */
exports.AssessmentResultSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.AssessmentResult4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.AssessmentResultSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.AssessmentResult4$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 AssessmentResultSourceValue$;
(function (AssessmentResultSourceValue$) {
    /** @deprecated use `AssessmentResultSourceValue$inboundSchema` instead. */
    AssessmentResultSourceValue$.inboundSchema = exports.AssessmentResultSourceValue$inboundSchema;
    /** @deprecated use `AssessmentResultSourceValue$outboundSchema` instead. */
    AssessmentResultSourceValue$.outboundSchema = exports.AssessmentResultSourceValue$outboundSchema;
})(AssessmentResultSourceValue$ || (exports.AssessmentResultSourceValue$ = AssessmentResultSourceValue$ = {}));
function assessmentResultSourceValueToJSON(assessmentResultSourceValue) {
    return JSON.stringify(exports.AssessmentResultSourceValue$outboundSchema.parse(assessmentResultSourceValue));
}
exports.assessmentResultSourceValueToJSON = assessmentResultSourceValueToJSON;
function assessmentResultSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AssessmentResultSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssessmentResultSourceValue' from JSON`);
}
exports.assessmentResultSourceValueFromJSON = assessmentResultSourceValueFromJSON;
/** @internal */
exports.AssessmentResultValue$inboundSchema = z
    .union([
    z.nativeEnum(AssessmentResultValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.AssessmentResultValue$outboundSchema = z.union([
    z.nativeEnum(AssessmentResultValue),
    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 AssessmentResultValue$;
(function (AssessmentResultValue$) {
    /** @deprecated use `AssessmentResultValue$inboundSchema` instead. */
    AssessmentResultValue$.inboundSchema = exports.AssessmentResultValue$inboundSchema;
    /** @deprecated use `AssessmentResultValue$outboundSchema` instead. */
    AssessmentResultValue$.outboundSchema = exports.AssessmentResultValue$outboundSchema;
})(AssessmentResultValue$ || (exports.AssessmentResultValue$ = AssessmentResultValue$ = {}));
/** @internal */
exports.Result$inboundSchema = z
    .object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.AssessmentResult4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AssessmentResultValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.Result$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.AssessmentResult4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AssessmentResultValue$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 Result$;
(function (Result$) {
    /** @deprecated use `Result$inboundSchema` instead. */
    Result$.inboundSchema = exports.Result$inboundSchema;
    /** @deprecated use `Result$outboundSchema` instead. */
    Result$.outboundSchema = exports.Result$outboundSchema;
})(Result$ || (exports.Result$ = Result$ = {}));
function resultToJSON(result) {
    return JSON.stringify(exports.Result$outboundSchema.parse(result));
}
exports.resultToJSON = resultToJSON;
function resultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Result$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Result' from JSON`);
}
exports.resultFromJSON = resultFromJSON;
/** @internal */
exports.Score$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.Score$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 Score$;
(function (Score$) {
    /** @deprecated use `Score$inboundSchema` instead. */
    Score$.inboundSchema = exports.Score$inboundSchema;
    /** @deprecated use `Score$outboundSchema` instead. */
    Score$.outboundSchema = exports.Score$outboundSchema;
})(Score$ || (exports.Score$ = Score$ = {}));
function scoreToJSON(score) {
    return JSON.stringify(exports.Score$outboundSchema.parse(score));
}
exports.scoreToJSON = scoreToJSON;
function scoreFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Score$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Score' from JSON`);
}
exports.scoreFromJSON = scoreFromJSON;
/** @internal */
exports.AssessmentResult$inboundSchema = z.object({
    attachments: z.nullable(z.array(attachment_js_1.Attachment$inboundSchema)).optional(),
    candidate: z.nullable(z.lazy(() => exports.AssessmentResultCandidate$inboundSchema))
        .optional(),
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.Result$inboundSchema)).optional(),
    result_url: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.Score$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.AssessmentResult$outboundSchema = z.object({
    attachments: z.nullable(z.array(attachment_js_1.Attachment$outboundSchema)).optional(),
    candidate: z.nullable(z.lazy(() => exports.AssessmentResultCandidate$outboundSchema))
        .optional(),
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    result: z.nullable(z.lazy(() => exports.Result$outboundSchema)).optional(),
    resultUrl: z.nullable(z.string()).optional(),
    score: z.nullable(z.lazy(() => exports.Score$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 AssessmentResult$;
(function (AssessmentResult$) {
    /** @deprecated use `AssessmentResult$inboundSchema` instead. */
    AssessmentResult$.inboundSchema = exports.AssessmentResult$inboundSchema;
    /** @deprecated use `AssessmentResult$outboundSchema` instead. */
    AssessmentResult$.outboundSchema = exports.AssessmentResult$outboundSchema;
})(AssessmentResult$ || (exports.AssessmentResult$ = AssessmentResult$ = {}));
function assessmentResultToJSON(assessmentResult) {
    return JSON.stringify(exports.AssessmentResult$outboundSchema.parse(assessmentResult));
}
exports.assessmentResultToJSON = assessmentResultToJSON;
function assessmentResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AssessmentResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssessmentResult' from JSON`);
}
exports.assessmentResultFromJSON = assessmentResultFromJSON;
//# sourceMappingURL=assessmentresult.js.map