"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeOffBalancesSchemasPolicyValue$inboundSchema = exports.timeOffBalancesSchemasPolicySourceValueFromJSON = exports.timeOffBalancesSchemasPolicySourceValueToJSON = exports.TimeOffBalancesSchemasPolicySourceValue$ = exports.TimeOffBalancesSchemasPolicySourceValue$outboundSchema = exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema = exports.timeOffBalancesSchemasPolicy4FromJSON = exports.timeOffBalancesSchemasPolicy4ToJSON = exports.TimeOffBalancesSchemasPolicy4$ = exports.TimeOffBalancesSchemasPolicy4$outboundSchema = exports.TimeOffBalancesSchemasPolicy4$inboundSchema = exports.timeOffBalancesDurationUnitFromJSON = exports.timeOffBalancesDurationUnitToJSON = exports.TimeOffBalancesDurationUnit$ = exports.TimeOffBalancesDurationUnit$outboundSchema = exports.TimeOffBalancesDurationUnit$inboundSchema = exports.TimeOffBalancesSchemasValue$ = exports.TimeOffBalancesSchemasValue$outboundSchema = exports.TimeOffBalancesSchemasValue$inboundSchema = exports.timeOffBalancesSchemasSourceValueFromJSON = exports.timeOffBalancesSchemasSourceValueToJSON = exports.TimeOffBalancesSchemasSourceValue$ = exports.TimeOffBalancesSchemasSourceValue$outboundSchema = exports.TimeOffBalancesSchemasSourceValue$inboundSchema = exports.timeOffBalancesSchemas4FromJSON = exports.timeOffBalancesSchemas4ToJSON = exports.TimeOffBalancesSchemas4$ = exports.TimeOffBalancesSchemas4$outboundSchema = exports.TimeOffBalancesSchemas4$inboundSchema = exports.balanceUnitFromJSON = exports.balanceUnitToJSON = exports.BalanceUnit$ = exports.BalanceUnit$outboundSchema = exports.BalanceUnit$inboundSchema = exports.TimeOffBalancesValue$ = exports.TimeOffBalancesValue$outboundSchema = exports.TimeOffBalancesValue$inboundSchema = exports.timeOffBalancesSourceValueFromJSON = exports.timeOffBalancesSourceValueToJSON = exports.TimeOffBalancesSourceValue$ = exports.TimeOffBalancesSourceValue$outboundSchema = exports.TimeOffBalancesSourceValue$inboundSchema = exports.timeOffBalances4FromJSON = exports.timeOffBalances4ToJSON = exports.TimeOffBalances4$ = exports.TimeOffBalances4$outboundSchema = exports.TimeOffBalances4$inboundSchema = exports.TimeOffBalancesSchemasPolicyValue = exports.TimeOffBalancesSchemasValue = exports.TimeOffBalancesValue = void 0;
exports.timeOffBalancesFromJSON = exports.timeOffBalancesToJSON = exports.TimeOffBalances$ = exports.TimeOffBalances$outboundSchema = exports.TimeOffBalances$inboundSchema = exports.timeOffBalancesPolicyFromJSON = exports.timeOffBalancesPolicyToJSON = exports.TimeOffBalancesPolicy$ = exports.TimeOffBalancesPolicy$outboundSchema = exports.TimeOffBalancesPolicy$inboundSchema = exports.timeOffBalancesTypeFromJSON = exports.timeOffBalancesTypeToJSON = exports.TimeOffBalancesType$ = exports.TimeOffBalancesType$outboundSchema = exports.TimeOffBalancesType$inboundSchema = exports.TimeOffBalancesSchemasPolicyValue$ = exports.TimeOffBalancesSchemasPolicyValue$outboundSchema = void 0;
const z = __importStar(require("zod"));
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");
/**
 * 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 = {}));
/**
 * 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["Paid"] = "paid";
    TimeOffBalancesSchemasPolicyValue["Unpaid"] = "unpaid";
    TimeOffBalancesSchemasPolicyValue["Holiday"] = "holiday";
    TimeOffBalancesSchemasPolicyValue["Vacation"] = "vacation";
    TimeOffBalancesSchemasPolicyValue["Sick"] = "sick";
    TimeOffBalancesSchemasPolicyValue["Personal"] = "personal";
    TimeOffBalancesSchemasPolicyValue["InLieu"] = "in_lieu";
    TimeOffBalancesSchemasPolicyValue["Bereavement"] = "bereavement";
    TimeOffBalancesSchemasPolicyValue["JuryDuty"] = "jury_duty";
    TimeOffBalancesSchemasPolicyValue["UnmappedValue"] = "unmapped_value";
})(TimeOffBalancesSchemasPolicyValue || (exports.TimeOffBalancesSchemasPolicyValue = TimeOffBalancesSchemasPolicyValue = {}));
/** @internal */
exports.TimeOffBalances4$inboundSchema = z.object({});
/** @internal */
exports.TimeOffBalances4$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 TimeOffBalances4$;
(function (TimeOffBalances4$) {
    /** @deprecated use `TimeOffBalances4$inboundSchema` instead. */
    TimeOffBalances4$.inboundSchema = exports.TimeOffBalances4$inboundSchema;
    /** @deprecated use `TimeOffBalances4$outboundSchema` instead. */
    TimeOffBalances4$.outboundSchema = exports.TimeOffBalances4$outboundSchema;
})(TimeOffBalances4$ || (exports.TimeOffBalances4$ = TimeOffBalances4$ = {}));
function timeOffBalances4ToJSON(timeOffBalances4) {
    return JSON.stringify(exports.TimeOffBalances4$outboundSchema.parse(timeOffBalances4));
}
exports.timeOffBalances4ToJSON = timeOffBalances4ToJSON;
function timeOffBalances4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalances4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalances4' from JSON`);
}
exports.timeOffBalances4FromJSON = timeOffBalances4FromJSON;
/** @internal */
exports.TimeOffBalancesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalances4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeOffBalancesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalances4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    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 TimeOffBalancesSourceValue$;
(function (TimeOffBalancesSourceValue$) {
    /** @deprecated use `TimeOffBalancesSourceValue$inboundSchema` instead. */
    TimeOffBalancesSourceValue$.inboundSchema = exports.TimeOffBalancesSourceValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesSourceValue$outboundSchema` instead. */
    TimeOffBalancesSourceValue$.outboundSchema = exports.TimeOffBalancesSourceValue$outboundSchema;
})(TimeOffBalancesSourceValue$ || (exports.TimeOffBalancesSourceValue$ = TimeOffBalancesSourceValue$ = {}));
function timeOffBalancesSourceValueToJSON(timeOffBalancesSourceValue) {
    return JSON.stringify(exports.TimeOffBalancesSourceValue$outboundSchema.parse(timeOffBalancesSourceValue));
}
exports.timeOffBalancesSourceValueToJSON = timeOffBalancesSourceValueToJSON;
function timeOffBalancesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSourceValue' from JSON`);
}
exports.timeOffBalancesSourceValueFromJSON = timeOffBalancesSourceValueFromJSON;
/** @internal */
exports.TimeOffBalancesValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeOffBalancesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffBalancesValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffBalancesValue),
    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 TimeOffBalancesValue$;
