"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.timeEntriesFromJSON = exports.timeEntriesToJSON = exports.TimeEntries$ = exports.TimeEntries$outboundSchema = exports.TimeEntries$inboundSchema = exports.timeEntriesStatusFromJSON = exports.timeEntriesStatusToJSON = exports.TimeEntriesStatus$ = exports.TimeEntriesStatus$outboundSchema = exports.TimeEntriesStatus$inboundSchema = exports.TimeEntriesValue$ = exports.TimeEntriesValue$outboundSchema = exports.TimeEntriesValue$inboundSchema = exports.timeEntriesSourceValueFromJSON = exports.timeEntriesSourceValueToJSON = exports.TimeEntriesSourceValue$ = exports.TimeEntriesSourceValue$outboundSchema = exports.TimeEntriesSourceValue$inboundSchema = exports.timeEntries4FromJSON = exports.timeEntries4ToJSON = exports.TimeEntries4$ = exports.TimeEntries4$outboundSchema = exports.TimeEntries4$inboundSchema = exports.locationFromJSON = exports.locationToJSON = exports.Location$ = exports.Location$outboundSchema = exports.Location$inboundSchema = exports.timeEntriesActiveFromJSON = exports.timeEntriesActiveToJSON = exports.TimeEntriesActive$ = exports.TimeEntriesActive$outboundSchema = exports.TimeEntriesActive$inboundSchema = exports.TimeEntries2$ = exports.TimeEntries2$outboundSchema = exports.TimeEntries2$inboundSchema = exports.laborTypeFromJSON = exports.laborTypeToJSON = exports.LaborType$ = exports.LaborType$outboundSchema = exports.LaborType$inboundSchema = exports.TimeEntriesValue = exports.TimeEntries2 = 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");
var TimeEntries2;
(function (TimeEntries2) {
    TimeEntries2["True"] = "true";
    TimeEntries2["False"] = "false";
})(TimeEntries2 || (exports.TimeEntries2 = TimeEntries2 = {}));
var TimeEntriesValue;
(function (TimeEntriesValue) {
    TimeEntriesValue["Approved"] = "approved";
    TimeEntriesValue["UnmappedValue"] = "unmapped_value";
})(TimeEntriesValue || (exports.TimeEntriesValue = TimeEntriesValue = {}));
/** @internal */
exports.LaborType$inboundSchema = z.object({
    code: z.nullable(z.string()).optional(),
});
/** @internal */
exports.LaborType$outboundSchema = z.object({
    code: z.nullable(z.string()).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var LaborType$;
(function (LaborType$) {
    /** @deprecated use `LaborType$inboundSchema` instead. */
    LaborType$.inboundSchema = exports.LaborType$inboundSchema;
    /** @deprecated use `LaborType$outboundSchema` instead. */
    LaborType$.outboundSchema = exports.LaborType$outboundSchema;
})(LaborType$ || (exports.LaborType$ = LaborType$ = {}));
function laborTypeToJSON(laborType) {
    return JSON.stringify(exports.LaborType$outboundSchema.parse(laborType));
}
exports.laborTypeToJSON = laborTypeToJSON;
function laborTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LaborType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LaborType' from JSON`);
}
exports.laborTypeFromJSON = laborTypeFromJSON;
/** @internal */
exports.TimeEntries2$inboundSchema = z.nativeEnum(TimeEntries2);
/** @internal */
exports.TimeEntries2$outboundSchema = exports.TimeEntries2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeEntries2$;
(function (TimeEntries2$) {
    /** @deprecated use `TimeEntries2$inboundSchema` instead. */
    TimeEntries2$.inboundSchema = exports.TimeEntries2$inboundSchema;
    /** @deprecated use `TimeEntries2$outboundSchema` instead. */
    TimeEntries2$.outboundSchema = exports.TimeEntries2$outboundSchema;
})(TimeEntries2$ || (exports.TimeEntries2$ = TimeEntries2$ = {}));
/** @internal */
exports.TimeEntriesActive$inboundSchema = z.union([z.boolean(), exports.TimeEntries2$inboundSchema]);
/** @internal */
exports.TimeEntriesActive$outboundSchema = z.union([z.boolean(), exports.TimeEntries2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TimeEntriesActive$;
(function (TimeEntriesActive$) {
    /** @deprecated use `TimeEntriesActive$inboundSchema` instead. */
    TimeEntriesActive$.inboundSchema = exports.TimeEntriesActive$inboundSchema;
    /** @deprecated use `TimeEntriesActive$outboundSchema` instead. */
    TimeEntriesActive$.outboundSchema = exports.TimeEntriesActive$outboundSchema;
})(TimeEntriesActive$ || (exports.TimeEntriesActive$ = TimeEntriesActive$ = {}));
function timeEntriesActiveToJSON(timeEntriesActive) {
    return JSON.stringify(exports.TimeEntriesActive$outboundSchema.parse(timeEntriesActive));
}
exports.timeEntriesActiveToJSON = timeEntriesActiveToJSON;
function timeEntriesActiveFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeEntriesActive$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeEntriesActive' from JSON`);
}
exports.timeEntriesActiveFromJSON = timeEntriesActiveFromJSON;
/** @internal */
exports.Location$inboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.TimeEntries2$inboundSchema]))
        .optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.Location$outboundSchema = z.object({
    active: z.nullable(z.union([z.boolean(), exports.TimeEntries2$outboundSchema]))
        .optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Location$;
(function (Location$) {
    /** @deprecated use `Location$inboundSchema` instead. */
    Location$.inboundSchema = exports.Location$inboundSchema;
    /** @deprecated use `Location$outboundSchema` instead. */
    Location$.outboundSchema = exports.Location$outboundSchema;
})(Location$ || (exports.Location$ = Location$ = {}));
function locationToJSON(location) {
    return JSON.stringify(exports.Location$outboundSchema.parse(location));
}
exports.locationToJSON = locationToJSON;
function locationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Location$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Location' from JSON`);
}
exports.locationFromJSON = locationFromJSON;
/** @internal */
exports.TimeEntries4$inboundSchema = z.object({});
/** @internal */
exports.TimeEntries4$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 TimeEntries4$;
(function (TimeEntries4$) {
    /** @deprecated use `TimeEntries4$inboundSchema` instead. */
    TimeEntries4$.inboundSchema = exports.TimeEntries4$inboundSchema;
    /** @deprecated use `TimeEntries4$outboundSchema` instead. */
    TimeEntries4$.outboundSchema = exports.TimeEntries4$outboundSchema;
})(TimeEntries4$ || (exports.TimeEntries4$ = TimeEntries4$ = {}));
function timeEntries4ToJSON(timeEntries4) {
    return JSON.stringify(exports.TimeEntries4$outboundSchema.parse(timeEntries4));
}
exports.timeEntries4ToJSON = timeEntries4ToJSON;
function timeEntries4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeEntries4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeEntries4' from JSON`);
}
exports.timeEntries4FromJSON = timeEntries4FromJSON;
/** @internal */
exports.TimeEntriesSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TimeEntries4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TimeEntriesSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TimeEntries4$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 TimeEntriesSourceValue$;
(function (TimeEntriesSourceValue$) {
    /** @deprecated use `TimeEntriesSourceValue$inboundSchema` instead. */
    TimeEntriesSourceValue$.inboundSchema = exports.TimeEntriesSourceValue$inboundSchema;
    /** @deprecated use `TimeEntriesSourceValue$outboundSchema` instead. */
    TimeEntriesSourceValue$.outboundSchema = exports.TimeEntriesSourceValue$outboundSchema;
})(TimeEntriesSourceValue$ || (exports.TimeEntriesSourceValue$ = TimeEntriesSourceValue$ = {}));
function timeEntriesSourceValueToJSON(timeEntriesSourceValue) {
    return JSON.stringify(exports.TimeEntriesSourceValue$outboundSchema.parse(timeEntriesSourceValue));
}
exports.timeEntriesSourceValueToJSON = timeEntriesSourceValueToJSON;
function timeEntriesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeEntriesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeEntriesSourceValue' from JSON`);
}
exports.timeEntriesSourceValueFromJSON = timeEntriesSourceValueFromJSON;
/** @internal */
exports.TimeEntriesValue$inboundSchema = z
    .union([
    z.nativeEnum(TimeEntriesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TimeEntriesValue$outboundSchema = z.union([
    z.nativeEnum(TimeEntriesValue),
    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 TimeEntriesValue$;
(function (TimeEntriesValue$) {
    /** @deprecated use `TimeEntriesValue$inboundSchema` instead. */
    TimeEntriesValue$.inboundSchema = exports.TimeEntriesValue$inboundSchema;
    /** @deprecated use `TimeEntriesValue$outboundSchema` instead. */
    TimeEntriesValue$.outboundSchema = exports.TimeEntriesValue$outboundSchema;
})(TimeEntriesValue$ || (exports.TimeEntriesValue$ = TimeEntriesValue$ = {}));
/** @internal */
exports.TimeEntriesStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TimeEntries4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeEntriesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TimeEntriesStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TimeEntries4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TimeEntriesValue$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 TimeEntriesStatus$;
(function (TimeEntriesStatus$) {
    /** @deprecated use `TimeEntriesStatus$inboundSchema` instead. */
    TimeEntriesStatus$.inboundSchema = exports.TimeEntriesStatus$inboundSchema;
    /** @deprecated use `TimeEntriesStatus$outboundSchema` instead. */
    TimeEntriesStatus$.outboundSchema = exports.TimeEntriesStatus$outboundSchema;
})(TimeEntriesStatus$ || (exports.TimeEntriesStatus$ = TimeEntriesStatus$ = {}));
function timeEntriesStatusToJSON(timeEntriesStatus) {
    return JSON.stringify(exports.TimeEntriesStatus$outboundSchema.parse(timeEntriesStatus));
}
exports.timeEntriesStatusToJSON = timeEntriesStatusToJSON;
function timeEntriesStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeEntriesStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeEntriesStatus' from JSON`);
}
exports.timeEntriesStatusFromJSON = timeEntriesStatusFromJSON;
/** @internal */
exports.TimeEntries$inboundSchema = z.object({
    break_duration: z.nullable(z.number()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    employee_id: z.nullable(z.string()).optional(),
    end_time: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    hours_worked: z.nullable(z.number()).optional(),
    id: z.nullable(z.string()).optional(),
    labor_type: z.nullable(z.lazy(() => exports.LaborType$inboundSchema)).optional(),
    location: z.nullable(z.lazy(() => exports.Location$inboundSchema)).optional(),
    remote_employee_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    start_time: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    status: z.nullable(z.lazy(() => exports.TimeEntriesStatus$inboundSchema)).optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).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, {
        "break_duration": "breakDuration",
        "created_at": "createdAt",
        "employee_id": "employeeId",
        "end_time": "endTime",
        "hours_worked": "hoursWorked",
        "labor_type": "laborType",
        "remote_employee_id": "remoteEmployeeId",
        "remote_id": "remoteId",
        "start_time": "startTime",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.TimeEntries$outboundSchema = z.object({
    breakDuration: z.nullable(z.number()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    employeeId: z.nullable(z.string()).optional(),
    endTime: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    hoursWorked: z.nullable(z.number()).optional(),
    id: z.nullable(z.string()).optional(),
    laborType: z.nullable(z.lazy(() => exports.LaborType$outboundSchema)).optional(),
    location: z.nullable(z.lazy(() => exports.Location$outboundSchema)).optional(),
    remoteEmployeeId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    startTime: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    status: z.nullable(z.lazy(() => exports.TimeEntriesStatus$outboundSchema)).optional(),
    unifiedCustomFields: z.nullable(z.record(z.any())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        breakDuration: "break_duration",
        createdAt: "created_at",
        employeeId: "employee_id",
        endTime: "end_time",
        hoursWorked: "hours_worked",
        laborType: "labor_type",
        remoteEmployeeId: "remote_employee_id",
        remoteId: "remote_id",
        startTime: "start_time",
        unifiedCustomFields: "unified_custom_fields",
        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 TimeEntries$;
(function (TimeEntries$) {
    /** @deprecated use `TimeEntries$inboundSchema` instead. */
    TimeEntries$.inboundSchema = exports.TimeEntries$inboundSchema;
    /** @deprecated use `TimeEntries$outboundSchema` instead. */
    TimeEntries$.outboundSchema = exports.TimeEntries$outboundSchema;
})(TimeEntries$ || (exports.TimeEntries$ = TimeEntries$ = {}));
function timeEntriesToJSON(timeEntries) {
    return JSON.stringify(exports.TimeEntries$outboundSchema.parse(timeEntries));
}
exports.timeEntriesToJSON = timeEntriesToJSON;
function timeEntriesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TimeEntries$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeEntries' from JSON`);
}
exports.timeEntriesFromJSON = timeEntriesFromJSON;
//# sourceMappingURL=timeentries.js.map