"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.hrisBenefitFromJSON = exports.hrisBenefitToJSON = exports.HRISBenefit$ = exports.HRISBenefit$outboundSchema = exports.HRISBenefit$inboundSchema = exports.hrisBenefitBenefitTypeFromJSON = exports.hrisBenefitBenefitTypeToJSON = exports.HRISBenefitBenefitType$ = exports.HRISBenefitBenefitType$outboundSchema = exports.HRISBenefitBenefitType$inboundSchema = exports.HRISBenefitValue$ = exports.HRISBenefitValue$outboundSchema = exports.HRISBenefitValue$inboundSchema = exports.hrisBenefitSourceValueFromJSON = exports.hrisBenefitSourceValueToJSON = exports.HRISBenefitSourceValue$ = exports.HRISBenefitSourceValue$outboundSchema = exports.HRISBenefitSourceValue$inboundSchema = exports.hrisBenefit4FromJSON = exports.hrisBenefit4ToJSON = exports.HRISBenefit4$ = exports.HRISBenefit4$outboundSchema = exports.HRISBenefit4$inboundSchema = exports.HRISBenefitValue = 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");
/**
 * The type of the benefit
 */
var HRISBenefitValue;
(function (HRISBenefitValue) {
    HRISBenefitValue["RetirementSavings"] = "retirement_savings";
    HRISBenefitValue["HealthSavings"] = "health_savings";
    HRISBenefitValue["Other"] = "other";
    HRISBenefitValue["HealthInsurance"] = "health_insurance";
    HRISBenefitValue["Insurance"] = "insurance";
})(HRISBenefitValue || (exports.HRISBenefitValue = HRISBenefitValue = {}));
/** @internal */
exports.HRISBenefit4$inboundSchema = z.object({});
/** @internal */
exports.HRISBenefit4$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 HRISBenefit4$;
(function (HRISBenefit4$) {
    /** @deprecated use `HRISBenefit4$inboundSchema` instead. */
    HRISBenefit4$.inboundSchema = exports.HRISBenefit4$inboundSchema;
    /** @deprecated use `HRISBenefit4$outboundSchema` instead. */
    HRISBenefit4$.outboundSchema = exports.HRISBenefit4$outboundSchema;
})(HRISBenefit4$ || (exports.HRISBenefit4$ = HRISBenefit4$ = {}));
function hrisBenefit4ToJSON(hrisBenefit4) {
    return JSON.stringify(exports.HRISBenefit4$outboundSchema.parse(hrisBenefit4));
}
exports.hrisBenefit4ToJSON = hrisBenefit4ToJSON;
function hrisBenefit4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HRISBenefit4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HRISBenefit4' from JSON`);
}
exports.hrisBenefit4FromJSON = hrisBenefit4FromJSON;
/** @internal */
exports.HRISBenefitSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.HRISBenefit4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.HRISBenefitSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.HRISBenefit4$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 HRISBenefitSourceValue$;
(function (HRISBenefitSourceValue$) {
    /** @deprecated use `HRISBenefitSourceValue$inboundSchema` instead. */
    HRISBenefitSourceValue$.inboundSchema = exports.HRISBenefitSourceValue$inboundSchema;
    /** @deprecated use `HRISBenefitSourceValue$outboundSchema` instead. */
    HRISBenefitSourceValue$.outboundSchema = exports.HRISBenefitSourceValue$outboundSchema;
})(HRISBenefitSourceValue$ || (exports.HRISBenefitSourceValue$ = HRISBenefitSourceValue$ = {}));
function hrisBenefitSourceValueToJSON(hrisBenefitSourceValue) {
    return JSON.stringify(exports.HRISBenefitSourceValue$outboundSchema.parse(hrisBenefitSourceValue));
}
exports.hrisBenefitSourceValueToJSON = hrisBenefitSourceValueToJSON;
function hrisBenefitSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HRISBenefitSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HRISBenefitSourceValue' from JSON`);
}
exports.hrisBenefitSourceValueFromJSON = hrisBenefitSourceValueFromJSON;
/** @internal */
exports.HRISBenefitValue$inboundSchema = z
    .union([
    z.nativeEnum(HRISBenefitValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.HRISBenefitValue$outboundSchema = z.union([
    z.nativeEnum(HRISBenefitValue),
    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 HRISBenefitValue$;
(function (HRISBenefitValue$) {
    /** @deprecated use `HRISBenefitValue$inboundSchema` instead. */
    HRISBenefitValue$.inboundSchema = exports.HRISBenefitValue$inboundSchema;
    /** @deprecated use `HRISBenefitValue$outboundSchema` instead. */
    HRISBenefitValue$.outboundSchema = exports.HRISBenefitValue$outboundSchema;
})(HRISBenefitValue$ || (exports.HRISBenefitValue$ = HRISBenefitValue$ = {}));
/** @internal */
exports.HRISBenefitBenefitType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.HRISBenefit4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.HRISBenefitValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.HRISBenefitBenefitType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.HRISBenefit4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.HRISBenefitValue$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 HRISBenefitBenefitType$;
(function (HRISBenefitBenefitType$) {
    /** @deprecated use `HRISBenefitBenefitType$inboundSchema` instead. */
    HRISBenefitBenefitType$.inboundSchema = exports.HRISBenefitBenefitType$inboundSchema;
    /** @deprecated use `HRISBenefitBenefitType$outboundSchema` instead. */
    HRISBenefitBenefitType$.outboundSchema = exports.HRISBenefitBenefitType$outboundSchema;
})(HRISBenefitBenefitType$ || (exports.HRISBenefitBenefitType$ = HRISBenefitBenefitType$ = {}));
function hrisBenefitBenefitTypeToJSON(hrisBenefitBenefitType) {
    return JSON.stringify(exports.HRISBenefitBenefitType$outboundSchema.parse(hrisBenefitBenefitType));
}
exports.hrisBenefitBenefitTypeToJSON = hrisBenefitBenefitTypeToJSON;
function hrisBenefitBenefitTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HRISBenefitBenefitType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HRISBenefitBenefitType' from JSON`);
}
exports.hrisBenefitBenefitTypeFromJSON = hrisBenefitBenefitTypeFromJSON;
/** @internal */
exports.HRISBenefit$inboundSchema = z.object({
    benefit_type: z.nullable(z.lazy(() => exports.HRISBenefitBenefitType$inboundSchema))
        .optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    provider: z.nullable(z.string()).optional(),
    remote_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, {
        "benefit_type": "benefitType",
        "created_at": "createdAt",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.HRISBenefit$outboundSchema = z.object({
    benefitType: z.nullable(z.lazy(() => exports.HRISBenefitBenefitType$outboundSchema))
        .optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    provider: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        benefitType: "benefit_type",
        createdAt: "created_at",
        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 HRISBenefit$;
(function (HRISBenefit$) {
    /** @deprecated use `HRISBenefit$inboundSchema` instead. */
    HRISBenefit$.inboundSchema = exports.HRISBenefit$inboundSchema;
    /** @deprecated use `HRISBenefit$outboundSchema` instead. */
    HRISBenefit$.outboundSchema = exports.HRISBenefit$outboundSchema;
})(HRISBenefit$ || (exports.HRISBenefit$ = HRISBenefit$ = {}));
function hrisBenefitToJSON(hrisBenefit) {
    return JSON.stringify(exports.HRISBenefit$outboundSchema.parse(hrisBenefit));
}
exports.hrisBenefitToJSON = hrisBenefitToJSON;
function hrisBenefitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HRISBenefit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HRISBenefit' from JSON`);
}
exports.hrisBenefitFromJSON = hrisBenefitFromJSON;
//# sourceMappingURL=hrisbenefit.js.map