(function (TimeOffBalancesValue$) {
    /** @deprecated use `TimeOffBalancesValue$inboundSchema` instead. */
    TimeOffBalancesValue$.inboundSchema = exports.TimeOffBalancesValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesValue$outboundSchema` instead. */
    TimeOffBalancesValue$.outboundSchema = exports.TimeOffBalancesValue$outboundSchema;
})(TimeOffBalancesValue$ || (exports.TimeOffBalancesValue$ = TimeOffBalancesValue$ = {}));
/** @internal */
exports.BalanceUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalances4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.BalanceUnit$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalances4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesValue$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 BalanceUnit$;
(function (BalanceUnit$) {
    /** @deprecated use `BalanceUnit$inboundSchema` instead. */
    BalanceUnit$.inboundSchema = exports.BalanceUnit$inboundSchema;
    /** @deprecated use `BalanceUnit$outboundSchema` instead. */
    BalanceUnit$.outboundSchema = exports.BalanceUnit$outboundSchema;
})(BalanceUnit$ || (exports.BalanceUnit$ = BalanceUnit$ = {}));
function balanceUnitToJSON(balanceUnit) {
    return JSON.stringify(exports.BalanceUnit$outboundSchema.parse(balanceUnit));
}
exports.balanceUnitToJSON = balanceUnitToJSON;
function balanceUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BalanceUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceUnit' from JSON`);
}
exports.balanceUnitFromJSON = balanceUnitFromJSON;
/** @internal */
exports.TimeOffBalancesSchemas4$inboundSchema = z.object({});
/** @internal */
exports.TimeOffBalancesSchemas4$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 TimeOffBalancesSchemas4$;
(function (TimeOffBalancesSchemas4$) {
    /** @deprecated use `TimeOffBalancesSchemas4$inboundSchema` instead. */
    TimeOffBalancesSchemas4$.inboundSchema = exports.TimeOffBalancesSchemas4$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemas4$outboundSchema` instead. */
    TimeOffBalancesSchemas4$.outboundSchema = exports.TimeOffBalancesSchemas4$outboundSchema;
})(TimeOffBalancesSchemas4$ || (exports.TimeOffBalancesSchemas4$ = TimeOffBalancesSchemas4$ = {}));
function timeOffBalancesSchemas4ToJSON(timeOffBalancesSchemas4) {
    return JSON.stringify(exports.TimeOffBalancesSchemas4$outboundSchema.parse(timeOffBalancesSchemas4));
}
exports.timeOffBalancesSchemas4ToJSON = timeOffBalancesSchemas4ToJSON;
function timeOffBalancesSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemas4' from JSON`);
}
exports.timeOffBalancesSchemas4FromJSON = timeOffBalancesSchemas4FromJSON;
/** @internal */
exports.TimeOffBalancesSchemasSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalancesSchemas4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeOffBalancesSchemasSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalancesSchemas4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    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 TimeOffBalancesSchemasSourceValue$;
(function (TimeOffBalancesSchemasSourceValue$) {
    /** @deprecated use `TimeOffBalancesSchemasSourceValue$inboundSchema` instead. */
    TimeOffBalancesSchemasSourceValue$.inboundSchema = exports.TimeOffBalancesSchemasSourceValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemasSourceValue$outboundSchema` instead. */
    TimeOffBalancesSchemasSourceValue$.outboundSchema = exports.TimeOffBalancesSchemasSourceValue$outboundSchema;
})(TimeOffBalancesSchemasSourceValue$ || (exports.TimeOffBalancesSchemasSourceValue$ = TimeOffBalancesSchemasSourceValue$ = {}));
function timeOffBalancesSchemasSourceValueToJSON(timeOffBalancesSchemasSourceValue) {
    return JSON.stringify(exports.TimeOffBalancesSchemasSourceValue$outboundSchema.parse(timeOffBalancesSchemasSourceValue));
}
exports.timeOffBalancesSchemasSourceValueToJSON = timeOffBalancesSchemasSourceValueToJSON;
function timeOffBalancesSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasSourceValue' from JSON`);
}
exports.timeOffBalancesSchemasSourceValueFromJSON = timeOffBalancesSchemasSourceValueFromJSON;
/** @internal */
exports.TimeOffBalancesSchemasValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeOffBalancesSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffBalancesSchemasValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffBalancesSchemasValue),
    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 TimeOffBalancesSchemasValue$;
