"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.createHRISBenefitFromJSON = exports.createHRISBenefitToJSON = exports.CreateHRISBenefit$ = exports.CreateHRISBenefit$outboundSchema = exports.CreateHRISBenefit$inboundSchema = exports.benefitTypeFromJSON = exports.benefitTypeToJSON = exports.BenefitType$ = exports.BenefitType$outboundSchema = exports.BenefitType$inboundSchema = exports.CreateHRISBenefitValue$ = exports.CreateHRISBenefitValue$outboundSchema = exports.CreateHRISBenefitValue$inboundSchema = exports.createHRISBenefitSourceValueFromJSON = exports.createHRISBenefitSourceValueToJSON = exports.CreateHRISBenefitSourceValue$ = exports.CreateHRISBenefitSourceValue$outboundSchema = exports.CreateHRISBenefitSourceValue$inboundSchema = exports.createHRISBenefit4FromJSON = exports.createHRISBenefit4ToJSON = exports.CreateHRISBenefit4$ = exports.CreateHRISBenefit4$outboundSchema = exports.CreateHRISBenefit4$inboundSchema = exports.CreateHRISBenefitValue = 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 CreateHRISBenefitValue;
(function (CreateHRISBenefitValue) {
    CreateHRISBenefitValue["RetirementSavings"] = "retirement_savings";
    CreateHRISBenefitValue["HealthSavings"] = "health_savings";
    CreateHRISBenefitValue["Other"] = "other";
    CreateHRISBenefitValue["HealthInsurance"] = "health_insurance";
    CreateHRISBenefitValue["Insurance"] = "insurance";
})(CreateHRISBenefitValue || (exports.CreateHRISBenefitValue = CreateHRISBenefitValue = {}));
/** @internal */
exports.CreateHRISBenefit4$inboundSchema = z.object({});
/** @internal */
exports.CreateHRISBenefit4$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 CreateHRISBenefit4$;
(function (CreateHRISBenefit4$) {
    /** @deprecated use `CreateHRISBenefit4$inboundSchema` instead. */
    CreateHRISBenefit4$.inboundSchema = exports.CreateHRISBenefit4$inboundSchema;
    /** @deprecated use `CreateHRISBenefit4$outboundSchema` instead. */
    CreateHRISBenefit4$.outboundSchema = exports.CreateHRISBenefit4$outboundSchema;
})(CreateHRISBenefit4$ || (exports.CreateHRISBenefit4$ = CreateHRISBenefit4$ = {}));
function createHRISBenefit4ToJSON(createHRISBenefit4) {
    return JSON.stringify(exports.CreateHRISBenefit4$outboundSchema.parse(createHRISBenefit4));
}
exports.createHRISBenefit4ToJSON = createHRISBenefit4ToJSON;
function createHRISBenefit4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateHRISBenefit4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateHRISBenefit4' from JSON`);
}
exports.createHRISBenefit4FromJSON = createHRISBenefit4FromJSON;
/** @internal */
exports.CreateHRISBenefitSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.CreateHRISBenefit4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.CreateHRISBenefitSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.CreateHRISBenefit4$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 CreateHRISBenefitSourceValue$;
(function (CreateHRISBenefitSourceValue$) {
    /** @deprecated use `CreateHRISBenefitSourceValue$inboundSchema` instead. */
    CreateHRISBenefitSourceValue$.inboundSchema = exports.CreateHRISBenefitSourceValue$inboundSchema;
    /** @deprecated use `CreateHRISBenefitSourceValue$outboundSchema` instead. */
    CreateHRISBenefitSourceValue$.outboundSchema = exports.CreateHRISBenefitSourceValue$outboundSchema;
})(CreateHRISBenefitSourceValue$ || (exports.CreateHRISBenefitSourceValue$ = CreateHRISBenefitSourceValue$ = {}));
function createHRISBenefitSourceValueToJSON(createHRISBenefitSourceValue) {
    return JSON.stringify(exports.CreateHRISBenefitSourceValue$outboundSchema.parse(createHRISBenefitSourceValue));
}
exports.createHRISBenefitSourceValueToJSON = createHRISBenefitSourceValueToJSON;
function createHRISBenefitSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateHRISBenefitSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateHRISBenefitSourceValue' from JSON`);
}
exports.createHRISBenefitSourceValueFromJSON = createHRISBenefitSourceValueFromJSON;
/** @internal */
exports.CreateHRISBenefitValue$inboundSchema = z
    .union([
    z.nativeEnum(CreateHRISBenefitValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.CreateHRISBenefitValue$outboundSchema = z.union([
    z.nativeEnum(CreateHRISBenefitValue),
    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 CreateHRISBenefitValue$;
(function (CreateHRISBenefitValue$) {
    /** @deprecated use `CreateHRISBenefitValue$inboundSchema` instead. */
    CreateHRISBenefitValue$.inboundSchema = exports.CreateHRISBenefitValue$inboundSchema;
    /** @deprecated use `CreateHRISBenefitValue$outboundSchema` instead. */
    CreateHRISBenefitValue$.outboundSchema = exports.CreateHRISBenefitValue$outboundSchema;
})(CreateHRISBenefitValue$ || (exports.CreateHRISBenefitValue$ = CreateHRISBenefitValue$ = {}));
/** @internal */
exports.BenefitType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.CreateHRISBenefit4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CreateHRISBenefitValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.BenefitType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.CreateHRISBenefit4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CreateHRISBenefitValue$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 BenefitType$;
(function (BenefitType$) {
    /** @deprecated use `BenefitType$inboundSchema` instead. */
    BenefitType$.inboundSchema = exports.BenefitType$inboundSchema;
    /** @deprecated use `BenefitType$outboundSchema` instead. */
    BenefitType$.outboundSchema = exports.BenefitType$outboundSchema;
})(BenefitType$ || (exports.BenefitType$ = BenefitType$ = {}));
function benefitTypeToJSON(benefitType) {
    return JSON.stringify(exports.BenefitType$outboundSchema.parse(benefitType));
}
exports.benefitTypeToJSON = benefitTypeToJSON;
function benefitTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BenefitType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BenefitType' from JSON`);
}
exports.benefitTypeFromJSON = benefitTypeFromJSON;
/** @internal */
exports.CreateHRISBenefit$inboundSchema = z.object({
    benefit_type: z.nullable(z.lazy(() => exports.BenefitType$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(),
    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",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.CreateHRISBenefit$outboundSchema = z.object({
    benefitType: z.nullable(z.lazy(() => exports.BenefitType$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(),
    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",
        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 CreateHRISBenefit$;
(function (CreateHRISBenefit$) {
    /** @deprecated use `CreateHRISBenefit$inboundSchema` instead. */
    CreateHRISBenefit$.inboundSchema = exports.CreateHRISBenefit$inboundSchema;
    /** @deprecated use `CreateHRISBenefit$outboundSchema` instead. */
    CreateHRISBenefit$.outboundSchema = exports.CreateHRISBenefit$outboundSchema;
})(CreateHRISBenefit$ || (exports.CreateHRISBenefit$ = CreateHRISBenefit$ = {}));
function createHRISBenefitToJSON(createHRISBenefit) {
    return JSON.stringify(exports.CreateHRISBenefit$outboundSchema.parse(createHRISBenefit));
}
exports.createHRISBenefitToJSON = createHRISBenefitToJSON;
function createHRISBenefitFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateHRISBenefit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateHRISBenefit' from JSON`);
}
exports.createHRISBenefitFromJSON = createHRISBenefitFromJSON;
//# sourceMappingURL=createhrisbenefit.js.map