"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.TimeOffBalances$inboundSchema = exports.TimeOffBalancesPolicy$inboundSchema = exports.TimeOffBalancesType$inboundSchema = exports.TimeOffBalancesSchemasPolicyValue$inboundSchema = exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema = exports.TimeOffBalancesSchemasPolicy4$inboundSchema = exports.TimeOffBalancesDurationUnit$inboundSchema = exports.TimeOffBalancesSchemasValue$inboundSchema = exports.TimeOffBalancesSchemasSourceValue$inboundSchema = exports.TimeOffBalancesSchemas4$inboundSchema = exports.IsUnlimited$inboundSchema = exports.TimeOffBalances2$inboundSchema = exports.BalanceUnit$inboundSchema = exports.TimeOffBalancesValue$inboundSchema = exports.TimeOffBalancesSourceValue$inboundSchema = exports.TimeOffBalances4$inboundSchema = exports.TimeOffBalancesSchemasPolicyValue = exports.TimeOffBalancesSchemasValue = exports.TimeOffBalances2 = exports.TimeOffBalancesValue = void 0;
exports.timeOffBalances4FromJSON = timeOffBalances4FromJSON;
exports.timeOffBalancesSourceValueFromJSON = timeOffBalancesSourceValueFromJSON;
exports.balanceUnitFromJSON = balanceUnitFromJSON;
exports.isUnlimitedFromJSON = isUnlimitedFromJSON;
exports.timeOffBalancesSchemas4FromJSON = timeOffBalancesSchemas4FromJSON;
exports.timeOffBalancesSchemasSourceValueFromJSON = timeOffBalancesSchemasSourceValueFromJSON;
exports.timeOffBalancesDurationUnitFromJSON = timeOffBalancesDurationUnitFromJSON;
exports.timeOffBalancesSchemasPolicy4FromJSON = timeOffBalancesSchemasPolicy4FromJSON;
exports.timeOffBalancesSchemasPolicySourceValueFromJSON = timeOffBalancesSchemasPolicySourceValueFromJSON;
exports.timeOffBalancesTypeFromJSON = timeOffBalancesTypeFromJSON;
exports.timeOffBalancesPolicyFromJSON = timeOffBalancesPolicyFromJSON;
exports.timeOffBalancesFromJSON = timeOffBalancesFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
const reason_js_1 = require("./reason.js");
/**
 * The unified value for the duration unit. If the provider does not specify this unit, the value will be set to unknown
 */
var TimeOffBalancesValue;
(function (TimeOffBalancesValue) {
    TimeOffBalancesValue["Minutes"] = "minutes";
    TimeOffBalancesValue["Hours"] = "hours";
    TimeOffBalancesValue["Days"] = "days";
    TimeOffBalancesValue["Weeks"] = "weeks";
    TimeOffBalancesValue["Months"] = "months";
    TimeOffBalancesValue["Years"] = "years";
    TimeOffBalancesValue["Unknown"] = "unknown";
    TimeOffBalancesValue["UnmappedValue"] = "unmapped_value";
})(TimeOffBalancesValue || (exports.TimeOffBalancesValue = TimeOffBalancesValue = {}));
var TimeOffBalances2;
(function (TimeOffBalances2) {
    TimeOffBalances2["True"] = "true";
    TimeOffBalances2["False"] = "false";
})(TimeOffBalances2 || (exports.TimeOffBalances2 = TimeOffBalances2 = {}));
/**
 * The unified value for the duration unit. If the provider does not specify this unit, the value will be set to unknown
 */
var TimeOffBalancesSchemasValue;
(function (TimeOffBalancesSchemasValue) {
    TimeOffBalancesSchemasValue["Minutes"] = "minutes";
    TimeOffBalancesSchemasValue["Hours"] = "hours";
    TimeOffBalancesSchemasValue["Days"] = "days";
    TimeOffBalancesSchemasValue["Weeks"] = "weeks";
    TimeOffBalancesSchemasValue["Months"] = "months";
    TimeOffBalancesSchemasValue["Years"] = "years";
    TimeOffBalancesSchemasValue["Unknown"] = "unknown";
    TimeOffBalancesSchemasValue["UnmappedValue"] = "unmapped_value";
})(TimeOffBalancesSchemasValue || (exports.TimeOffBalancesSchemasValue = TimeOffBalancesSchemasValue = {}));
/**
 * The unified value for the type of the time off policy. If the provider does not specify this unit, the value will be set to unmapped_value
 */