(function (TimeOffBalancesSchemasValue$) {
    /** @deprecated use `TimeOffBalancesSchemasValue$inboundSchema` instead. */
    TimeOffBalancesSchemasValue$.inboundSchema = exports.TimeOffBalancesSchemasValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemasValue$outboundSchema` instead. */
    TimeOffBalancesSchemasValue$.outboundSchema = exports.TimeOffBalancesSchemasValue$outboundSchema;
})(TimeOffBalancesSchemasValue$ || (exports.TimeOffBalancesSchemasValue$ = TimeOffBalancesSchemasValue$ = {}));
/** @internal */
exports.TimeOffBalancesDurationUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalancesSchemas4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TimeOffBalancesDurationUnit$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalancesSchemas4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasValue$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 TimeOffBalancesDurationUnit$;
(function (TimeOffBalancesDurationUnit$) {
    /** @deprecated use `TimeOffBalancesDurationUnit$inboundSchema` instead. */
    TimeOffBalancesDurationUnit$.inboundSchema = exports.TimeOffBalancesDurationUnit$inboundSchema;
    /** @deprecated use `TimeOffBalancesDurationUnit$outboundSchema` instead. */
    TimeOffBalancesDurationUnit$.outboundSchema = exports.TimeOffBalancesDurationUnit$outboundSchema;
})(TimeOffBalancesDurationUnit$ || (exports.TimeOffBalancesDurationUnit$ = TimeOffBalancesDurationUnit$ = {}));
function timeOffBalancesDurationUnitToJSON(timeOffBalancesDurationUnit) {
    return JSON.stringify(exports.TimeOffBalancesDurationUnit$outboundSchema.parse(timeOffBalancesDurationUnit));
}
exports.timeOffBalancesDurationUnitToJSON = timeOffBalancesDurationUnitToJSON;
function timeOffBalancesDurationUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesDurationUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesDurationUnit' from JSON`);
}
exports.timeOffBalancesDurationUnitFromJSON = timeOffBalancesDurationUnitFromJSON;
/** @internal */
exports.TimeOffBalancesSchemasPolicy4$inboundSchema = z.object({});
/** @internal */
exports.TimeOffBalancesSchemasPolicy4$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 TimeOffBalancesSchemasPolicy4$;
(function (TimeOffBalancesSchemasPolicy4$) {
    /** @deprecated use `TimeOffBalancesSchemasPolicy4$inboundSchema` instead. */
    TimeOffBalancesSchemasPolicy4$.inboundSchema = exports.TimeOffBalancesSchemasPolicy4$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemasPolicy4$outboundSchema` instead. */
    TimeOffBalancesSchemasPolicy4$.outboundSchema = exports.TimeOffBalancesSchemasPolicy4$outboundSchema;
})(TimeOffBalancesSchemasPolicy4$ || (exports.TimeOffBalancesSchemasPolicy4$ = TimeOffBalancesSchemasPolicy4$ = {}));
function timeOffBalancesSchemasPolicy4ToJSON(timeOffBalancesSchemasPolicy4) {
    return JSON.stringify(exports.TimeOffBalancesSchemasPolicy4$outboundSchema.parse(timeOffBalancesSchemasPolicy4));
}
exports.timeOffBalancesSchemasPolicy4ToJSON = timeOffBalancesSchemasPolicy4ToJSON;
function timeOffBalancesSchemasPolicy4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasPolicy4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasPolicy4' from JSON`);
}
exports.timeOffBalancesSchemasPolicy4FromJSON = timeOffBalancesSchemasPolicy4FromJSON;
/** @internal */
exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeOffBalancesSchemasPolicySourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    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 TimeOffBalancesSchemasPolicySourceValue$;
(function (TimeOffBalancesSchemasPolicySourceValue$) {
    /** @deprecated use `TimeOffBalancesSchemasPolicySourceValue$inboundSchema` instead. */
    TimeOffBalancesSchemasPolicySourceValue$.inboundSchema = exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemasPolicySourceValue$outboundSchema` instead. */
    TimeOffBalancesSchemasPolicySourceValue$.outboundSchema = exports.TimeOffBalancesSchemasPolicySourceValue$outboundSchema;
})(TimeOffBalancesSchemasPolicySourceValue$ || (exports.TimeOffBalancesSchemasPolicySourceValue$ = TimeOffBalancesSchemasPolicySourceValue$ = {}));
function timeOffBalancesSchemasPolicySourceValueToJSON(timeOffBalancesSchemasPolicySourceValue) {
    return JSON.stringify(exports.TimeOffBalancesSchemasPolicySourceValue$outboundSchema.parse(timeOffBalancesSchemasPolicySourceValue));
}
exports.timeOffBalancesSchemasPolicySourceValueToJSON = timeOffBalancesSchemasPolicySourceValueToJSON;
function timeOffBalancesSchemasPolicySourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesSchemasPolicySourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesSchemasPolicySourceValue' from JSON`);
}
exports.timeOffBalancesSchemasPolicySourceValueFromJSON = timeOffBalancesSchemasPolicySourceValueFromJSON;
/** @internal */
exports.TimeOffBalancesSchemasPolicyValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeOffBalancesSchemasPolicyValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffBalancesSchemasPolicyValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffBalancesSchemasPolicyValue),
    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 TimeOffBalancesSchemasPolicyValue$;
