"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.EmployeeJobInput$outboundSchema = exports.EmployeeJob$inboundSchema = exports.EmployeeJobStatus$outboundSchema = exports.EmployeeJobStatus$inboundSchema = exports.EmployeeJobStatus = void 0;
exports.employeeJobFromJSON = employeeJobFromJSON;
exports.employeeJobInputToJSON = employeeJobInputToJSON;
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 paymentunit_js_1 = require("./paymentunit.js");
/**
 * Indicates the status of the job.
 */
exports.EmployeeJobStatus = {
    Active: "active",
    Inactive: "inactive",
    Other: "other",
};
/** @internal */
exports.EmployeeJobStatus$inboundSchema = z.nativeEnum(exports.EmployeeJobStatus);
/** @internal */
exports.EmployeeJobStatus$outboundSchema = exports.EmployeeJobStatus$inboundSchema;
/** @internal */
exports.EmployeeJob$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    employee_id: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    role: z.nullable(z.string()).optional(),
    start_date: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    end_date: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    compensation_rate: z.nullable(z.number()).optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    payment_unit: z.nullable(paymentunit_js_1.PaymentUnit$inboundSchema).optional(),
    hired_at: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    is_primary: z.nullable(z.boolean()).optional(),
    is_manager: z.nullable(z.boolean()).optional(),
    status: z.nullable(exports.EmployeeJobStatus$inboundSchema).optional(),
    location: address_js_1.Address$inboundSchema.optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "employee_id": "employeeId",
        "start_date": "startDate",
        "end_date": "endDate",
        "compensation_rate": "compensationRate",
        "payment_unit": "paymentUnit",
        "hired_at": "hiredAt",
        "is_primary": "isPrimary",
        "is_manager": "isManager",
    });
});
function employeeJobFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmployeeJob$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeJob' from JSON`);
}
/** @internal */
exports.EmployeeJobInput$outboundSchema = z.object({
    title: z.nullable(z.string()).optional(),
    role: z.nullable(z.string()).optional(),
    startDate: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    endDate: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    compensationRate: z.nullable(z.number()).optional(),
    currency: z.nullable(currency_js_1.Currency$outboundSchema).optional(),
    paymentUnit: z.nullable(paymentunit_js_1.PaymentUnit$outboundSchema).optional(),
    hiredAt: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    isPrimary: z.nullable(z.boolean()).optional(),
    isManager: z.nullable(z.boolean()).optional(),
    status: z.nullable(exports.EmployeeJobStatus$outboundSchema).optional(),
    location: address_js_1.Address$outboundSchema.optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        startDate: "start_date",
        endDate: "end_date",
        compensationRate: "compensation_rate",
        paymentUnit: "payment_unit",
        hiredAt: "hired_at",
        isPrimary: "is_primary",
        isManager: "is_manager",
    });
});
function employeeJobInputToJSON(employeeJobInput) {
    return JSON.stringify(exports.EmployeeJobInput$outboundSchema.parse(employeeJobInput));
}
//# sourceMappingURL=employeejob.js.map