"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.timeOffPoliciesFromJSON = exports.timeOffPoliciesToJSON = exports.TimeOffPolicies$ = exports.TimeOffPolicies$outboundSchema = exports.TimeOffPolicies$inboundSchema = exports.timeOffPoliciesTypeFromJSON = exports.timeOffPoliciesTypeToJSON = exports.TimeOffPoliciesType$ = exports.TimeOffPoliciesType$outboundSchema = exports.TimeOffPoliciesType$inboundSchema = exports.TimeOffPoliciesSchemasValue$ = exports.TimeOffPoliciesSchemasValue$outboundSchema = exports.TimeOffPoliciesSchemasValue$inboundSchema = exports.timeOffPoliciesSchemasSourceValueFromJSON = exports.timeOffPoliciesSchemasSourceValueToJSON = exports.TimeOffPoliciesSchemasSourceValue$ = exports.TimeOffPoliciesSchemasSourceValue$outboundSchema = exports.TimeOffPoliciesSchemasSourceValue$inboundSchema = exports.timeOffPoliciesSchemas4FromJSON = exports.timeOffPoliciesSchemas4ToJSON = exports.TimeOffPoliciesSchemas4$ = exports.TimeOffPoliciesSchemas4$outboundSchema = exports.TimeOffPoliciesSchemas4$inboundSchema = exports.durationUnitFromJSON = exports.durationUnitToJSON = exports.DurationUnit$ = exports.DurationUnit$outboundSchema = exports.DurationUnit$inboundSchema = exports.TimeOffPoliciesValue$ = exports.TimeOffPoliciesValue$outboundSchema = exports.TimeOffPoliciesValue$inboundSchema = exports.timeOffPoliciesSourceValueFromJSON = exports.timeOffPoliciesSourceValueToJSON = exports.TimeOffPoliciesSourceValue$ = exports.TimeOffPoliciesSourceValue$outboundSchema = exports.TimeOffPoliciesSourceValue$inboundSchema = exports.timeOffPolicies4FromJSON = exports.timeOffPolicies4ToJSON = exports.TimeOffPolicies4$ = exports.TimeOffPolicies4$outboundSchema = exports.TimeOffPolicies4$inboundSchema = exports.TimeOffPoliciesSchemasValue = exports.TimeOffPoliciesValue = 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 TimeOffPoliciesValue;
(function (TimeOffPoliciesValue) {
    TimeOffPoliciesValue["Minutes"] = "minutes";
    TimeOffPoliciesValue["Hours"] = "hours";
    TimeOffPoliciesValue["Days"] = "days";
    TimeOffPoliciesValue["Weeks"] = "weeks";
    TimeOffPoliciesValue["Months"] = "months";
    TimeOffPoliciesValue["Years"] = "years";
    TimeOffPoliciesValue["Unknown"] = "unknown";
    TimeOffPoliciesValue["UnmappedValue"] = "unmapped_value";
})(TimeOffPoliciesValue || (exports.TimeOffPoliciesValue = TimeOffPoliciesValue = {}));
/**
 * The unified value for the type of the time off policy. If the provider does not specify this unit, the value will be set to unmapped_value
 */
var TimeOffPoliciesSchemasValue;
(function (TimeOffPoliciesSchemasValue) {
    TimeOffPoliciesSchemasValue["Paid"] = "paid";
    TimeOffPoliciesSchemasValue["Unpaid"] = "unpaid";
    TimeOffPoliciesSchemasValue["Holiday"] = "holiday";
    TimeOffPoliciesSchemasValue["Vacation"] = "vacation";
    TimeOffPoliciesSchemasValue["Sick"] = "sick";
    TimeOffPoliciesSchemasValue["Personal"] = "personal";
    TimeOffPoliciesSchemasValue["InLieu"] = "in_lieu";
    TimeOffPoliciesSchemasValue["Bereavement"] = "bereavement";
    TimeOffPoliciesSchemasValue["JuryDuty"] = "jury_duty";
    TimeOffPoliciesSchemasValue["UnmappedValue"] = "unmapped_value";
})(TimeOffPoliciesSchemasValue || (exports.TimeOffPoliciesSchemasValue = TimeOffPoliciesSchemasValue = {}));
/** @internal */
exports.TimeOffPolicies4$inboundSchema = z.object({});
/** @internal */
exports.TimeOffPolicies4$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 TimeOffPolicies4$;
(function (TimeOffPolicies4$) {
    /** @deprecated use `TimeOffPolicies4$inboundSchema` instead. */
    TimeOffPolicies4$.inboundSchema = exports.TimeOffPolicies4$inboundSchema;
    /** @deprecated use `TimeOffPolicies4$outboundSchema` instead. */
    TimeOffPolicies4$.outboundSchema = exports.TimeOffPolicies4$outboundSchema;
})(TimeOffPolicies4$ || (exports.TimeOffPolicies4$ = TimeOffPolicies4$ = {}));
function timeOffPolicies4ToJSON(timeOffPolicies4) {
    return JSON.stringify(exports.TimeOffPolicies4$outboundSchema.parse(timeOffPolicies4));
}
exports.timeOffPolicies4ToJSON = timeOffPolicies4ToJSON;
function timeOffPolicies4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPolicies4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPolicies4' from JSON`);
}
exports.timeOffPolicies4FromJSON = timeOffPolicies4FromJSON;
/** @internal */
exports.TimeOffPoliciesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeOffPolicies4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeOffPoliciesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeOffPolicies4$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 TimeOffPoliciesSourceValue$;
(function (TimeOffPoliciesSourceValue$) {
    /** @deprecated use `TimeOffPoliciesSourceValue$inboundSchema` instead. */
    TimeOffPoliciesSourceValue$.inboundSchema = exports.TimeOffPoliciesSourceValue$inboundSchema;
    /** @deprecated use `TimeOffPoliciesSourceValue$outboundSchema` instead. */
    TimeOffPoliciesSourceValue$.outboundSchema = exports.TimeOffPoliciesSourceValue$outboundSchema;
})(TimeOffPoliciesSourceValue$ || (exports.TimeOffPoliciesSourceValue$ = TimeOffPoliciesSourceValue$ = {}));
function timeOffPoliciesSourceValueToJSON(timeOffPoliciesSourceValue) {
    return JSON.stringify(exports.TimeOffPoliciesSourceValue$outboundSchema.parse(timeOffPoliciesSourceValue));
}
exports.timeOffPoliciesSourceValueToJSON = timeOffPoliciesSourceValueToJSON;
function timeOffPoliciesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSourceValue' from JSON`);
}
exports.timeOffPoliciesSourceValueFromJSON = timeOffPoliciesSourceValueFromJSON;
/** @internal */
exports.TimeOffPoliciesValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeOffPoliciesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffPoliciesValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffPoliciesValue),
    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 TimeOffPoliciesValue$;
