"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.jobFromJSON = exports.jobToJSON = exports.Job$ = exports.Job$outboundSchema = exports.Job$inboundSchema = exports.jobJobStatusFromJSON = exports.jobJobStatusToJSON = exports.JobJobStatus$ = exports.JobJobStatus$outboundSchema = exports.JobJobStatus$inboundSchema = exports.JobValue$ = exports.JobValue$outboundSchema = exports.JobValue$inboundSchema = exports.jobSourceValueFromJSON = exports.jobSourceValueToJSON = exports.JobSourceValue$ = exports.JobSourceValue$outboundSchema = exports.JobSourceValue$inboundSchema = exports.job4FromJSON = exports.job4ToJSON = exports.Job4$ = exports.Job4$outboundSchema = exports.Job4$inboundSchema = exports.JobConfidential$ = exports.JobConfidential$outboundSchema = exports.JobConfidential$inboundSchema = exports.JobValue = exports.JobConfidential = 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 customfields_js_1 = require("./customfields.js");
const interviewstage_js_1 = require("./interviewstage.js");
const jobhiringteam_js_1 = require("./jobhiringteam.js");
/**
 * Confidential status of the job
 */
var JobConfidential;
(function (JobConfidential) {
    JobConfidential["True"] = "true";
    JobConfidential["False"] = "false";
    JobConfidential["UnmappedValue"] = "unmapped_value";
})(JobConfidential || (exports.JobConfidential = JobConfidential = {}));
/**
 * The status of the job.
 */
