"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.TimeOff$inboundSchema = exports.TimeOffType$inboundSchema = exports.TimeOffSchemasValue$inboundSchema = exports.TimeOffSchemasSourceValue$inboundSchema = exports.TimeOffSchemas4$inboundSchema = exports.TimeOffStatus$inboundSchema = exports.TimeOffValue$inboundSchema = exports.TimeOffSourceValue$inboundSchema = exports.TimeOff4$inboundSchema = exports.TimeOffStartHalfDay$inboundSchema = exports.TimeOffSchemas2$inboundSchema = exports.TimeOffReason$inboundSchema = exports.Policy$inboundSchema = exports.TimeOffSchemasType$inboundSchema = exports.TimeOffSchemasPolicyTypeValue$inboundSchema = exports.TimeOffSchemasPolicyTypeSourceValue$inboundSchema = exports.TimeOffSchemasPolicyType4$inboundSchema = exports.TimeOffDurationUnit$inboundSchema = exports.TimeOffSchemasPolicyValue$inboundSchema = exports.TimeOffSchemasPolicySourceValue$inboundSchema = exports.TimeOffSchemasPolicy4$inboundSchema = exports.TimeOffEndHalfDay$inboundSchema = exports.TimeOff2$inboundSchema = exports.TimeOffSchemasValue = exports.TimeOffValue = exports.TimeOffSchemas2 = exports.TimeOffSchemasPolicyTypeValue = exports.TimeOffSchemasPolicyValue = exports.TimeOff2 = void 0;
exports.timeOffEndHalfDayFromJSON = timeOffEndHalfDayFromJSON;
exports.timeOffSchemasPolicy4FromJSON = timeOffSchemasPolicy4FromJSON;
exports.timeOffSchemasPolicySourceValueFromJSON = timeOffSchemasPolicySourceValueFromJSON;
exports.timeOffDurationUnitFromJSON = timeOffDurationUnitFromJSON;
exports.timeOffSchemasPolicyType4FromJSON = timeOffSchemasPolicyType4FromJSON;
exports.timeOffSchemasPolicyTypeSourceValueFromJSON = timeOffSchemasPolicyTypeSourceValueFromJSON;
exports.timeOffSchemasTypeFromJSON = timeOffSchemasTypeFromJSON;
exports.policyFromJSON = policyFromJSON;
exports.timeOffReasonFromJSON = timeOffReasonFromJSON;
exports.timeOffStartHalfDayFromJSON = timeOffStartHalfDayFromJSON;
exports.timeOff4FromJSON = timeOff4FromJSON;
exports.timeOffSourceValueFromJSON = timeOffSourceValueFromJSON;
exports.timeOffStatusFromJSON = timeOffStatusFromJSON;
exports.timeOffSchemas4FromJSON = timeOffSchemas4FromJSON;
exports.timeOffSchemasSourceValueFromJSON = timeOffSchemasSourceValueFromJSON;
exports.timeOffTypeFromJSON = timeOffTypeFromJSON;
exports.timeOffFromJSON = timeOffFromJSON;
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");
var TimeOff2;
(function (TimeOff2) {
    TimeOff2["True"] = "true";
    TimeOff2["False"] = "false";
})(TimeOff2 || (exports.TimeOff2 = TimeOff2 = {}));
/**
 * The unified value for the duration unit. If the provider does not specify this unit, the value will be set to unknown
 */
