"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.TimeOff4$outboundSchema = exports.TimeOff4$inboundSchema = exports.TimeOffStartHalfDay$ = exports.TimeOffStartHalfDay$outboundSchema = exports.TimeOffStartHalfDay$inboundSchema = exports.TimeOffSchemas2$ = exports.TimeOffSchemas2$outboundSchema = exports.TimeOffSchemas2$inboundSchema = exports.TimeOffReason$ = exports.TimeOffReason$outboundSchema = exports.TimeOffReason$inboundSchema = exports.Policy$ = exports.Policy$outboundSchema = exports.Policy$inboundSchema = exports.TimeOffSchemasType$ = exports.TimeOffSchemasType$outboundSchema = exports.TimeOffSchemasType$inboundSchema = exports.TimeOffSchemasPolicyTypeValue$ = exports.TimeOffSchemasPolicyTypeValue$outboundSchema = exports.TimeOffSchemasPolicyTypeValue$inboundSchema = exports.TimeOffSchemasPolicyTypeSourceValue$ = exports.TimeOffSchemasPolicyTypeSourceValue$outboundSchema = exports.TimeOffSchemasPolicyTypeSourceValue$inboundSchema = exports.TimeOffSchemasPolicyType4$ = exports.TimeOffSchemasPolicyType4$outboundSchema = exports.TimeOffSchemasPolicyType4$inboundSchema = exports.TimeOffDurationUnit$ = exports.TimeOffDurationUnit$outboundSchema = exports.TimeOffDurationUnit$inboundSchema = exports.TimeOffSchemasPolicyValue$ = exports.TimeOffSchemasPolicyValue$outboundSchema = exports.TimeOffSchemasPolicyValue$inboundSchema = exports.TimeOffSchemasPolicySourceValue$ = exports.TimeOffSchemasPolicySourceValue$outboundSchema = exports.TimeOffSchemasPolicySourceValue$inboundSchema = exports.TimeOffSchemasPolicy4$ = exports.TimeOffSchemasPolicy4$outboundSchema = exports.TimeOffSchemasPolicy4$inboundSchema = exports.TimeOffEndHalfDay$ = exports.TimeOffEndHalfDay$outboundSchema = exports.TimeOffEndHalfDay$inboundSchema = exports.TimeOff2$ = exports.TimeOff2$outboundSchema = exports.TimeOff2$inboundSchema = exports.TimeOffSchemasValue = exports.TimeOffValue = exports.TimeOffSchemas2 = exports.TimeOffSchemasPolicyTypeValue = exports.TimeOffSchemasPolicyValue = exports.TimeOff2 = void 0;
exports.TimeOff$ = exports.TimeOff$outboundSchema = exports.TimeOff$inboundSchema = exports.TimeOffType$ = exports.TimeOffType$outboundSchema = exports.TimeOffType$inboundSchema = exports.TimeOffSchemasValue$ = exports.TimeOffSchemasValue$outboundSchema = exports.TimeOffSchemasValue$inboundSchema = exports.TimeOffSchemasSourceValue$ = exports.TimeOffSchemasSourceValue$outboundSchema = exports.TimeOffSchemasSourceValue$inboundSchema = exports.TimeOffSchemas4$ = exports.TimeOffSchemas4$outboundSchema = exports.TimeOffSchemas4$inboundSchema = exports.TimeOffStatus$ = exports.TimeOffStatus$outboundSchema = exports.TimeOffStatus$inboundSchema = exports.TimeOffValue$ = exports.TimeOffValue$outboundSchema = exports.TimeOffValue$inboundSchema = exports.TimeOffSourceValue$ = exports.TimeOffSourceValue$outboundSchema = exports.TimeOffSourceValue$inboundSchema = exports.TimeOff4$ = void 0;
exports.timeOffEndHalfDayToJSON = timeOffEndHalfDayToJSON;
exports.timeOffEndHalfDayFromJSON = timeOffEndHalfDayFromJSON;
exports.timeOffSchemasPolicy4ToJSON = timeOffSchemasPolicy4ToJSON;
exports.timeOffSchemasPolicy4FromJSON = timeOffSchemasPolicy4FromJSON;
exports.timeOffSchemasPolicySourceValueToJSON = timeOffSchemasPolicySourceValueToJSON;
exports.timeOffSchemasPolicySourceValueFromJSON = timeOffSchemasPolicySourceValueFromJSON;
exports.timeOffDurationUnitToJSON = timeOffDurationUnitToJSON;
exports.timeOffDurationUnitFromJSON = timeOffDurationUnitFromJSON;
exports.timeOffSchemasPolicyType4ToJSON = timeOffSchemasPolicyType4ToJSON;
exports.timeOffSchemasPolicyType4FromJSON = timeOffSchemasPolicyType4FromJSON;
exports.timeOffSchemasPolicyTypeSourceValueToJSON = timeOffSchemasPolicyTypeSourceValueToJSON;
exports.timeOffSchemasPolicyTypeSourceValueFromJSON = timeOffSchemasPolicyTypeSourceValueFromJSON;
exports.timeOffSchemasTypeToJSON = timeOffSchemasTypeToJSON;
exports.timeOffSchemasTypeFromJSON = timeOffSchemasTypeFromJSON;
exports.policyToJSON = policyToJSON;
exports.policyFromJSON = policyFromJSON;
exports.timeOffReasonToJSON = timeOffReasonToJSON;
exports.timeOffReasonFromJSON = timeOffReasonFromJSON;
exports.timeOffStartHalfDayToJSON = timeOffStartHalfDayToJSON;
exports.timeOffStartHalfDayFromJSON = timeOffStartHalfDayFromJSON;
exports.timeOff4ToJSON = timeOff4ToJSON;
exports.timeOff4FromJSON = timeOff4FromJSON;
exports.timeOffSourceValueToJSON = timeOffSourceValueToJSON;
exports.timeOffSourceValueFromJSON = timeOffSourceValueFromJSON;
exports.timeOffStatusToJSON = timeOffStatusToJSON;
exports.timeOffStatusFromJSON = timeOffStatusFromJSON;
exports.timeOffSchemas4ToJSON = timeOffSchemas4ToJSON;
exports.timeOffSchemas4FromJSON = timeOffSchemas4FromJSON;
exports.timeOffSchemasSourceValueToJSON = timeOffSchemasSourceValueToJSON;
exports.timeOffSchemasSourceValueFromJSON = timeOffSchemasSourceValueFromJSON;
exports.timeOffTypeToJSON = timeOffTypeToJSON;
exports.timeOffTypeFromJSON = timeOffTypeFromJSON;
exports.timeOffToJSON = timeOffToJSON;
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 enums_js_1 = 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.TimeOff2$outboundSchema = exports.TimeOff2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOff2$;
(function (TimeOff2$) {
    /** @deprecated use `TimeOff2$inboundSchema` instead. */
    TimeOff2$.inboundSchema = exports.TimeOff2$inboundSchema;
    /** @deprecated use `TimeOff2$outboundSchema` instead. */
    TimeOff2$.outboundSchema = exports.TimeOff2$outboundSchema;
})(TimeOff2$ || (exports.TimeOff2$ = TimeOff2$ = {}));
/** @internal */
exports.TimeOffEndHalfDay$inboundSchema = z.union([z.boolean(), exports.TimeOff2$inboundSchema]);
/** @internal */
exports.TimeOffEndHalfDay$outboundSchema = z.union([z.boolean(), exports.TimeOff2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffEndHalfDay$;
(function (TimeOffEndHalfDay$) {
    /** @deprecated use `TimeOffEndHalfDay$inboundSchema` instead. */
    TimeOffEndHalfDay$.inboundSchema = exports.TimeOffEndHalfDay$inboundSchema;
    /** @deprecated use `TimeOffEndHalfDay$outboundSchema` instead. */
    TimeOffEndHalfDay$.outboundSchema = exports.TimeOffEndHalfDay$outboundSchema;
})(TimeOffEndHalfDay$ || (exports.TimeOffEndHalfDay$ = TimeOffEndHalfDay$ = {}));
function timeOffEndHalfDayToJSON(timeOffEndHalfDay) {
    return JSON.stringify(exports.TimeOffEndHalfDay$outboundSchema.parse(timeOffEndHalfDay));
}
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({});
/** @internal */
exports.TimeOffSchemasPolicy4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicy4$;
(function (TimeOffSchemasPolicy4$) {
    /** @deprecated use `TimeOffSchemasPolicy4$inboundSchema` instead. */
    TimeOffSchemasPolicy4$.inboundSchema = exports.TimeOffSchemasPolicy4$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicy4$outboundSchema` instead. */
    TimeOffSchemasPolicy4$.outboundSchema = exports.TimeOffSchemasPolicy4$outboundSchema;
})(TimeOffSchemasPolicy4$ || (exports.TimeOffSchemasPolicy4$ = TimeOffSchemasPolicy4$ = {}));
function timeOffSchemasPolicy4ToJSON(timeOffSchemasPolicy4) {
    return JSON.stringify(exports.TimeOffSchemasPolicy4$outboundSchema.parse(timeOffSchemasPolicy4));
}
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()),
]);
/** @internal */
exports.TimeOffSchemasPolicySourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemasPolicy4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicySourceValue$;
(function (TimeOffSchemasPolicySourceValue$) {
    /** @deprecated use `TimeOffSchemasPolicySourceValue$inboundSchema` instead. */
    TimeOffSchemasPolicySourceValue$.inboundSchema = exports.TimeOffSchemasPolicySourceValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicySourceValue$outboundSchema` instead. */
    TimeOffSchemasPolicySourceValue$.outboundSchema = exports.TimeOffSchemasPolicySourceValue$outboundSchema;
})(TimeOffSchemasPolicySourceValue$ || (exports.TimeOffSchemasPolicySourceValue$ = TimeOffSchemasPolicySourceValue$ = {}));
function timeOffSchemasPolicySourceValueToJSON(timeOffSchemasPolicySourceValue) {
    return JSON.stringify(exports.TimeOffSchemasPolicySourceValue$outboundSchema.parse(timeOffSchemasPolicySourceValue));
}
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 = z
    .union([
    z.nativeEnum(TimeOffSchemasPolicyValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffSchemasPolicyValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffSchemasPolicyValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicyValue$;
(function (TimeOffSchemasPolicyValue$) {
    /** @deprecated use `TimeOffSchemasPolicyValue$inboundSchema` instead. */
    TimeOffSchemasPolicyValue$.inboundSchema = exports.TimeOffSchemasPolicyValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicyValue$outboundSchema` instead. */
    TimeOffSchemasPolicyValue$.outboundSchema = exports.TimeOffSchemasPolicyValue$outboundSchema;
})(TimeOffSchemasPolicyValue$ || (exports.TimeOffSchemasPolicyValue$ = 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",
    });
});
/** @internal */
exports.TimeOffDurationUnit$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemasPolicy4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasPolicyValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffDurationUnit$;
(function (TimeOffDurationUnit$) {
    /** @deprecated use `TimeOffDurationUnit$inboundSchema` instead. */
    TimeOffDurationUnit$.inboundSchema = exports.TimeOffDurationUnit$inboundSchema;
    /** @deprecated use `TimeOffDurationUnit$outboundSchema` instead. */
    TimeOffDurationUnit$.outboundSchema = exports.TimeOffDurationUnit$outboundSchema;
})(TimeOffDurationUnit$ || (exports.TimeOffDurationUnit$ = TimeOffDurationUnit$ = {}));
function timeOffDurationUnitToJSON(timeOffDurationUnit) {
    return JSON.stringify(exports.TimeOffDurationUnit$outboundSchema.parse(timeOffDurationUnit));
}
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({});
/** @internal */
exports.TimeOffSchemasPolicyType4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicyType4$;
(function (TimeOffSchemasPolicyType4$) {
    /** @deprecated use `TimeOffSchemasPolicyType4$inboundSchema` instead. */
    TimeOffSchemasPolicyType4$.inboundSchema = exports.TimeOffSchemasPolicyType4$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicyType4$outboundSchema` instead. */
    TimeOffSchemasPolicyType4$.outboundSchema = exports.TimeOffSchemasPolicyType4$outboundSchema;
})(TimeOffSchemasPolicyType4$ || (exports.TimeOffSchemasPolicyType4$ = TimeOffSchemasPolicyType4$ = {}));
function timeOffSchemasPolicyType4ToJSON(timeOffSchemasPolicyType4) {
    return JSON.stringify(exports.TimeOffSchemasPolicyType4$outboundSchema.parse(timeOffSchemasPolicyType4));
}
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()),
]);
/** @internal */
exports.TimeOffSchemasPolicyTypeSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemasPolicyType4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicyTypeSourceValue$;
(function (TimeOffSchemasPolicyTypeSourceValue$) {
    /** @deprecated use `TimeOffSchemasPolicyTypeSourceValue$inboundSchema` instead. */
    TimeOffSchemasPolicyTypeSourceValue$.inboundSchema = exports.TimeOffSchemasPolicyTypeSourceValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicyTypeSourceValue$outboundSchema` instead. */
    TimeOffSchemasPolicyTypeSourceValue$.outboundSchema = exports.TimeOffSchemasPolicyTypeSourceValue$outboundSchema;
})(TimeOffSchemasPolicyTypeSourceValue$ || (exports.TimeOffSchemasPolicyTypeSourceValue$ = TimeOffSchemasPolicyTypeSourceValue$ = {}));
function timeOffSchemasPolicyTypeSourceValueToJSON(timeOffSchemasPolicyTypeSourceValue) {
    return JSON.stringify(exports.TimeOffSchemasPolicyTypeSourceValue$outboundSchema.parse(timeOffSchemasPolicyTypeSourceValue));
}
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 = z
    .union([
    z.nativeEnum(TimeOffSchemasPolicyTypeValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffSchemasPolicyTypeValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffSchemasPolicyTypeValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasPolicyTypeValue$;
(function (TimeOffSchemasPolicyTypeValue$) {
    /** @deprecated use `TimeOffSchemasPolicyTypeValue$inboundSchema` instead. */
    TimeOffSchemasPolicyTypeValue$.inboundSchema = exports.TimeOffSchemasPolicyTypeValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasPolicyTypeValue$outboundSchema` instead. */
    TimeOffSchemasPolicyTypeValue$.outboundSchema = exports.TimeOffSchemasPolicyTypeValue$outboundSchema;
})(TimeOffSchemasPolicyTypeValue$ || (exports.TimeOffSchemasPolicyTypeValue$ = 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",
    });
});
/** @internal */
exports.TimeOffSchemasType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemasPolicyType4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasPolicyTypeValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasType$;
(function (TimeOffSchemasType$) {
    /** @deprecated use `TimeOffSchemasType$inboundSchema` instead. */
    TimeOffSchemasType$.inboundSchema = exports.TimeOffSchemasType$inboundSchema;
    /** @deprecated use `TimeOffSchemasType$outboundSchema` instead. */
    TimeOffSchemasType$.outboundSchema = exports.TimeOffSchemasType$outboundSchema;
})(TimeOffSchemasType$ || (exports.TimeOffSchemasType$ = TimeOffSchemasType$ = {}));
function timeOffSchemasTypeToJSON(timeOffSchemasType) {
    return JSON.stringify(exports.TimeOffSchemasType$outboundSchema.parse(timeOffSchemasType));
}
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",
    });
});
/** @internal */
exports.Policy$outboundSchema = z.object({
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    durationUnit: z.nullable(z.lazy(() => exports.TimeOffDurationUnit$outboundSchema))
        .optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    reasons: z.nullable(z.array(reason_js_1.Reason$outboundSchema)).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TimeOffSchemasType$outboundSchema)).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        durationUnit: "duration_unit",
        remoteId: "remote_id",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Policy$;