var TimeOffBalancesSchemasPolicyValue;
(function (TimeOffBalancesSchemasPolicyValue) {
    TimeOffBalancesSchemasPolicyValue["Sick"] = "sick";
    TimeOffBalancesSchemasPolicyValue["UnmappedValue"] = "unmapped_value";
    TimeOffBalancesSchemasPolicyValue["Vacation"] = "vacation";
    TimeOffBalancesSchemasPolicyValue["LongTermDisability"] = "long_term_disability";
    TimeOffBalancesSchemasPolicyValue["ShortTermDisability"] = "short_term_disability";
    TimeOffBalancesSchemasPolicyValue["Absent"] = "absent";
    TimeOffBalancesSchemasPolicyValue["CompTime"] = "comp_time";
    TimeOffBalancesSchemasPolicyValue["Training"] = "training";
    TimeOffBalancesSchemasPolicyValue["AnnualLeave"] = "annual_leave";
    TimeOffBalancesSchemasPolicyValue["LeaveOfAbsence"] = "leave_of_absence";
    TimeOffBalancesSchemasPolicyValue["Break"] = "break";
    TimeOffBalancesSchemasPolicyValue["ChildCareLeave"] = "child_care_leave";
    TimeOffBalancesSchemasPolicyValue["MaternityLeave"] = "maternity_leave";
    TimeOffBalancesSchemasPolicyValue["JuryDuty"] = "jury_duty";
    TimeOffBalancesSchemasPolicyValue["Sabbatical"] = "sabbatical";
    TimeOffBalancesSchemasPolicyValue["Accident"] = "accident";
    TimeOffBalancesSchemasPolicyValue["Paid"] = "paid";
    TimeOffBalancesSchemasPolicyValue["Unpaid"] = "unpaid";
    TimeOffBalancesSchemasPolicyValue["Holiday"] = "holiday";
    TimeOffBalancesSchemasPolicyValue["Personal"] = "personal";
    TimeOffBalancesSchemasPolicyValue["InLieu"] = "in_lieu";
    TimeOffBalancesSchemasPolicyValue["Bereavement"] = "bereavement";
    TimeOffBalancesSchemasPolicyValue["Other"] = "other";
})(TimeOffBalancesSchemasPolicyValue || (exports.TimeOffBalancesSchemasPolicyValue = TimeOffBalancesSchemasPolicyValue = {}));
/** @internal */
exports.TimeOffBalances4$inboundSchema = z.object({});
function timeOffBalances4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalances4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalances4' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffBalances4$inboundSchema),
    z.array(z.any()),
]);
function timeOffBalancesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffBalancesValue$inboundSchema = openEnums.inboundSchema(TimeOffBalancesValue);
/** @internal */
exports.BalanceUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffBalances4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function balanceUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceUnit' from JSON`);
}
/** @internal */
exports.TimeOffBalances2$inboundSchema = z.nativeEnum(TimeOffBalances2);
/** @internal */
exports.IsUnlimited$inboundSchema = z.union([z.boolean(), exports.TimeOffBalances2$inboundSchema]);
function isUnlimitedFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.IsUnlimited$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IsUnlimited' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemas4$inboundSchema = z.object({});
function timeOffBalancesSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemas4' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffBalancesSchemas4$inboundSchema),
    z.array(z.any()),
]);
function timeOffBalancesSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemasValue$inboundSchema = openEnums.inboundSchema(TimeOffBalancesSchemasValue);
/** @internal */
exports.TimeOffBalancesDurationUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffBalancesSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffBalancesDurationUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesDurationUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesDurationUnit' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemasPolicy4$inboundSchema = z.object({});
function timeOffBalancesSchemasPolicy4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasPolicy4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasPolicy4' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$inboundSchema),
    z.array(z.any()),
]);
function timeOffBalancesSchemasPolicySourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasPolicySourceValue' from JSON`);
}
/** @internal */
exports.TimeOffBalancesSchemasPolicyValue$inboundSchema = openEnums.inboundSchema(TimeOffBalancesSchemasPolicyValue);
/** @internal */
exports.TimeOffBalancesType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasPolicyValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffBalancesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesType' from JSON`);
}
/** @internal */
exports.TimeOffBalancesPolicy$inboundSchema = z.object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    duration_unit: z.nullable(z.lazy(() => exports.TimeOffBalancesDurationUnit$inboundSchema)).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    reasons: z.nullable(z.array(reason_js_1.Reason$inboundSchema)).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TimeOffBalancesType$inboundSchema)).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",
        "duration_unit": "durationUnit",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
function timeOffBalancesPolicyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesPolicy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesPolicy' from JSON`);
}
/** @internal */
exports.TimeOffBalances$inboundSchema = z.object({
    balance_expiry_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    balance_start_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    balance_unit: z.nullable(z.lazy(() => exports.BalanceUnit$inboundSchema)).optional(),
    current_balance: z.nullable(z.number()).optional(),
    employee_id: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    initial_balance: z.nullable(z.number()).optional(),
    is_unlimited: z.nullable(z.union([z.boolean(), exports.TimeOffBalances2$inboundSchema])).optional(),
    policy: z.nullable(z.lazy(() => exports.TimeOffBalancesPolicy$inboundSchema))
        .optional(),
    policy_id: z.nullable(z.string()).optional(),
    remote_employee_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_policy_id: z.nullable(z.string()).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, {
        "balance_expiry_date": "balanceExpiryDate",
        "balance_start_date": "balanceStartDate",
        "balance_unit": "balanceUnit",
        "current_balance": "currentBalance",
        "employee_id": "employeeId",
        "initial_balance": "initialBalance",
        "is_unlimited": "isUnlimited",
        "policy_id": "policyId",
        "remote_employee_id": "remoteEmployeeId",
        "remote_id": "remoteId",
        "remote_policy_id": "remotePolicyId",
        "updated_at": "updatedAt",
    });
});
function timeOffBalancesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalances$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalances' from JSON`);
}
//# sourceMappingURL=timeoffbalances.js.map