"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.TimeOffRequestInput$outboundSchema = exports.TimeOffRequest$inboundSchema = exports.Notes$outboundSchema = exports.Notes$inboundSchema = exports.Units$outboundSchema = exports.Units$inboundSchema = exports.RequestType$outboundSchema = exports.RequestType$inboundSchema = exports.TimeOffRequestStatusStatus$outboundSchema = exports.TimeOffRequestStatusStatus$inboundSchema = exports.Units = exports.RequestType = exports.TimeOffRequestStatusStatus = void 0;
exports.notesToJSON = notesToJSON;
exports.notesFromJSON = notesFromJSON;
exports.timeOffRequestFromJSON = timeOffRequestFromJSON;
exports.timeOffRequestInputToJSON = timeOffRequestInputToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
/**
 * The status of the time off request.
 */
exports.TimeOffRequestStatusStatus = {
    Requested: "requested",
    Approved: "approved",
    Declined: "declined",
    Cancelled: "cancelled",
    Deleted: "deleted",
    Other: "other",
};
/**
 * The type of request
 */
exports.RequestType = {
    Vacation: "vacation",
    Sick: "sick",
    Personal: "personal",
    JuryDuty: "jury_duty",
    Volunteer: "volunteer",
    Bereavement: "bereavement",
    Other: "other",
};
/**
 * The unit of time off requested. Possible values include: `hours`, `days`, or `other`.
 */
exports.Units = {
    Days: "days",
    Hours: "hours",
    Other: "other",
};
/** @internal */
exports.TimeOffRequestStatusStatus$inboundSchema = z.nativeEnum(exports.TimeOffRequestStatusStatus);
/** @internal */
exports.TimeOffRequestStatusStatus$outboundSchema = exports.TimeOffRequestStatusStatus$inboundSchema;
/** @internal */
exports.RequestType$inboundSchema = z
    .nativeEnum(exports.RequestType);
/** @internal */
exports.RequestType$outboundSchema = exports.RequestType$inboundSchema;
/** @internal */
exports.Units$inboundSchema = z.nativeEnum(exports.Units);
/** @internal */
exports.Units$outboundSchema = exports.Units$inboundSchema;
/** @internal */
exports.Notes$inboundSchema = z
    .object({
    employee: z.nullable(z.string()).optional(),
    manager: z.nullable(z.string()).optional(),
});
/** @internal */
exports.Notes$outboundSchema = z.object({
    employee: z.nullable(z.string()).optional(),
    manager: z.nullable(z.string()).optional(),
});
function notesToJSON(notes) {
    return JSON.stringify(exports.Notes$outboundSchema.parse(notes));
}
function notesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Notes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Notes' from JSON`);
}
/** @internal */
exports.TimeOffRequest$inboundSchema = z.object({
    id: z.string().optional(),
    employee_id: z.nullable(z.string()).optional(),
    policy_id: z.nullable(z.string()).optional(),
    status: z.nullable(exports.TimeOffRequestStatusStatus$inboundSchema).optional(),
    description: z.nullable(z.string()).optional(),
    start_date: z.nullable(z.string()).optional(),
    end_date: z.nullable(z.string()).optional(),
    request_date: z.nullable(z.string()).optional(),
    request_type: z.nullable(exports.RequestType$inboundSchema).optional(),
    approval_date: z.nullable(z.string()).optional(),
    units: z.nullable(exports.Units$inboundSchema).optional(),
    amount: z.nullable(z.number()).optional(),
    day_part: z.nullable(z.string()).optional(),
    notes: z.lazy(() => exports.Notes$inboundSchema).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    pass_through: z.array(passthroughbody_js_1.PassThroughBody$inboundSchema).optional(),
    policy_type: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "employee_id": "employeeId",
        "policy_id": "policyId",
        "start_date": "startDate",
        "end_date": "endDate",
        "request_date": "requestDate",
        "request_type": "requestType",
        "approval_date": "approvalDate",
        "day_part": "dayPart",
        "custom_mappings": "customMappings",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "pass_through": "passThrough",
        "policy_type": "policyType",
    });
});
function timeOffRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeOffRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOffRequest' from JSON`);
}
/** @internal */
exports.TimeOffRequestInput$outboundSchema = z.object({
    employeeId: z.nullable(z.string()).optional(),
    policyId: z.nullable(z.string()).optional(),
    status: z.nullable(exports.TimeOffRequestStatusStatus$outboundSchema).optional(),
    description: z.nullable(z.string()).optional(),
    startDate: z.nullable(z.string()).optional(),
    endDate: z.nullable(z.string()).optional(),
    requestDate: z.nullable(z.string()).optional(),
    requestType: z.nullable(exports.RequestType$outboundSchema).optional(),
    approvalDate: z.nullable(z.string()).optional(),
    units: z.nullable(exports.Units$outboundSchema).optional(),
    amount: z.nullable(z.number()).optional(),
    dayPart: z.nullable(z.string()).optional(),
    notes: z.lazy(() => exports.Notes$outboundSchema).optional(),
    passThrough: z.array(passthroughbody_js_1.PassThroughBody$outboundSchema).optional(),
    policyType: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        employeeId: "employee_id",
        policyId: "policy_id",
        startDate: "start_date",
        endDate: "end_date",
        requestDate: "request_date",
        requestType: "request_type",
        approvalDate: "approval_date",
        dayPart: "day_part",
        passThrough: "pass_through",
        policyType: "policy_type",
    });
});
function timeOffRequestInputToJSON(timeOffRequestInput) {
    return JSON.stringify(exports.TimeOffRequestInput$outboundSchema.parse(timeOffRequestInput));
}
//# sourceMappingURL=timeoffrequest.js.map