"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.EmployeeInput$outboundSchema = exports.Employee$inboundSchema = exports.ProbationPeriod$outboundSchema = exports.ProbationPeriod$inboundSchema = exports.Manager$outboundSchema = exports.Manager$inboundSchema = exports.EmploymentRole$outboundSchema = exports.EmploymentRole$inboundSchema = exports.EmploymentSubType$outboundSchema = exports.EmploymentSubType$inboundSchema = exports.EmploymentType$outboundSchema = exports.EmploymentType$inboundSchema = exports.LeavingReason$outboundSchema = exports.LeavingReason$inboundSchema = exports.EmploymentSubType = exports.EmploymentType = exports.LeavingReason = void 0;
exports.employmentRoleToJSON = employmentRoleToJSON;
exports.employmentRoleFromJSON = employmentRoleFromJSON;
exports.managerToJSON = managerToJSON;
exports.managerFromJSON = managerFromJSON;
exports.probationPeriodToJSON = probationPeriodToJSON;
exports.probationPeriodFromJSON = probationPeriodFromJSON;
exports.employeeFromJSON = employeeFromJSON;
exports.employeeInputToJSON = employeeInputToJSON;
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 bankaccount2_js_1 = require("./bankaccount2.js");
const customfield_js_1 = require("./customfield.js");
const email_js_1 = require("./email.js");
const employeecompensation_js_1 = require("./employeecompensation.js");
const employeejob_js_1 = require("./employeejob.js");
const employmentstatus_js_1 = require("./employmentstatus.js");
const gender_js_1 = require("./gender.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
const person_js_1 = require("./person.js");
const personinput_js_1 = require("./personinput.js");
const phonenumber_js_1 = require("./phonenumber.js");
const sociallink_js_1 = require("./sociallink.js");
const team_js_1 = require("./team.js");
/**
 * The reason because the employment ended.
 */
exports.LeavingReason = {
    Dismissed: "dismissed",
    Resigned: "resigned",
    Redundancy: "redundancy",
    Other: "other",
};
/**
 * The type of employment relationship the employee has with the organization.
 */
exports.EmploymentType = {
    Contractor: "contractor",
    Employee: "employee",
    Freelance: "freelance",
    Temp: "temp",
    Internship: "internship",
    Other: "other",
};
/**
 * The work schedule of the employee.
 */
exports.EmploymentSubType = {
    FullTime: "full_time",
    PartTime: "part_time",
    Hourly: "hourly",
    Other: "other",
    NotSpecified: "not_specified",
};
/** @internal */
exports.LeavingReason$inboundSchema = z.nativeEnum(exports.LeavingReason);
/** @internal */
exports.LeavingReason$outboundSchema = exports.LeavingReason$inboundSchema;
/** @internal */
exports.EmploymentType$inboundSchema = z.nativeEnum(exports.EmploymentType);
/** @internal */
exports.EmploymentType$outboundSchema = exports.EmploymentType$inboundSchema;
/** @internal */
exports.EmploymentSubType$inboundSchema = z.nativeEnum(exports.EmploymentSubType);
/** @internal */
exports.EmploymentSubType$outboundSchema = exports.EmploymentSubType$inboundSchema;
/** @internal */
exports.EmploymentRole$inboundSchema = z.object({
    type: z.nullable(exports.EmploymentType$inboundSchema).optional(),
    sub_type: z.nullable(exports.EmploymentSubType$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "sub_type": "subType",
    });
});
/** @internal */
exports.EmploymentRole$outboundSchema = z.object({
    type: z.nullable(exports.EmploymentType$outboundSchema).optional(),
    subType: z.nullable(exports.EmploymentSubType$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        subType: "sub_type",
    });
});
function employmentRoleToJSON(employmentRole) {
    return JSON.stringify(exports.EmploymentRole$outboundSchema.parse(employmentRole));
}
function employmentRoleFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EmploymentRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmploymentRole' from JSON`);
}
/** @internal */
exports.Manager$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    first_name: z.nullable(z.string()).optional(),
    last_name: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    employment_status: z.nullable(employmentstatus_js_1.EmploymentStatus$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "first_name": "firstName",
        "last_name": "lastName",
        "employment_status": "employmentStatus",
    });
});
/** @internal */
exports.Manager$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    firstName: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    email: z.nullable(z.string()).optional(),
    employmentStatus: z.nullable(employmentstatus_js_1.EmploymentStatus$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        firstName: "first_name",
        lastName: "last_name",
        employmentStatus: "employment_status",
    });
});
function managerToJSON(manager) {
    return JSON.stringify(exports.Manager$outboundSchema.parse(manager));
}
function managerFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Manager$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Manager' from JSON`);
}
/** @internal */
exports.ProbationPeriod$inboundSchema = z.object({
    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(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "start_date": "startDate",
        "end_date": "endDate",
    });
});
/** @internal */
exports.ProbationPeriod$outboundSchema = z.object({
    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(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        startDate: "start_date",
        endDate: "end_date",
    });
});
function probationPeriodToJSON(probationPeriod) {
    return JSON.stringify(exports.ProbationPeriod$outboundSchema.parse(probationPeriod));
}
function probationPeriodFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ProbationPeriod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProbationPeriod' from JSON`);
}
/** @internal */
exports.Employee$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    downstream_id: z.nullable(z.string()).optional(),
    first_name: z.nullable(z.string()).optional(),
    last_name: z.nullable(z.string()).optional(),
    middle_name: z.nullable(z.string()).optional(),
    display_name: z.nullable(z.string()).optional(),
    preferred_name: z.nullable(z.string()).optional(),
    initials: z.nullable(z.string()).optional(),
    salutation: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    marital_status: z.nullable(z.string()).optional(),
    partner: person_js_1.Person$inboundSchema.optional(),
    division: z.nullable(z.string()).optional(),
    division_id: z.nullable(z.string()).optional(),
    department: z.nullable(z.string()).optional(),
    department_id: z.nullable(z.string()).optional(),
    department_name: z.nullable(z.string()).optional(),
    team: z.nullable(team_js_1.Team$inboundSchema).optional(),
    company_id: z.nullable(z.string()).optional(),
    company_name: z.nullable(z.string()).optional(),
    employment_start_date: z.nullable(z.string()).optional(),
    employment_end_date: z.nullable(z.string()).optional(),
    leaving_reason: z.nullable(exports.LeavingReason$inboundSchema).optional(),
    employee_number: z.nullable(z.string()).optional(),
    employment_status: z.nullable(employmentstatus_js_1.EmploymentStatus$inboundSchema).optional(),
    employment_role: z.lazy(() => exports.EmploymentRole$inboundSchema).optional(),
    ethnicity: z.nullable(z.string()).optional(),
    manager: z.lazy(() => exports.Manager$inboundSchema).optional(),
    direct_reports: z.nullable(z.array(z.string())).optional(),
    social_security_number: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    deceased_on: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    country_of_birth: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    gender: z.nullable(gender_js_1.Gender$inboundSchema).optional(),
    pronouns: z.nullable(z.string()).optional(),
    preferred_language: z.nullable(z.string()).optional(),
    languages: z.array(z.nullable(z.string())).optional(),
    nationalities: z.array(z.nullable(z.string())).optional(),
    photo_url: z.nullable(z.string()).optional(),
    timezone: z.nullable(z.string()).optional(),
    source: z.nullable(z.string()).optional(),
    source_id: z.nullable(z.string()).optional(),
    record_url: z.nullable(z.string()).optional(),
    jobs: z.nullable(z.array(employeejob_js_1.EmployeeJob$inboundSchema)).optional(),
    compensations: z.nullable(z.array(employeecompensation_js_1.EmployeeCompensation$inboundSchema))
        .optional(),
    works_remote: z.nullable(z.boolean()).optional(),
    addresses: z.array(address_js_1.Address$inboundSchema).optional(),
    phone_numbers: z.array(phonenumber_js_1.PhoneNumber$inboundSchema).optional(),
    emails: z.array(email_js_1.Email$inboundSchema).optional(),
    custom_fields: z.array(customfield_js_1.CustomField$inboundSchema).optional(),
    social_links: z.array(sociallink_js_1.SocialLink$inboundSchema).optional(),
    bank_accounts: z.array(bankaccount2_js_1.BankAccount2$inboundSchema).optional(),
    tax_code: z.nullable(z.string()).optional(),
    tax_id: z.nullable(z.string()).optional(),
    dietary_preference: z.nullable(z.string()).optional(),
    food_allergies: z.nullable(z.array(z.string())).optional(),
    probation_period: z.lazy(() => exports.ProbationPeriod$inboundSchema).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    row_version: z.nullable(z.string()).optional(),
    deleted: z.nullable(z.boolean()).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(),
    pass_through: z.array(passthroughbody_js_1.PassThroughBody$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "downstream_id": "downstreamId",
        "first_name": "firstName",
        "last_name": "lastName",
        "middle_name": "middleName",
        "display_name": "displayName",
        "preferred_name": "preferredName",
        "marital_status": "maritalStatus",
        "division_id": "divisionId",
        "department_id": "departmentId",
        "department_name": "departmentName",
        "company_id": "companyId",
        "company_name": "companyName",
        "employment_start_date": "employmentStartDate",
        "employment_end_date": "employmentEndDate",
        "leaving_reason": "leavingReason",
        "employee_number": "employeeNumber",
        "employment_status": "employmentStatus",
        "employment_role": "employmentRole",
        "direct_reports": "directReports",
        "social_security_number": "socialSecurityNumber",
        "deceased_on": "deceasedOn",
        "country_of_birth": "countryOfBirth",
        "preferred_language": "preferredLanguage",
        "photo_url": "photoUrl",
        "source_id": "sourceId",
        "record_url": "recordUrl",
        "works_remote": "worksRemote",
        "phone_numbers": "phoneNumbers",
        "custom_fields": "customFields",
        "social_links": "socialLinks",
        "bank_accounts": "bankAccounts",
        "tax_code": "taxCode",
        "tax_id": "taxId",
        "dietary_preference": "dietaryPreference",
        "food_allergies": "foodAllergies",
        "probation_period": "probationPeriod",
        "custom_mappings": "customMappings",
        "row_version": "rowVersion",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "pass_through": "passThrough",
    });
});
function employeeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Employee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Employee' from JSON`);
}
/** @internal */
exports.EmployeeInput$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    firstName: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    middleName: z.nullable(z.string()).optional(),
    displayName: z.nullable(z.string()).optional(),
    preferredName: z.nullable(z.string()).optional(),
    initials: z.nullable(z.string()).optional(),
    salutation: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    maritalStatus: z.nullable(z.string()).optional(),
    partner: personinput_js_1.PersonInput$outboundSchema.optional(),
    division: z.nullable(z.string()).optional(),
    divisionId: z.nullable(z.string()).optional(),
    department: z.nullable(z.string()).optional(),
    departmentId: z.nullable(z.string()).optional(),
    departmentName: z.nullable(z.string()).optional(),
    team: z.nullable(team_js_1.Team$outboundSchema).optional(),
    companyId: z.nullable(z.string()).optional(),
    companyName: z.nullable(z.string()).optional(),
    employmentStartDate: z.nullable(z.string()).optional(),
    employmentEndDate: z.nullable(z.string()).optional(),
    leavingReason: z.nullable(exports.LeavingReason$outboundSchema).optional(),
    employeeNumber: z.nullable(z.string()).optional(),
    employmentStatus: z.nullable(employmentstatus_js_1.EmploymentStatus$outboundSchema).optional(),
    employmentRole: z.lazy(() => exports.EmploymentRole$outboundSchema).optional(),
    ethnicity: z.nullable(z.string()).optional(),
    manager: z.lazy(() => exports.Manager$outboundSchema).optional(),
    directReports: z.nullable(z.array(z.string())).optional(),
    socialSecurityNumber: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    deceasedOn: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    countryOfBirth: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    gender: z.nullable(gender_js_1.Gender$outboundSchema).optional(),
    pronouns: z.nullable(z.string()).optional(),
    preferredLanguage: z.nullable(z.string()).optional(),
    languages: z.array(z.nullable(z.string())).optional(),
    nationalities: z.array(z.nullable(z.string())).optional(),
    photoUrl: z.nullable(z.string()).optional(),
    timezone: z.nullable(z.string()).optional(),
    source: z.nullable(z.string()).optional(),
    sourceId: z.nullable(z.string()).optional(),
    recordUrl: z.nullable(z.string()).optional(),
    jobs: z.nullable(z.array(employeejob_js_1.EmployeeJobInput$outboundSchema)).optional(),
    compensations: z.nullable(z.array(employeecompensation_js_1.EmployeeCompensationInput$outboundSchema))
        .optional(),
    worksRemote: z.nullable(z.boolean()).optional(),
    addresses: z.array(address_js_1.Address$outboundSchema).optional(),
    phoneNumbers: z.array(phonenumber_js_1.PhoneNumber$outboundSchema).optional(),
    emails: z.array(email_js_1.Email$outboundSchema).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
    socialLinks: z.array(sociallink_js_1.SocialLink$outboundSchema).optional(),
    bankAccounts: z.array(bankaccount2_js_1.BankAccount2$outboundSchema).optional(),
    taxCode: z.nullable(z.string()).optional(),
    taxId: z.nullable(z.string()).optional(),
    dietaryPreference: z.nullable(z.string()).optional(),
    foodAllergies: z.nullable(z.array(z.string())).optional(),
    probationPeriod: z.lazy(() => exports.ProbationPeriod$outboundSchema).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    rowVersion: z.nullable(z.string()).optional(),
    deleted: z.nullable(z.boolean()).optional(),
    passThrough: z.array(passthroughbody_js_1.PassThroughBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        firstName: "first_name",
        lastName: "last_name",
        middleName: "middle_name",
        displayName: "display_name",
        preferredName: "preferred_name",
        maritalStatus: "marital_status",
        divisionId: "division_id",
        departmentId: "department_id",
        departmentName: "department_name",
        companyId: "company_id",
        companyName: "company_name",
        employmentStartDate: "employment_start_date",
        employmentEndDate: "employment_end_date",
        leavingReason: "leaving_reason",
        employeeNumber: "employee_number",
        employmentStatus: "employment_status",
        employmentRole: "employment_role",
        directReports: "direct_reports",
        socialSecurityNumber: "social_security_number",
        deceasedOn: "deceased_on",
        countryOfBirth: "country_of_birth",
        preferredLanguage: "preferred_language",
        photoUrl: "photo_url",
        sourceId: "source_id",
        recordUrl: "record_url",
        worksRemote: "works_remote",
        phoneNumbers: "phone_numbers",
        customFields: "custom_fields",
        socialLinks: "social_links",
        bankAccounts: "bank_accounts",
        taxCode: "tax_code",
        taxId: "tax_id",
        dietaryPreference: "dietary_preference",
        foodAllergies: "food_allergies",
        probationPeriod: "probation_period",
        rowVersion: "row_version",
        passThrough: "pass_through",
    });
});
function employeeInputToJSON(employeeInput) {
    return JSON.stringify(exports.EmployeeInput$outboundSchema.parse(employeeInput));
}
//# sourceMappingURL=employee.js.map