"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.ApplicantInput$outboundSchema = exports.Applicant$inboundSchema = exports.SocialLinks$outboundSchema = exports.SocialLinks$inboundSchema = exports.Websites$outboundSchema = exports.Websites$inboundSchema = exports.ApplicantType$outboundSchema = exports.ApplicantType$inboundSchema = exports.ApplicantGender$outboundSchema = exports.ApplicantGender$inboundSchema = exports.ApplicantType = exports.ApplicantGender = void 0;
exports.websitesToJSON = websitesToJSON;
exports.websitesFromJSON = websitesFromJSON;
exports.socialLinksToJSON = socialLinksToJSON;
exports.socialLinksFromJSON = socialLinksFromJSON;
exports.applicantFromJSON = applicantFromJSON;
exports.applicantInputToJSON = applicantInputToJSON;
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 customfield_js_1 = require("./customfield.js");
const email_js_1 = require("./email.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
const phonenumber_js_1 = require("./phonenumber.js");
/**
 * The gender represents the gender identity of a person.
 */
exports.ApplicantGender = {
    Male: "male",
    Female: "female",
    Unisex: "unisex",
    Other: "other",
    NotSpecified: "not_specified",
};
/**
 * The type of website
 */
exports.ApplicantType = {
    Primary: "primary",
    Secondary: "secondary",
    Work: "work",
    Personal: "personal",
    Other: "other",
};
/** @internal */
exports.ApplicantGender$inboundSchema = z.nativeEnum(exports.ApplicantGender);
/** @internal */
exports.ApplicantGender$outboundSchema = exports.ApplicantGender$inboundSchema;
/** @internal */
exports.ApplicantType$inboundSchema = z.nativeEnum(exports.ApplicantType);
/** @internal */
exports.ApplicantType$outboundSchema = exports.ApplicantType$inboundSchema;
/** @internal */
exports.Websites$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    url: z.string(),
    type: z.nullable(exports.ApplicantType$inboundSchema).optional(),
});
/** @internal */
exports.Websites$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    url: z.string(),
    type: z.nullable(exports.ApplicantType$outboundSchema).optional(),
});
function websitesToJSON(websites) {
    return JSON.stringify(exports.Websites$outboundSchema.parse(websites));
}
function websitesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Websites$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Websites' from JSON`);
}
/** @internal */
exports.SocialLinks$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    url: z.string(),
    type: z.nullable(z.string()).optional(),
});
/** @internal */
exports.SocialLinks$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    url: z.string(),
    type: z.nullable(z.string()).optional(),
});
function socialLinksToJSON(socialLinks) {
    return JSON.stringify(exports.SocialLinks$outboundSchema.parse(socialLinks));
}
function socialLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SocialLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SocialLinks' from JSON`);
}
/** @internal */
exports.Applicant$inboundSchema = z.object({
    id: z.string().optional(),
    name: z.string().optional(),
    salutation: 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(),
    initials: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    gender: z.nullable(exports.ApplicantGender$inboundSchema).optional(),
    social_security_number: z.nullable(z.string()).optional(),
    type: z.string().optional(),
    cover_letter: z.string().optional(),
    job_url: z.nullable(z.string()).optional(),
    photo_url: z.nullable(z.string()).optional(),
    headline: z.string().optional(),
    title: z.nullable(z.string()).optional(),
    emails: z.array(email_js_1.Email$inboundSchema).optional(),
    custom_fields: z.array(customfield_js_1.CustomField$inboundSchema).optional(),
    phone_numbers: z.array(phonenumber_js_1.PhoneNumber$inboundSchema).optional(),
    addresses: z.array(address_js_1.Address$inboundSchema).optional(),
    websites: z.array(z.lazy(() => exports.Websites$inboundSchema)).optional(),
    social_links: z.array(z.lazy(() => exports.SocialLinks$inboundSchema)).optional(),
    stage_id: z.string().optional(),
    recruiter_id: z.string().optional(),
    coordinator_id: z.string().optional(),
    application_ids: z.nullable(z.array(z.string())).optional(),
    applications: z.nullable(z.array(z.string())).optional(),
    followers: z.nullable(z.array(z.string())).optional(),
    sources: z.nullable(z.array(z.string())).optional(),
    source_id: z.string().optional(),
    confidential: z.boolean().optional(),
    anonymized: z.boolean().optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    archived: z.nullable(z.boolean()).optional(),
    last_interaction_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    owner_id: z.nullable(z.string()).optional(),
    sourced_by: z.nullable(z.string()).optional(),
    cv_url: z.string().optional(),
    record_url: z.nullable(z.string()).optional(),
    rejected_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    deleted: z.nullable(z.boolean()).optional(),
    deleted_by: z.nullable(z.string()).optional(),
    deleted_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).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, {
        "first_name": "firstName",
        "last_name": "lastName",
        "middle_name": "middleName",
        "social_security_number": "socialSecurityNumber",
        "cover_letter": "coverLetter",
        "job_url": "jobUrl",
        "photo_url": "photoUrl",
        "custom_fields": "customFields",
        "phone_numbers": "phoneNumbers",
        "social_links": "socialLinks",
        "stage_id": "stageId",
        "recruiter_id": "recruiterId",
        "coordinator_id": "coordinatorId",
        "application_ids": "applicationIds",
        "source_id": "sourceId",
        "last_interaction_at": "lastInteractionAt",
        "owner_id": "ownerId",
        "sourced_by": "sourcedBy",
        "cv_url": "cvUrl",
        "record_url": "recordUrl",
        "rejected_at": "rejectedAt",
        "custom_mappings": "customMappings",
        "deleted_by": "deletedBy",
        "deleted_at": "deletedAt",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "pass_through": "passThrough",
    });
});
function applicantFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Applicant$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Applicant' from JSON`);
}
/** @internal */
exports.ApplicantInput$outboundSchema = z.object({
    name: z.string().optional(),
    salutation: z.nullable(z.string()).optional(),
    firstName: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    middleName: z.nullable(z.string()).optional(),
    initials: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    gender: z.nullable(exports.ApplicantGender$outboundSchema).optional(),
    socialSecurityNumber: z.nullable(z.string()).optional(),
    type: z.string().optional(),
    coverLetter: z.string().optional(),
    photoUrl: z.nullable(z.string()).optional(),
    headline: z.string().optional(),
    title: z.nullable(z.string()).optional(),
    emails: z.array(email_js_1.Email$outboundSchema).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
    phoneNumbers: z.array(phonenumber_js_1.PhoneNumber$outboundSchema).optional(),
    addresses: z.array(address_js_1.Address$outboundSchema).optional(),
    websites: z.array(z.lazy(() => exports.Websites$outboundSchema)).optional(),
    socialLinks: z.array(z.lazy(() => exports.SocialLinks$outboundSchema)).optional(),
    stageId: z.string().optional(),
    recruiterId: z.string().optional(),
    coordinatorId: z.string().optional(),
    applicationIds: z.nullable(z.array(z.string())).optional(),
    applications: z.nullable(z.array(z.string())).optional(),
    followers: z.nullable(z.array(z.string())).optional(),
    sources: z.nullable(z.array(z.string())).optional(),
    confidential: z.boolean().optional(),
    anonymized: z.boolean().optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    archived: z.nullable(z.boolean()).optional(),
    ownerId: z.nullable(z.string()).optional(),
    recordUrl: 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",
        socialSecurityNumber: "social_security_number",
        coverLetter: "cover_letter",
        photoUrl: "photo_url",
        customFields: "custom_fields",
        phoneNumbers: "phone_numbers",
        socialLinks: "social_links",
        stageId: "stage_id",
        recruiterId: "recruiter_id",
        coordinatorId: "coordinator_id",
        applicationIds: "application_ids",
        ownerId: "owner_id",
        recordUrl: "record_url",
        passThrough: "pass_through",
    });
});
function applicantInputToJSON(applicantInput) {
    return JSON.stringify(exports.ApplicantInput$outboundSchema.parse(applicantInput));
}
//# sourceMappingURL=applicant.js.map