"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.TimeOffPolicies$inboundSchema = exports.TimeOffPoliciesType$inboundSchema = exports.TimeOffPoliciesSchemasValue$inboundSchema = exports.TimeOffPoliciesSchemasSourceValue$inboundSchema = exports.TimeOffPoliciesSchemas4$inboundSchema = exports.DurationUnit$inboundSchema = exports.TimeOffPoliciesValue$inboundSchema = exports.TimeOffPoliciesSourceValue$inboundSchema = exports.TimeOffPolicies4$inboundSchema = exports.TimeOffPoliciesSchemasValue = exports.TimeOffPoliciesValue = void 0;
exports.timeOffPolicies4FromJSON = timeOffPolicies4FromJSON;
exports.timeOffPoliciesSourceValueFromJSON = timeOffPoliciesSourceValueFromJSON;
exports.durationUnitFromJSON = durationUnitFromJSON;
exports.timeOffPoliciesSchemas4FromJSON = timeOffPoliciesSchemas4FromJSON;
exports.timeOffPoliciesSchemasSourceValueFromJSON = timeOffPoliciesSchemasSourceValueFromJSON;
exports.timeOffPoliciesTypeFromJSON = timeOffPoliciesTypeFromJSON;
exports.timeOffPoliciesFromJSON = timeOffPoliciesFromJSON;
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 TimeOffPoliciesValue;
(function (TimeOffPoliciesValue) {
    TimeOffPoliciesValue["Minutes"] = "minutes";
    TimeOffPoliciesValue["Hours"] = "hours";
    TimeOffPoliciesValue["Days"] = "days";
    TimeOffPoliciesValue["Weeks"] = "weeks";
    TimeOffPoliciesValue["Months"] = "months";
    TimeOffPoliciesValue["Years"] = "years";
    TimeOffPoliciesValue["Unknown"] = "unknown";
    TimeOffPoliciesValue["UnmappedValue"] = "unmapped_value";
})(TimeOffPoliciesValue || (exports.TimeOffPoliciesValue = TimeOffPoliciesValue = {}));
/**
 * 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 TimeOffPoliciesSchemasValue;
(function (TimeOffPoliciesSchemasValue) {
    TimeOffPoliciesSchemasValue["Sick"] = "sick";
    TimeOffPoliciesSchemasValue["UnmappedValue"] = "unmapped_value";
    TimeOffPoliciesSchemasValue["Vacation"] = "vacation";
    TimeOffPoliciesSchemasValue["LongTermDisability"] = "long_term_disability";
    TimeOffPoliciesSchemasValue["ShortTermDisability"] = "short_term_disability";
    TimeOffPoliciesSchemasValue["Absent"] = "absent";
    TimeOffPoliciesSchemasValue["CompTime"] = "comp_time";
    TimeOffPoliciesSchemasValue["Training"] = "training";
    TimeOffPoliciesSchemasValue["AnnualLeave"] = "annual_leave";
    TimeOffPoliciesSchemasValue["LeaveOfAbsence"] = "leave_of_absence";
    TimeOffPoliciesSchemasValue["Break"] = "break";
    TimeOffPoliciesSchemasValue["ChildCareLeave"] = "child_care_leave";
    TimeOffPoliciesSchemasValue["MaternityLeave"] = "maternity_leave";
    TimeOffPoliciesSchemasValue["JuryDuty"] = "jury_duty";
    TimeOffPoliciesSchemasValue["Sabbatical"] = "sabbatical";
    TimeOffPoliciesSchemasValue["Accident"] = "accident";
    TimeOffPoliciesSchemasValue["Paid"] = "paid";
    TimeOffPoliciesSchemasValue["Unpaid"] = "unpaid";
    TimeOffPoliciesSchemasValue["Holiday"] = "holiday";
    TimeOffPoliciesSchemasValue["Personal"] = "personal";
    TimeOffPoliciesSchemasValue["InLieu"] = "in_lieu";
    TimeOffPoliciesSchemasValue["Bereavement"] = "bereavement";
    TimeOffPoliciesSchemasValue["Other"] = "other";
})(TimeOffPoliciesSchemasValue || (exports.TimeOffPoliciesSchemasValue = TimeOffPoliciesSchemasValue = {}));
/** @internal */
exports.TimeOffPolicies4$inboundSchema = z.object({});
function timeOffPolicies4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPolicies4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPolicies4' from JSON`);
}
/** @internal */
exports.TimeOffPoliciesSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffPolicies4$inboundSchema),
    z.array(z.any()),
]);
function timeOffPoliciesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffPoliciesValue$inboundSchema = openEnums.inboundSchema(TimeOffPoliciesValue);
/** @internal */
exports.DurationUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffPolicies4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function durationUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DurationUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DurationUnit' from JSON`);
}
/** @internal */
exports.TimeOffPoliciesSchemas4$inboundSchema = z.object({});
function timeOffPoliciesSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSchemas4' from JSON`);
}
/** @internal */
exports.TimeOffPoliciesSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffPoliciesSchemas4$inboundSchema),
    z.array(z.any()),
]);
function timeOffPoliciesSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffPoliciesSchemasValue$inboundSchema = openEnums.inboundSchema(TimeOffPoliciesSchemasValue);
/** @internal */
exports.TimeOffPoliciesType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffPoliciesSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffPoliciesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesType' from JSON`);
}
/** @internal */
exports.TimeOffPolicies$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.DurationUnit$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.TimeOffPoliciesType$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 timeOffPoliciesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPolicies$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPolicies' from JSON`);
}
//# sourceMappingURL=timeoffpolicies.js.map