(function (TimeOffBalancesSchemasPolicyValue$) {
    /** @deprecated use `TimeOffBalancesSchemasPolicyValue$inboundSchema` instead. */
    TimeOffBalancesSchemasPolicyValue$.inboundSchema = exports.TimeOffBalancesSchemasPolicyValue$inboundSchema;
    /** @deprecated use `TimeOffBalancesSchemasPolicyValue$outboundSchema` instead. */
    TimeOffBalancesSchemasPolicyValue$.outboundSchema = exports.TimeOffBalancesSchemasPolicyValue$outboundSchema;
})(TimeOffBalancesSchemasPolicyValue$ || (exports.TimeOffBalancesSchemasPolicyValue$ = TimeOffBalancesSchemasPolicyValue$ = {}));
/** @internal */
exports.TimeOffBalancesType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasPolicyValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TimeOffBalancesType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeOffBalancesSchemasPolicy4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffBalancesSchemasPolicyValue$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 TimeOffBalancesType$;
(function (TimeOffBalancesType$) {
    /** @deprecated use `TimeOffBalancesType$inboundSchema` instead. */
    TimeOffBalancesType$.inboundSchema = exports.TimeOffBalancesType$inboundSchema;
    /** @deprecated use `TimeOffBalancesType$outboundSchema` instead. */
    TimeOffBalancesType$.outboundSchema = exports.TimeOffBalancesType$outboundSchema;
})(TimeOffBalancesType$ || (exports.TimeOffBalancesType$ = TimeOffBalancesType$ = {}));
function timeOffBalancesTypeToJSON(timeOffBalancesType) {
    return JSON.stringify(exports.TimeOffBalancesType$outboundSchema.parse(timeOffBalancesType));
}
exports.timeOffBalancesTypeToJSON = timeOffBalancesTypeToJSON;
function timeOffBalancesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesType' from JSON`);
}
exports.timeOffBalancesTypeFromJSON = timeOffBalancesTypeFromJSON;
/** @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",
    });
});
/** @internal */
exports.TimeOffBalancesPolicy$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.TimeOffBalancesDurationUnit$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.TimeOffBalancesType$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 TimeOffBalancesPolicy$;
(function (TimeOffBalancesPolicy$) {
    /** @deprecated use `TimeOffBalancesPolicy$inboundSchema` instead. */
    TimeOffBalancesPolicy$.inboundSchema = exports.TimeOffBalancesPolicy$inboundSchema;
    /** @deprecated use `TimeOffBalancesPolicy$outboundSchema` instead. */
    TimeOffBalancesPolicy$.outboundSchema = exports.TimeOffBalancesPolicy$outboundSchema;
})(TimeOffBalancesPolicy$ || (exports.TimeOffBalancesPolicy$ = TimeOffBalancesPolicy$ = {}));
function timeOffBalancesPolicyToJSON(timeOffBalancesPolicy) {
    return JSON.stringify(exports.TimeOffBalancesPolicy$outboundSchema.parse(timeOffBalancesPolicy));
}
exports.timeOffBalancesPolicyToJSON = timeOffBalancesPolicyToJSON;
function timeOffBalancesPolicyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalancesPolicy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalancesPolicy' from JSON`);
}
exports.timeOffBalancesPolicyFromJSON = timeOffBalancesPolicyFromJSON;
/** @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(),
    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",
        "policy_id": "policyId",
        "remote_employee_id": "remoteEmployeeId",
        "remote_id": "remoteId",
        "remote_policy_id": "remotePolicyId",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.TimeOffBalances$outboundSchema = z.object({
    balanceExpiryDate: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    balanceStartDate: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    balanceUnit: z.nullable(z.lazy(() => exports.BalanceUnit$outboundSchema)).optional(),
    currentBalance: z.nullable(z.number()).optional(),
    employeeId: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    initialBalance: z.nullable(z.number()).optional(),
    policy: z.nullable(z.lazy(() => exports.TimeOffBalancesPolicy$outboundSchema))
        .optional(),
    policyId: z.nullable(z.string()).optional(),
    remoteEmployeeId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remotePolicyId: z.nullable(z.string()).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        balanceExpiryDate: "balance_expiry_date",
        balanceStartDate: "balance_start_date",
        balanceUnit: "balance_unit",
        currentBalance: "current_balance",
        employeeId: "employee_id",
        initialBalance: "initial_balance",
        policyId: "policy_id",
        remoteEmployeeId: "remote_employee_id",
        remoteId: "remote_id",
        remotePolicyId: "remote_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 TimeOffBalances$;
(function (TimeOffBalances$) {
    /** @deprecated use `TimeOffBalances$inboundSchema` instead. */
    TimeOffBalances$.inboundSchema = exports.TimeOffBalances$inboundSchema;
    /** @deprecated use `TimeOffBalances$outboundSchema` instead. */
    TimeOffBalances$.outboundSchema = exports.TimeOffBalances$outboundSchema;
})(TimeOffBalances$ || (exports.TimeOffBalances$ = TimeOffBalances$ = {}));
function timeOffBalancesToJSON(timeOffBalances) {
    return JSON.stringify(exports.TimeOffBalances$outboundSchema.parse(timeOffBalances));
}
exports.timeOffBalancesToJSON = timeOffBalancesToJSON;
function timeOffBalancesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffBalances$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffBalances' from JSON`);
}
exports.timeOffBalancesFromJSON = timeOffBalancesFromJSON;
//# sourceMappingURL=timeoffbalances.js.map