var TimeOffSchemasPolicyValue;
(function (TimeOffSchemasPolicyValue) {
    TimeOffSchemasPolicyValue["Minutes"] = "minutes";
    TimeOffSchemasPolicyValue["Hours"] = "hours";
    TimeOffSchemasPolicyValue["Days"] = "days";
    TimeOffSchemasPolicyValue["Weeks"] = "weeks";
    TimeOffSchemasPolicyValue["Months"] = "months";
    TimeOffSchemasPolicyValue["Years"] = "years";
    TimeOffSchemasPolicyValue["Unknown"] = "unknown";
    TimeOffSchemasPolicyValue["UnmappedValue"] = "unmapped_value";
})(TimeOffSchemasPolicyValue || (exports.TimeOffSchemasPolicyValue = TimeOffSchemasPolicyValue = {}));
/**
 * 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 TimeOffSchemasPolicyTypeValue;
(function (TimeOffSchemasPolicyTypeValue) {
    TimeOffSchemasPolicyTypeValue["Sick"] = "sick";
    TimeOffSchemasPolicyTypeValue["UnmappedValue"] = "unmapped_value";
    TimeOffSchemasPolicyTypeValue["Vacation"] = "vacation";
    TimeOffSchemasPolicyTypeValue["LongTermDisability"] = "long_term_disability";
    TimeOffSchemasPolicyTypeValue["ShortTermDisability"] = "short_term_disability";
    TimeOffSchemasPolicyTypeValue["Absent"] = "absent";
    TimeOffSchemasPolicyTypeValue["CompTime"] = "comp_time";
    TimeOffSchemasPolicyTypeValue["Training"] = "training";
    TimeOffSchemasPolicyTypeValue["AnnualLeave"] = "annual_leave";
    TimeOffSchemasPolicyTypeValue["LeaveOfAbsence"] = "leave_of_absence";
    TimeOffSchemasPolicyTypeValue["Break"] = "break";
    TimeOffSchemasPolicyTypeValue["ChildCareLeave"] = "child_care_leave";
    TimeOffSchemasPolicyTypeValue["MaternityLeave"] = "maternity_leave";
    TimeOffSchemasPolicyTypeValue["JuryDuty"] = "jury_duty";
    TimeOffSchemasPolicyTypeValue["Sabbatical"] = "sabbatical";
    TimeOffSchemasPolicyTypeValue["Accident"] = "accident";
    TimeOffSchemasPolicyTypeValue["Paid"] = "paid";
    TimeOffSchemasPolicyTypeValue["Unpaid"] = "unpaid";
    TimeOffSchemasPolicyTypeValue["Holiday"] = "holiday";
    TimeOffSchemasPolicyTypeValue["Personal"] = "personal";
    TimeOffSchemasPolicyTypeValue["InLieu"] = "in_lieu";
    TimeOffSchemasPolicyTypeValue["Bereavement"] = "bereavement";
    TimeOffSchemasPolicyTypeValue["Other"] = "other";
})(TimeOffSchemasPolicyTypeValue || (exports.TimeOffSchemasPolicyTypeValue = TimeOffSchemasPolicyTypeValue = {}));
var TimeOffSchemas2;
(function (TimeOffSchemas2) {
    TimeOffSchemas2["True"] = "true";
    TimeOffSchemas2["False"] = "false";
})(TimeOffSchemas2 || (exports.TimeOffSchemas2 = TimeOffSchemas2 = {}));
var TimeOffValue;
(function (TimeOffValue) {
    TimeOffValue["Approved"] = "approved";
    TimeOffValue["Cancelled"] = "cancelled";
    TimeOffValue["Rejected"] = "rejected";
    TimeOffValue["Pending"] = "pending";
    TimeOffValue["Deleted"] = "deleted";
    TimeOffValue["Draft"] = "draft";
    TimeOffValue["UnmappedValue"] = "unmapped_value";
})(TimeOffValue || (exports.TimeOffValue = TimeOffValue = {}));
var TimeOffSchemasValue;
(function (TimeOffSchemasValue) {
    TimeOffSchemasValue["Sick"] = "sick";
    TimeOffSchemasValue["UnmappedValue"] = "unmapped_value";
    TimeOffSchemasValue["Vacation"] = "vacation";
    TimeOffSchemasValue["LongTermDisability"] = "long_term_disability";
    TimeOffSchemasValue["ShortTermDisability"] = "short_term_disability";
    TimeOffSchemasValue["Absent"] = "absent";
    TimeOffSchemasValue["CompTime"] = "comp_time";
    TimeOffSchemasValue["Training"] = "training";
    TimeOffSchemasValue["AnnualLeave"] = "annual_leave";
    TimeOffSchemasValue["LeaveOfAbsence"] = "leave_of_absence";
    TimeOffSchemasValue["Break"] = "break";
    TimeOffSchemasValue["ChildCareLeave"] = "child_care_leave";
    TimeOffSchemasValue["MaternityLeave"] = "maternity_leave";
    TimeOffSchemasValue["JuryDuty"] = "jury_duty";
    TimeOffSchemasValue["Sabbatical"] = "sabbatical";
    TimeOffSchemasValue["Accident"] = "accident";
    TimeOffSchemasValue["Paid"] = "paid";
    TimeOffSchemasValue["Unpaid"] = "unpaid";
    TimeOffSchemasValue["Holiday"] = "holiday";
    TimeOffSchemasValue["Personal"] = "personal";
    TimeOffSchemasValue["InLieu"] = "in_lieu";
    TimeOffSchemasValue["Bereavement"] = "bereavement";
    TimeOffSchemasValue["Other"] = "other";
})(TimeOffSchemasValue || (exports.TimeOffSchemasValue = TimeOffSchemasValue = {}));
/** @internal */
exports.TimeOff2$inboundSchema = z
    .nativeEnum(TimeOff2);