var JobValue;
(function (JobValue) {
    JobValue["Published"] = "published";
    JobValue["Draft"] = "draft";
    JobValue["Pending"] = "pending";
    JobValue["Internal"] = "internal";
    JobValue["Archived"] = "archived";
    JobValue["Closed"] = "closed";
    JobValue["Open"] = "open";
    JobValue["Deleted"] = "deleted";
    JobValue["OnHold"] = "on_hold";
    JobValue["UnmappedValue"] = "unmapped_value";
})(JobValue || (exports.JobValue = JobValue = {}));
/** @internal */
exports.JobConfidential$inboundSchema = z
    .union([
    z.nativeEnum(JobConfidential),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.JobConfidential$outboundSchema = z.union([
    z.nativeEnum(JobConfidential),
    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 JobConfidential$;
(function (JobConfidential$) {
    /** @deprecated use `JobConfidential$inboundSchema` instead. */
    JobConfidential$.inboundSchema = exports.JobConfidential$inboundSchema;
    /** @deprecated use `JobConfidential$outboundSchema` instead. */
    JobConfidential$.outboundSchema = exports.JobConfidential$outboundSchema;
})(JobConfidential$ || (exports.JobConfidential$ = JobConfidential$ = {}));
/** @internal */
exports.Job4$inboundSchema = z
    .object({});
/** @internal */
exports.Job4$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 Job4$;
(function (Job4$) {
    /** @deprecated use `Job4$inboundSchema` instead. */
    Job4$.inboundSchema = exports.Job4$inboundSchema;
    /** @deprecated use `Job4$outboundSchema` instead. */
    Job4$.outboundSchema = exports.Job4$outboundSchema;
})(Job4$ || (exports.Job4$ = Job4$ = {}));
function job4ToJSON(job4) {
    return JSON.stringify(exports.Job4$outboundSchema.parse(job4));
}
exports.job4ToJSON = job4ToJSON;
function job4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Job4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Job4' from JSON`);
}
exports.job4FromJSON = job4FromJSON;
/** @internal */
exports.JobSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Job4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.JobSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Job4$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 JobSourceValue$;
(function (JobSourceValue$) {
    /** @deprecated use `JobSourceValue$inboundSchema` instead. */
    JobSourceValue$.inboundSchema = exports.JobSourceValue$inboundSchema;
    /** @deprecated use `JobSourceValue$outboundSchema` instead. */
    JobSourceValue$.outboundSchema = exports.JobSourceValue$outboundSchema;
})(JobSourceValue$ || (exports.JobSourceValue$ = JobSourceValue$ = {}));
function jobSourceValueToJSON(jobSourceValue) {
    return JSON.stringify(exports.JobSourceValue$outboundSchema.parse(jobSourceValue));
}
exports.jobSourceValueToJSON = jobSourceValueToJSON;
function jobSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JobSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JobSourceValue' from JSON`);
}
exports.jobSourceValueFromJSON = jobSourceValueFromJSON;
/** @internal */
exports.JobValue$inboundSchema = z
    .union([
    z.nativeEnum(JobValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.JobValue$outboundSchema = z.union([
    z.nativeEnum(JobValue),
    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 JobValue$;
(function (JobValue$) {
    /** @deprecated use `JobValue$inboundSchema` instead. */
    JobValue$.inboundSchema = exports.JobValue$inboundSchema;
    /** @deprecated use `JobValue$outboundSchema` instead. */
    JobValue$.outboundSchema = exports.JobValue$outboundSchema;
})(JobValue$ || (exports.JobValue$ = JobValue$ = {}));
/** @internal */
exports.JobJobStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Job4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.JobValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.JobJobStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Job4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.JobValue$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 JobJobStatus$;
(function (JobJobStatus$) {
    /** @deprecated use `JobJobStatus$inboundSchema` instead. */
    JobJobStatus$.inboundSchema = exports.JobJobStatus$inboundSchema;
    /** @deprecated use `JobJobStatus$outboundSchema` instead. */
    JobJobStatus$.outboundSchema = exports.JobJobStatus$outboundSchema;
})(JobJobStatus$ || (exports.JobJobStatus$ = JobJobStatus$ = {}));
function jobJobStatusToJSON(jobJobStatus) {
    return JSON.stringify(exports.JobJobStatus$outboundSchema.parse(jobJobStatus));
}
exports.jobJobStatusToJSON = jobJobStatusToJSON;
function jobJobStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JobJobStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JobJobStatus' from JSON`);
}
exports.jobJobStatusFromJSON = jobJobStatusFromJSON;
/** @internal */
exports.Job$inboundSchema = z
    .object({
    code: z.nullable(z.string()).optional(),
    confidential: z.nullable(exports.JobConfidential$inboundSchema).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    custom_fields: z.nullable(z.array(customfields_js_1.CustomFields$inboundSchema)).optional(),
    department_ids: z.nullable(z.array(z.string())).optional(),
    description: z.nullable(z.string()).optional(),
    hiring_team: z.nullable(z.array(jobhiringteam_js_1.JobHiringTeam$inboundSchema)).optional(),
    id: z.nullable(z.string()).optional(),
    interview_stages: z.nullable(z.array(interviewstage_js_1.InterviewStage$inboundSchema))
        .optional(),
    job_status: z.nullable(z.lazy(() => exports.JobJobStatus$inboundSchema)).optional(),
    location_ids: z.nullable(z.array(z.string())).optional(),
    remote_department_ids: z.nullable(z.array(z.string())).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_location_ids: z.nullable(z.array(z.string())).optional(),
    status: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "custom_fields": "customFields",
        "department_ids": "departmentIds",
        "hiring_team": "hiringTeam",
        "interview_stages": "interviewStages",
        "job_status": "jobStatus",
        "location_ids": "locationIds",
        "remote_department_ids": "remoteDepartmentIds",
        "remote_id": "remoteId",
        "remote_location_ids": "remoteLocationIds",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.Job$outboundSchema = z
    .object({
    code: z.nullable(z.string()).optional(),
    confidential: z.nullable(exports.JobConfidential$outboundSchema).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    customFields: z.nullable(z.array(customfields_js_1.CustomFields$outboundSchema)).optional(),
    departmentIds: z.nullable(z.array(z.string())).optional(),
    description: z.nullable(z.string()).optional(),
    hiringTeam: z.nullable(z.array(jobhiringteam_js_1.JobHiringTeam$outboundSchema)).optional(),
    id: z.nullable(z.string()).optional(),
    interviewStages: z.nullable(z.array(interviewstage_js_1.InterviewStage$outboundSchema))
        .optional(),
    jobStatus: z.nullable(z.lazy(() => exports.JobJobStatus$outboundSchema)).optional(),
    locationIds: z.nullable(z.array(z.string())).optional(),
    remoteDepartmentIds: z.nullable(z.array(z.string())).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteLocationIds: z.nullable(z.array(z.string())).optional(),
    status: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        customFields: "custom_fields",
        departmentIds: "department_ids",
        hiringTeam: "hiring_team",
        interviewStages: "interview_stages",
        jobStatus: "job_status",
        locationIds: "location_ids",
        remoteDepartmentIds: "remote_department_ids",
        remoteId: "remote_id",
        remoteLocationIds: "remote_location_ids",
        unifiedCustomFields: "unified_custom_fields",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Job$;
(function (Job$) {
    /** @deprecated use `Job$inboundSchema` instead. */
    Job$.inboundSchema = exports.Job$inboundSchema;
    /** @deprecated use `Job$outboundSchema` instead. */
    Job$.outboundSchema = exports.Job$outboundSchema;
})(Job$ || (exports.Job$ = Job$ = {}));
function jobToJSON(job) {
    return JSON.stringify(exports.Job$outboundSchema.parse(job));
}
exports.jobToJSON = jobToJSON;
function jobFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Job$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Job' from JSON`);
}
exports.jobFromJSON = jobFromJSON;
//# sourceMappingURL=job.js.map