"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.BillLineItem$inboundSchema = void 0;
exports.billLineItemFromJSON = billLineItemFromJSON;
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 linkedcustomer_js_1 = require("./linkedcustomer.js");
const linkedinvoiceitem_js_1 = require("./linkedinvoiceitem.js");
const linkedledgeraccount_js_1 = require("./linkedledgeraccount.js");
const linkedpurchaseorder_js_1 = require("./linkedpurchaseorder.js");
const linkedtaxrate_js_1 = require("./linkedtaxrate.js");
const linkedtrackingcategory_js_1 = require("./linkedtrackingcategory.js");
const linkedworktag_js_1 = require("./linkedworktag.js");
const rebilling_js_1 = require("./rebilling.js");
/** @internal */
exports.BillLineItem$inboundSchema = z.object({
    id: z.string().optional(),
    row_id: z.string().optional(),
    code: z.nullable(z.string()).optional(),
    line_number: z.nullable(z.number().int()).optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(lineitemtype_js_1.LineItemType$inboundSchema).optional(),
    tax_amount: z.nullable(z.number()).optional(),
    total_amount: z.nullable(z.number()).optional(),
    quantity: z.nullable(z.number()).optional(),
    unit_price: z.nullable(z.number()).optional(),
    unit_of_measure: z.nullable(z.string()).optional(),
    discount_percentage: z.nullable(z.number()).optional(),
    discount_amount: z.nullable(z.number()).optional(),
    location_id: z.nullable(z.string()).optional(),
    department_id: z.nullable(z.string()).optional(),
    subsidiary_id: z.nullable(z.string()).optional(),
    category_id: z.nullable(z.string()).optional(),
    shipping_id: z.nullable(z.string()).optional(),
    memo: z.nullable(z.string()).optional(),
    prepaid: z.nullable(z.boolean()).optional(),
    tax_applicable_on: z.nullable(z.string()).optional(),
    tax_recoverability: z.nullable(z.string()).optional(),
    tax_method: z.nullable(z.string()).optional(),
    retention_amount: z.nullable(z.number()).optional(),
    payment_amount: z.nullable(z.number()).optional(),
    item: linkedinvoiceitem_js_1.LinkedInvoiceItem$inboundSchema.optional(),
    tax_rate: linkedtaxrate_js_1.LinkedTaxRate$inboundSchema.optional(),
    ledger_account: z.nullable(linkedledgeraccount_js_1.LinkedLedgerAccount$inboundSchema).optional(),
    purchase_order: z.nullable(linkedpurchaseorder_js_1.LinkedPurchaseOrder$inboundSchema).optional(),
    tracking_categories: z.nullable(z.array(z.nullable(linkedtrackingcategory_js_1.LinkedTrackingCategory$inboundSchema))).optional(),
    customer: z.nullable(linkedcustomer_js_1.LinkedCustomer$inboundSchema).optional(),
    rebilling: z.nullable(rebilling_js_1.Rebilling$inboundSchema).optional(),
    row_version: z.nullable(z.string()).optional(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    worktags: z.array(z.nullable(linkedworktag_js_1.LinkedWorktag$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "row_id": "rowId",
        "line_number": "lineNumber",
        "tax_amount": "taxAmount",
        "total_amount": "totalAmount",
        "unit_price": "unitPrice",
        "unit_of_measure": "unitOfMeasure",
        "discount_percentage": "discountPercentage",
        "discount_amount": "discountAmount",
        "location_id": "locationId",
        "department_id": "departmentId",
        "subsidiary_id": "subsidiaryId",
        "category_id": "categoryId",
        "shipping_id": "shippingId",
        "tax_applicable_on": "taxApplicableOn",
        "tax_recoverability": "taxRecoverability",
        "tax_method": "taxMethod",
        "retention_amount": "retentionAmount",
        "payment_amount": "paymentAmount",
        "tax_rate": "taxRate",
        "ledger_account": "ledgerAccount",
        "purchase_order": "purchaseOrder",
        "tracking_categories": "trackingCategories",
        "row_version": "rowVersion",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
    });
});
function billLineItemFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BillLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BillLineItem' from JSON`);
}
//# sourceMappingURL=billlineitem.js.map