(function (Policy$) {
    /** @deprecated use `Policy$inboundSchema` instead. */
    Policy$.inboundSchema = exports.Policy$inboundSchema;
    /** @deprecated use `Policy$outboundSchema` instead. */
    Policy$.outboundSchema = exports.Policy$outboundSchema;
})(Policy$ || (exports.Policy$ = Policy$ = {}));
function policyToJSON(policy) {
    return JSON.stringify(exports.Policy$outboundSchema.parse(policy));
}
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",
    });
});
/** @internal */
exports.TimeOffReason$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffReason$;
(function (TimeOffReason$) {
    /** @deprecated use `TimeOffReason$inboundSchema` instead. */
    TimeOffReason$.inboundSchema = exports.TimeOffReason$inboundSchema;
    /** @deprecated use `TimeOffReason$outboundSchema` instead. */
    TimeOffReason$.outboundSchema = exports.TimeOffReason$outboundSchema;
})(TimeOffReason$ || (exports.TimeOffReason$ = TimeOffReason$ = {}));
function timeOffReasonToJSON(timeOffReason) {
    return JSON.stringify(exports.TimeOffReason$outboundSchema.parse(timeOffReason));
}
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.TimeOffSchemas2$outboundSchema = exports.TimeOffSchemas2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemas2$;
(function (TimeOffSchemas2$) {
    /** @deprecated use `TimeOffSchemas2$inboundSchema` instead. */
    TimeOffSchemas2$.inboundSchema = exports.TimeOffSchemas2$inboundSchema;
    /** @deprecated use `TimeOffSchemas2$outboundSchema` instead. */
    TimeOffSchemas2$.outboundSchema = exports.TimeOffSchemas2$outboundSchema;
})(TimeOffSchemas2$ || (exports.TimeOffSchemas2$ = TimeOffSchemas2$ = {}));
/** @internal */
exports.TimeOffStartHalfDay$inboundSchema = z.union([z.boolean(), exports.TimeOffSchemas2$inboundSchema]);
/** @internal */
exports.TimeOffStartHalfDay$outboundSchema = z.union([z.boolean(), exports.TimeOffSchemas2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffStartHalfDay$;
(function (TimeOffStartHalfDay$) {
    /** @deprecated use `TimeOffStartHalfDay$inboundSchema` instead. */
    TimeOffStartHalfDay$.inboundSchema = exports.TimeOffStartHalfDay$inboundSchema;
    /** @deprecated use `TimeOffStartHalfDay$outboundSchema` instead. */
    TimeOffStartHalfDay$.outboundSchema = exports.TimeOffStartHalfDay$outboundSchema;
})(TimeOffStartHalfDay$ || (exports.TimeOffStartHalfDay$ = TimeOffStartHalfDay$ = {}));
function timeOffStartHalfDayToJSON(timeOffStartHalfDay) {
    return JSON.stringify(exports.TimeOffStartHalfDay$outboundSchema.parse(timeOffStartHalfDay));
}
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({});
/** @internal */
exports.TimeOff4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOff4$;
(function (TimeOff4$) {
    /** @deprecated use `TimeOff4$inboundSchema` instead. */
    TimeOff4$.inboundSchema = exports.TimeOff4$inboundSchema;
    /** @deprecated use `TimeOff4$outboundSchema` instead. */
    TimeOff4$.outboundSchema = exports.TimeOff4$outboundSchema;
})(TimeOff4$ || (exports.TimeOff4$ = TimeOff4$ = {}));
function timeOff4ToJSON(timeOff4) {
    return JSON.stringify(exports.TimeOff4$outboundSchema.parse(timeOff4));
}
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()),
]);
/** @internal */
exports.TimeOffSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOff4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSourceValue$;
(function (TimeOffSourceValue$) {
    /** @deprecated use `TimeOffSourceValue$inboundSchema` instead. */
    TimeOffSourceValue$.inboundSchema = exports.TimeOffSourceValue$inboundSchema;
    /** @deprecated use `TimeOffSourceValue$outboundSchema` instead. */
    TimeOffSourceValue$.outboundSchema = exports.TimeOffSourceValue$outboundSchema;
})(TimeOffSourceValue$ || (exports.TimeOffSourceValue$ = TimeOffSourceValue$ = {}));
function timeOffSourceValueToJSON(timeOffSourceValue) {
    return JSON.stringify(exports.TimeOffSourceValue$outboundSchema.parse(timeOffSourceValue));
}
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 = z
    .union([
    z.nativeEnum(TimeOffValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffValue$;
(function (TimeOffValue$) {
    /** @deprecated use `TimeOffValue$inboundSchema` instead. */
    TimeOffValue$.inboundSchema = exports.TimeOffValue$inboundSchema;
    /** @deprecated use `TimeOffValue$outboundSchema` instead. */
    TimeOffValue$.outboundSchema = exports.TimeOffValue$outboundSchema;
})(TimeOffValue$ || (exports.TimeOffValue$ = 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",
    });
});
/** @internal */
exports.TimeOffStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOff4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffStatus$;
(function (TimeOffStatus$) {
    /** @deprecated use `TimeOffStatus$inboundSchema` instead. */
    TimeOffStatus$.inboundSchema = exports.TimeOffStatus$inboundSchema;
    /** @deprecated use `TimeOffStatus$outboundSchema` instead. */
    TimeOffStatus$.outboundSchema = exports.TimeOffStatus$outboundSchema;
})(TimeOffStatus$ || (exports.TimeOffStatus$ = TimeOffStatus$ = {}));
function timeOffStatusToJSON(timeOffStatus) {
    return JSON.stringify(exports.TimeOffStatus$outboundSchema.parse(timeOffStatus));
}
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({});
/** @internal */
exports.TimeOffSchemas4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemas4$;
(function (TimeOffSchemas4$) {
    /** @deprecated use `TimeOffSchemas4$inboundSchema` instead. */
    TimeOffSchemas4$.inboundSchema = exports.TimeOffSchemas4$inboundSchema;
    /** @deprecated use `TimeOffSchemas4$outboundSchema` instead. */
    TimeOffSchemas4$.outboundSchema = exports.TimeOffSchemas4$outboundSchema;
})(TimeOffSchemas4$ || (exports.TimeOffSchemas4$ = TimeOffSchemas4$ = {}));
function timeOffSchemas4ToJSON(timeOffSchemas4) {
    return JSON.stringify(exports.TimeOffSchemas4$outboundSchema.parse(timeOffSchemas4));
}
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()),
]);
/** @internal */
exports.TimeOffSchemasSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TimeOffSchemas4$outboundSchema),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasSourceValue$;
(function (TimeOffSchemasSourceValue$) {
    /** @deprecated use `TimeOffSchemasSourceValue$inboundSchema` instead. */
    TimeOffSchemasSourceValue$.inboundSchema = exports.TimeOffSchemasSourceValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasSourceValue$outboundSchema` instead. */
    TimeOffSchemasSourceValue$.outboundSchema = exports.TimeOffSchemasSourceValue$outboundSchema;
})(TimeOffSchemasSourceValue$ || (exports.TimeOffSchemasSourceValue$ = TimeOffSchemasSourceValue$ = {}));
function timeOffSchemasSourceValueToJSON(timeOffSchemasSourceValue) {
    return JSON.stringify(exports.TimeOffSchemasSourceValue$outboundSchema.parse(timeOffSchemasSourceValue));
}
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 = z
    .union([
    z.nativeEnum(TimeOffSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffSchemasValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffSchemasValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffSchemasValue$;
(function (TimeOffSchemasValue$) {
    /** @deprecated use `TimeOffSchemasValue$inboundSchema` instead. */
    TimeOffSchemasValue$.inboundSchema = exports.TimeOffSchemasValue$inboundSchema;
    /** @deprecated use `TimeOffSchemasValue$outboundSchema` instead. */
    TimeOffSchemasValue$.outboundSchema = exports.TimeOffSchemasValue$outboundSchema;
})(TimeOffSchemasValue$ || (exports.TimeOffSchemasValue$ = 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",
    });
});
/** @internal */
exports.TimeOffType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TimeOffSchemas4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffSchemasValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOffType$;
(function (TimeOffType$) {
    /** @deprecated use `TimeOffType$inboundSchema` instead. */
    TimeOffType$.inboundSchema = exports.TimeOffType$inboundSchema;
    /** @deprecated use `TimeOffType$outboundSchema` instead. */
    TimeOffType$.outboundSchema = exports.TimeOffType$outboundSchema;
})(TimeOffType$ || (exports.TimeOffType$ = TimeOffType$ = {}));
function timeOffTypeToJSON(timeOffType) {
    return JSON.stringify(exports.TimeOffType$outboundSchema.parse(timeOffType));
}
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",
    });
});
/** @internal */
exports.TimeOff$outboundSchema = z.object({
    approverId: z.nullable(z.string()).optional(),
    comment: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    duration: z.nullable(z.string()).optional(),
    employeeId: z.nullable(z.string()).optional(),
    endDate: z.nullable(z.string()).optional(),
    endHalfDay: z.nullable(z.union([z.boolean(), exports.TimeOff2$outboundSchema]))
        .optional(),
    id: z.nullable(z.string()).optional(),
    policy: z.nullable(z.lazy(() => exports.Policy$outboundSchema)).optional(),
    reason: z.nullable(z.lazy(() => exports.TimeOffReason$outboundSchema)).optional(),
    remoteApproverId: z.nullable(z.string()).optional(),
    remoteEmployeeId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteTimeOffPolicyId: z.nullable(z.string()).optional(),
    startDate: z.nullable(z.string()).optional(),
    startHalfDay: z.nullable(z.union([z.boolean(), exports.TimeOffSchemas2$outboundSchema])).optional(),
    status: z.nullable(z.lazy(() => exports.TimeOffStatus$outboundSchema)).optional(),
    timeOffPolicyId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TimeOffType$outboundSchema)).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        approverId: "approver_id",
        createdAt: "created_at",
        employeeId: "employee_id",
        endDate: "end_date",
        endHalfDay: "end_half_day",
        remoteApproverId: "remote_approver_id",
        remoteEmployeeId: "remote_employee_id",
        remoteId: "remote_id",
        remoteTimeOffPolicyId: "remote_time_off_policy_id",
        startDate: "start_date",
        startHalfDay: "start_half_day",
        timeOffPolicyId: "time_off_policy_id",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeOff$;
(function (TimeOff$) {
    /** @deprecated use `TimeOff$inboundSchema` instead. */
    TimeOff$.inboundSchema = exports.TimeOff$inboundSchema;
    /** @deprecated use `TimeOff$outboundSchema` instead. */
    TimeOff$.outboundSchema = exports.TimeOff$outboundSchema;
})(TimeOff$ || (exports.TimeOff$ = TimeOff$ = {}));
function timeOffToJSON(timeOff) {
    return JSON.stringify(exports.TimeOff$outboundSchema.parse(timeOff));
}
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