(function (TimeOffPoliciesValue$) {
    /** @deprecated use `TimeOffPoliciesValue$inboundSchema` instead. */
    TimeOffPoliciesValue$.inboundSchema = exports.TimeOffPoliciesValue$inboundSchema;
    /** @deprecated use `TimeOffPoliciesValue$outboundSchema` instead. */
    TimeOffPoliciesValue$.outboundSchema = exports.TimeOffPoliciesValue$outboundSchema;
})(TimeOffPoliciesValue$ || (exports.TimeOffPoliciesValue$ = TimeOffPoliciesValue$ = {}));
/** @internal */
exports.DurationUnit$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeOffPolicies4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.DurationUnit$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeOffPolicies4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesValue$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 DurationUnit$;
(function (DurationUnit$) {
    /** @deprecated use `DurationUnit$inboundSchema` instead. */
    DurationUnit$.inboundSchema = exports.DurationUnit$inboundSchema;
    /** @deprecated use `DurationUnit$outboundSchema` instead. */
    DurationUnit$.outboundSchema = exports.DurationUnit$outboundSchema;
})(DurationUnit$ || (exports.DurationUnit$ = DurationUnit$ = {}));
function durationUnitToJSON(durationUnit) {
    return JSON.stringify(exports.DurationUnit$outboundSchema.parse(durationUnit));
}
exports.durationUnitToJSON = durationUnitToJSON;
function durationUnitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DurationUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DurationUnit' from JSON`);
}
exports.durationUnitFromJSON = durationUnitFromJSON;
/** @internal */
exports.TimeOffPoliciesSchemas4$inboundSchema = z.object({});
/** @internal */
exports.TimeOffPoliciesSchemas4$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 TimeOffPoliciesSchemas4$;
(function (TimeOffPoliciesSchemas4$) {
    /** @deprecated use `TimeOffPoliciesSchemas4$inboundSchema` instead. */
    TimeOffPoliciesSchemas4$.inboundSchema = exports.TimeOffPoliciesSchemas4$inboundSchema;
    /** @deprecated use `TimeOffPoliciesSchemas4$outboundSchema` instead. */
    TimeOffPoliciesSchemas4$.outboundSchema = exports.TimeOffPoliciesSchemas4$outboundSchema;
})(TimeOffPoliciesSchemas4$ || (exports.TimeOffPoliciesSchemas4$ = TimeOffPoliciesSchemas4$ = {}));
function timeOffPoliciesSchemas4ToJSON(timeOffPoliciesSchemas4) {
    return JSON.stringify(exports.TimeOffPoliciesSchemas4$outboundSchema.parse(timeOffPoliciesSchemas4));
}
exports.timeOffPoliciesSchemas4ToJSON = timeOffPoliciesSchemas4ToJSON;
function timeOffPoliciesSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSchemas4' from JSON`);
}
exports.timeOffPoliciesSchemas4FromJSON = timeOffPoliciesSchemas4FromJSON;
/** @internal */
exports.TimeOffPoliciesSchemasSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeOffPoliciesSchemas4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeOffPoliciesSchemasSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeOffPoliciesSchemas4$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 TimeOffPoliciesSchemasSourceValue$;
(function (TimeOffPoliciesSchemasSourceValue$) {
    /** @deprecated use `TimeOffPoliciesSchemasSourceValue$inboundSchema` instead. */
    TimeOffPoliciesSchemasSourceValue$.inboundSchema = exports.TimeOffPoliciesSchemasSourceValue$inboundSchema;
    /** @deprecated use `TimeOffPoliciesSchemasSourceValue$outboundSchema` instead. */
    TimeOffPoliciesSchemasSourceValue$.outboundSchema = exports.TimeOffPoliciesSchemasSourceValue$outboundSchema;
})(TimeOffPoliciesSchemasSourceValue$ || (exports.TimeOffPoliciesSchemasSourceValue$ = TimeOffPoliciesSchemasSourceValue$ = {}));
function timeOffPoliciesSchemasSourceValueToJSON(timeOffPoliciesSchemasSourceValue) {
    return JSON.stringify(exports.TimeOffPoliciesSchemasSourceValue$outboundSchema.parse(timeOffPoliciesSchemasSourceValue));
}
exports.timeOffPoliciesSchemasSourceValueToJSON = timeOffPoliciesSchemasSourceValueToJSON;
function timeOffPoliciesSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesSchemasSourceValue' from JSON`);
}
exports.timeOffPoliciesSchemasSourceValueFromJSON = timeOffPoliciesSchemasSourceValueFromJSON;
/** @internal */
exports.TimeOffPoliciesSchemasValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeOffPoliciesSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeOffPoliciesSchemasValue$outboundSchema = z.union([
    z.nativeEnum(TimeOffPoliciesSchemasValue),
    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 TimeOffPoliciesSchemasValue$;
(function (TimeOffPoliciesSchemasValue$) {
    /** @deprecated use `TimeOffPoliciesSchemasValue$inboundSchema` instead. */
    TimeOffPoliciesSchemasValue$.inboundSchema = exports.TimeOffPoliciesSchemasValue$inboundSchema;
    /** @deprecated use `TimeOffPoliciesSchemasValue$outboundSchema` instead. */
    TimeOffPoliciesSchemasValue$.outboundSchema = exports.TimeOffPoliciesSchemasValue$outboundSchema;
})(TimeOffPoliciesSchemasValue$ || (exports.TimeOffPoliciesSchemasValue$ = TimeOffPoliciesSchemasValue$ = {}));
/** @internal */
exports.TimeOffPoliciesType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeOffPoliciesSchemas4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TimeOffPoliciesType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeOffPoliciesSchemas4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeOffPoliciesSchemasValue$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 TimeOffPoliciesType$;
(function (TimeOffPoliciesType$) {
    /** @deprecated use `TimeOffPoliciesType$inboundSchema` instead. */
    TimeOffPoliciesType$.inboundSchema = exports.TimeOffPoliciesType$inboundSchema;
    /** @deprecated use `TimeOffPoliciesType$outboundSchema` instead. */
    TimeOffPoliciesType$.outboundSchema = exports.TimeOffPoliciesType$outboundSchema;
})(TimeOffPoliciesType$ || (exports.TimeOffPoliciesType$ = TimeOffPoliciesType$ = {}));
function timeOffPoliciesTypeToJSON(timeOffPoliciesType) {
    return JSON.stringify(exports.TimeOffPoliciesType$outboundSchema.parse(timeOffPoliciesType));
}
exports.timeOffPoliciesTypeToJSON = timeOffPoliciesTypeToJSON;
function timeOffPoliciesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPoliciesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPoliciesType' from JSON`);
}
exports.timeOffPoliciesTypeFromJSON = timeOffPoliciesTypeFromJSON;
/** @internal */
exports.TimeOffPolicies$inboundSchema = z.object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    duration_unit: z.nullable(z.lazy(() => exports.DurationUnit$inboundSchema))
        .optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    reasons: z.nullable(z.array(reason_js_1.Reason$inboundSchema)).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TimeOffPoliciesType$inboundSchema)).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "duration_unit": "durationUnit",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.TimeOffPolicies$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.DurationUnit$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.TimeOffPoliciesType$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 TimeOffPolicies$;
(function (TimeOffPolicies$) {
    /** @deprecated use `TimeOffPolicies$inboundSchema` instead. */
    TimeOffPolicies$.inboundSchema = exports.TimeOffPolicies$inboundSchema;
    /** @deprecated use `TimeOffPolicies$outboundSchema` instead. */
    TimeOffPolicies$.outboundSchema = exports.TimeOffPolicies$outboundSchema;
})(TimeOffPolicies$ || (exports.TimeOffPolicies$ = TimeOffPolicies$ = {}));
function timeOffPoliciesToJSON(timeOffPolicies) {
    return JSON.stringify(exports.TimeOffPolicies$outboundSchema.parse(timeOffPolicies));
}
exports.timeOffPoliciesToJSON = timeOffPoliciesToJSON;
function timeOffPoliciesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffPolicies$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffPolicies' from JSON`);
}
exports.timeOffPoliciesFromJSON = timeOffPoliciesFromJSON;
//# sourceMappingURL=timeoffpolicies.js.map