"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.Job$inboundSchema = exports.JobLinks$inboundSchema = exports.JobType$inboundSchema = exports.Salary$inboundSchema = exports.Blocks$inboundSchema = exports.Branch$inboundSchema = exports.EmploymentTerms$inboundSchema = exports.Visibility$inboundSchema = exports.JobType = exports.EmploymentTerms = exports.Visibility = void 0;
exports.branchFromJSON = branchFromJSON;
exports.blocksFromJSON = blocksFromJSON;
exports.salaryFromJSON = salaryFromJSON;
exports.jobLinksFromJSON = jobLinksFromJSON;
exports.jobFromJSON = jobFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const rfcdate_js_1 = require("../../types/rfcdate.js");
const address_js_1 = require("./address.js");
const currency_js_1 = require("./currency.js");
const customfield_js_1 = require("./customfield.js");
const department_js_1 = require("./department.js");
const jobstatus_js_1 = require("./jobstatus.js");
/**
 * The visibility of the job
 */
exports.Visibility = {
    Draft: "draft",
    Public: "public",
    Internal: "internal",
};
exports.EmploymentTerms = {
    FullTime: "full-time",
    PartTime: "part-time",
    Internship: "internship",
    Contractor: "contractor",
    Employee: "employee",
    Freelance: "freelance",
    Temp: "temp",
    Seasonal: "seasonal",
    Volunteer: "volunteer",
    Other: "other",
};
exports.JobType = {
    JobPortal: "job_portal",
    JobDescription: "job_description",
};
/** @internal */
exports.Visibility$inboundSchema = z
    .nativeEnum(exports.Visibility);
/** @internal */
exports.EmploymentTerms$inboundSchema = z.nativeEnum(exports.EmploymentTerms);
/** @internal */
exports.Branch$inboundSchema = z
    .object({
    id: z.string().optional(),
    name: z.string().optional(),
});
function branchFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Branch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Branch' from JSON`);
}
/** @internal */
exports.Blocks$inboundSchema = z
    .object({
    title: z.string().optional(),
    content: z.nullable(z.string()).optional(),
});
function blocksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Blocks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Blocks' from JSON`);
}
/** @internal */
exports.Salary$inboundSchema = z
    .object({
    min: z.number().int().optional(),
    max: z.number().int().optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    interval: z.nullable(z.string()).optional(),
});
function salaryFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Salary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Salary' from JSON`);
}
/** @internal */
exports.JobType$inboundSchema = z
    .nativeEnum(exports.JobType);
/** @internal */
exports.JobLinks$inboundSchema = z.object({
    type: exports.JobType$inboundSchema.optional(),
    url: z.string().optional(),
});
function jobLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.JobLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JobLinks' from JSON`);
}
/** @internal */
exports.Job$inboundSchema = z
    .object({
    id: z.string().optional(),
    slug: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    sequence: z.number().int().optional(),
    visibility: exports.Visibility$inboundSchema.optional(),
    status: jobstatus_js_1.JobStatus$inboundSchema.optional(),
    code: z.string().optional(),
    language: z.nullable(z.string()).optional(),
    employment_terms: z.nullable(exports.EmploymentTerms$inboundSchema).optional(),
    experience: z.string().optional(),
    location: z.nullable(z.string()).optional(),
    remote: z.nullable(z.boolean()).optional(),
    requisition_id: z.string().optional(),
    department: department_js_1.Department$inboundSchema.optional(),
    branch: z.lazy(() => exports.Branch$inboundSchema).optional(),
    recruiters: z.nullable(z.array(z.string())).optional(),
    hiring_managers: z.array(z.string()).optional(),
    followers: z.nullable(z.array(z.string())).optional(),
    description: z.nullable(z.string()).optional(),
    description_html: z.nullable(z.string()).optional(),
    blocks: z.array(z.lazy(() => exports.Blocks$inboundSchema)).optional(),
    closing: z.nullable(z.string()).optional(),
    closing_html: z.nullable(z.string()).optional(),
    closing_date: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v)))
        .optional(),
    salary: z.lazy(() => exports.Salary$inboundSchema).optional(),
    url: z.nullable(z.string()).optional(),
    job_portal_url: z.nullable(z.string()).optional(),
    record_url: z.nullable(z.string()).optional(),
    links: z.array(z.lazy(() => exports.JobLinks$inboundSchema)).optional(),
    confidential: z.boolean().optional(),
    available_to_employees: z.boolean().optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    addresses: z.array(address_js_1.Address$inboundSchema).optional(),
    custom_fields: z.array(customfield_js_1.CustomField$inboundSchema).optional(),
    deleted: z.nullable(z.boolean()).optional(),
    owner_id: z.nullable(z.string()).optional(),
    published_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "employment_terms": "employmentTerms",
        "requisition_id": "requisitionId",
        "hiring_managers": "hiringManagers",
        "description_html": "descriptionHtml",
        "closing_html": "closingHtml",
        "closing_date": "closingDate",
        "job_portal_url": "jobPortalUrl",
        "record_url": "recordUrl",
        "available_to_employees": "availableToEmployees",
        "custom_fields": "customFields",
        "owner_id": "ownerId",
        "published_at": "publishedAt",
        "custom_mappings": "customMappings",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
    });
});
function jobFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Job$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Job' from JSON`);
}
//# sourceMappingURL=job.js.map