/** @internal */
exports.TimeOffEndHalfDay$inboundSchema = z.union([z.boolean(), exports.TimeOff2$inboundSchema]);
function timeOffEndHalfDayFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffEndHalfDay$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffEndHalfDay' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicy4$inboundSchema = z.object({});
function timeOffSchemasPolicy4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasPolicy4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasPolicy4' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicySourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemasPolicy4$inboundSchema),
    z.array(z.any()),
]);
function timeOffSchemasPolicySourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasPolicySourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasPolicySourceValue' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicyValue$inboundSchema = openEnums.inboundSchema(TimeOffSchemasPolicyValue);
/** @internal */
exports.TimeOffDurationUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemasPolicy4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasPolicyValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffDurationUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffDurationUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffDurationUnit' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicyType4$inboundSchema = z.object({});
function timeOffSchemasPolicyType4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasPolicyType4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasPolicyType4' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicyTypeSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemasPolicyType4$inboundSchema),
    z.array(z.any()),
]);
function timeOffSchemasPolicyTypeSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasPolicyTypeSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasPolicyTypeSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffSchemasPolicyTypeValue$inboundSchema = openEnums.inboundSchema(TimeOffSchemasPolicyTypeValue);
/** @internal */
exports.TimeOffSchemasType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemasPolicyType4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasPolicyTypeValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffSchemasTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasType' from JSON`);
}
/** @internal */
exports.Policy$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.TimeOffDurationUnit$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.TimeOffSchemasType$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 policyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Policy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Policy' from JSON`);
}
/** @internal */
exports.TimeOffReason$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
function timeOffReasonFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffReason$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffReason' from JSON`);
}
/** @internal */
exports.TimeOffSchemas2$inboundSchema = z.nativeEnum(TimeOffSchemas2);
/** @internal */
exports.TimeOffStartHalfDay$inboundSchema = z.union([z.boolean(), exports.TimeOffSchemas2$inboundSchema]);
function timeOffStartHalfDayFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffStartHalfDay$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffStartHalfDay' from JSON`);
}
/** @internal */
exports.TimeOff4$inboundSchema = z.object({});
function timeOff4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOff4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOff4' from JSON`);
}
/** @internal */
exports.TimeOffSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOff4$inboundSchema),
    z.array(z.any()),
]);
function timeOffSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffValue$inboundSchema = openEnums.inboundSchema(TimeOffValue);
/** @internal */
exports.TimeOffStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOff4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffStatus' from JSON`);
}
/** @internal */
exports.TimeOffSchemas4$inboundSchema = z.object({});
function timeOffSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemas4' from JSON`);
}
/** @internal */
exports.TimeOffSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemas4$inboundSchema),
    z.array(z.any()),
]);
function timeOffSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TimeOffSchemasValue$inboundSchema = openEnums.inboundSchema(TimeOffSchemasValue);
/** @internal */
exports.TimeOffType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function timeOffTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffType' from JSON`);
}
/** @internal */
exports.TimeOff$inboundSchema = z.object({
    approver_id: z.nullable(z.string()).optional(),
    comment: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    duration: z.nullable(z.string()).optional(),
    employee_id: z.nullable(z.string()).optional(),
    end_date: z.nullable(z.string()).optional(),
    end_half_day: z.nullable(z.union([z.boolean(), exports.TimeOff2$inboundSchema]))
        .optional(),
    id: z.nullable(z.string()).optional(),
    policy: z.nullable(z.lazy(() => exports.Policy$inboundSchema)).optional(),
    reason: z.nullable(z.lazy(() => exports.TimeOffReason$inboundSchema)).optional(),
    remote_approver_id: z.nullable(z.string()).optional(),
    remote_employee_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_time_off_policy_id: z.nullable(z.string()).optional(),
    start_date: z.nullable(z.string()).optional(),
    start_half_day: z.nullable(z.union([z.boolean(), exports.TimeOffSchemas2$inboundSchema])).optional(),
    status: z.nullable(z.lazy(() => exports.TimeOffStatus$inboundSchema)).optional(),
    time_off_policy_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TimeOffType$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, {
        "approver_id": "approverId",
        "created_at": "createdAt",
        "employee_id": "employeeId",
        "end_date": "endDate",
        "end_half_day": "endHalfDay",
        "remote_approver_id": "remoteApproverId",
        "remote_employee_id": "remoteEmployeeId",
        "remote_id": "remoteId",
        "remote_time_off_policy_id": "remoteTimeOffPolicyId",
        "start_date": "startDate",
        "start_half_day": "startHalfDay",
        "time_off_policy_id": "timeOffPolicyId",
        "updated_at": "updatedAt",
    });
});
function timeOffFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOff$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOff' from JSON`);
}
//# sourceMappingURL=timeoff.js.map