"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.ExpenseLineItem$inboundSchema = void 0;
exports.expenseLineItemFromJSON = expenseLineItemFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const lineitemtype_js_1 = require("./lineitemtype.js");
const linkedinvoiceitem_js_1 = require("./linkedinvoiceitem.js");
const linkedledgeraccount_js_1 = require("./linkedledgeraccount.js");
const linkedtaxrate_js_1 = require("./linkedtaxrate.js");
const linkedtrackingcategory_js_1 = require("./linkedtrackingcategory.js");
const rebilling_js_1 = require("./rebilling.js");
/** @internal */
exports.ExpenseLineItem$inboundSchema = z.object({
    id: z.string().optional(),
    tracking_categories: z.nullable(z.array(z.nullable(linkedtrackingcategory_js_1.LinkedTrackingCategory$inboundSchema))).optional(),
    account_id: z.string().optional(),
    account: z.nullable(linkedledgeraccount_js_1.LinkedLedgerAccount$inboundSchema).optional(),
    customer_id: z.string().optional(),
    department_id: z.nullable(z.string()).optional(),
    location_id: z.nullable(z.string()).optional(),
    subsidiary_id: z.nullable(z.string()).optional(),
    tax_rate: linkedtaxrate_js_1.LinkedTaxRate$inboundSchema.optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(lineitemtype_js_1.LineItemType$inboundSchema).optional(),
    total_amount: z.nullable(z.number()),
    tax_amount: z.nullable(z.number()).optional(),
    quantity: z.nullable(z.number()).optional(),
    unit_price: z.nullable(z.number()).optional(),
    item: linkedinvoiceitem_js_1.LinkedInvoiceItem$inboundSchema.optional(),
    billable: z.boolean().optional(),
    line_number: z.nullable(z.number().int()).optional(),
    rebilling: z.nullable(rebilling_js_1.Rebilling$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "tracking_categories": "trackingCategories",
        "account_id": "accountId",
        "customer_id": "customerId",
        "department_id": "departmentId",
        "location_id": "locationId",
        "subsidiary_id": "subsidiaryId",
        "tax_rate": "taxRate",
        "total_amount": "totalAmount",
        "tax_amount": "taxAmount",
        "unit_price": "unitPrice",
        "line_number": "lineNumber",
    });
});
function expenseLineItemFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ExpenseLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExpenseLineItem' from JSON`);
}
//# sourceMappingURL=expenselineitem.js.map