/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import { CustomField, CustomField$Outbound, CustomField$outboundSchema, } from "./customfield.js"; import { LineItemType, LineItemType$outboundSchema } from "./lineitemtype.js"; import { LinkedCustomerInput, LinkedCustomerInput$Outbound, LinkedCustomerInput$outboundSchema, } from "./linkedcustomerinput.js"; import { LinkedInvoiceItem, LinkedInvoiceItem$Outbound, LinkedInvoiceItem$outboundSchema, } from "./linkedinvoiceitem.js"; import { LinkedLedgerAccount, LinkedLedgerAccount$Outbound, LinkedLedgerAccount$outboundSchema, } from "./linkedledgeraccount.js"; import { LinkedPurchaseOrder, LinkedPurchaseOrder$Outbound, LinkedPurchaseOrder$outboundSchema, } from "./linkedpurchaseorder.js"; import { LinkedTaxRateInput, LinkedTaxRateInput$Outbound, LinkedTaxRateInput$outboundSchema, } from "./linkedtaxrateinput.js"; import { LinkedTrackingCategory, LinkedTrackingCategory$Outbound, LinkedTrackingCategory$outboundSchema, } from "./linkedtrackingcategory.js"; import { LinkedWorktag, LinkedWorktag$Outbound, LinkedWorktag$outboundSchema, } from "./linkedworktag.js"; import { Rebilling, Rebilling$Outbound, Rebilling$outboundSchema, } from "./rebilling.js"; export type BillLineItemInput = { /** * Row ID */ rowId?: string | undefined; /** * User defined item code */ code?: string | null | undefined; /** * Line number of the resource */ lineNumber?: number | null | undefined; /** * User defined description */ description?: string | null | undefined; /** * Line Item type */ type?: LineItemType | null | undefined; /** * Tax amount */ taxAmount?: number | null | undefined; /** * Total amount of the line item */ totalAmount?: number | null | undefined; quantity?: number | null | undefined; unitPrice?: number | null | undefined; /** * Description of the unit type the item is sold as, ie: kg, hour. */ unitOfMeasure?: string | null | undefined; /** * Discount percentage applied to the line item when supported downstream. */ discountPercentage?: number | null | undefined; /** * Discount amount applied to the line item when supported downstream. */ discountAmount?: number | null | undefined; /** * The ID of the location */ locationId?: string | null | undefined; /** * The ID of the department */ departmentId?: string | null | undefined; /** * The ID of the subsidiary */ subsidiaryId?: string | null | undefined; /** * ID of the category of the line item */ categoryId?: string | null | undefined; /** * ID of the shipping of the line item */ shippingId?: string | null | undefined; /** * Memo */ memo?: string | null | undefined; /** * Whether the line item is prepaid */ prepaid?: boolean | null | undefined; /** * Tax applicable on */ taxApplicableOn?: string | null | undefined; /** * Tax recoverability */ taxRecoverability?: string | null | undefined; /** * Method of tax calculation */ taxMethod?: string | null | undefined; /** * Retention amount */ retentionAmount?: number | null | undefined; /** * Payment amount */ paymentAmount?: number | null | undefined; item?: LinkedInvoiceItem | undefined; taxRate?: LinkedTaxRateInput | undefined; ledgerAccount?: LinkedLedgerAccount | null | undefined; purchaseOrder?: LinkedPurchaseOrder | null | undefined; customFields?: Array | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; /** * The customer this entity is linked to. */ customer?: LinkedCustomerInput | null | undefined; /** * Rebilling metadata for this line item. */ rebilling?: Rebilling | null | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * A list of linked worktags. This is only supported for Workday. */ worktags?: Array | undefined; }; /** @internal */ export type BillLineItemInput$Outbound = { row_id?: string | undefined; code?: string | null | undefined; line_number?: number | null | undefined; description?: string | null | undefined; type?: string | null | undefined; tax_amount?: number | null | undefined; total_amount?: number | null | undefined; quantity?: number | null | undefined; unit_price?: number | null | undefined; unit_of_measure?: string | null | undefined; discount_percentage?: number | null | undefined; discount_amount?: number | null | undefined; location_id?: string | null | undefined; department_id?: string | null | undefined; subsidiary_id?: string | null | undefined; category_id?: string | null | undefined; shipping_id?: string | null | undefined; memo?: string | null | undefined; prepaid?: boolean | null | undefined; tax_applicable_on?: string | null | undefined; tax_recoverability?: string | null | undefined; tax_method?: string | null | undefined; retention_amount?: number | null | undefined; payment_amount?: number | null | undefined; item?: LinkedInvoiceItem$Outbound | undefined; tax_rate?: LinkedTaxRateInput$Outbound | undefined; ledger_account?: LinkedLedgerAccount$Outbound | null | undefined; purchase_order?: LinkedPurchaseOrder$Outbound | null | undefined; custom_fields?: Array | undefined; tracking_categories?: | Array | null | undefined; customer?: LinkedCustomerInput$Outbound | null | undefined; rebilling?: Rebilling$Outbound | null | undefined; row_version?: string | null | undefined; worktags?: Array | undefined; }; /** @internal */ export const BillLineItemInput$outboundSchema: z.ZodType< BillLineItemInput$Outbound, z.ZodTypeDef, BillLineItemInput > = /* @__PURE__ */ lazySchema$(() => z.object({ rowId: z.string().optional(), code: z.nullable(z.string()).optional(), lineNumber: z.nullable(z.number().int()).optional(), description: z.nullable(z.string()).optional(), type: z.nullable(LineItemType$outboundSchema).optional(), taxAmount: z.nullable(z.number()).optional(), totalAmount: z.nullable(z.number()).optional(), quantity: z.nullable(z.number()).optional(), unitPrice: z.nullable(z.number()).optional(), unitOfMeasure: z.nullable(z.string()).optional(), discountPercentage: z.nullable(z.number()).optional(), discountAmount: z.nullable(z.number()).optional(), locationId: z.nullable(z.string()).optional(), departmentId: z.nullable(z.string()).optional(), subsidiaryId: z.nullable(z.string()).optional(), categoryId: z.nullable(z.string()).optional(), shippingId: z.nullable(z.string()).optional(), memo: z.nullable(z.string()).optional(), prepaid: z.nullable(z.boolean()).optional(), taxApplicableOn: z.nullable(z.string()).optional(), taxRecoverability: z.nullable(z.string()).optional(), taxMethod: z.nullable(z.string()).optional(), retentionAmount: z.nullable(z.number()).optional(), paymentAmount: z.nullable(z.number()).optional(), item: LinkedInvoiceItem$outboundSchema.optional(), taxRate: LinkedTaxRateInput$outboundSchema.optional(), ledgerAccount: z.nullable(LinkedLedgerAccount$outboundSchema).optional(), purchaseOrder: z.nullable(LinkedPurchaseOrder$outboundSchema).optional(), customFields: z.array(CustomField$outboundSchema).optional(), trackingCategories: z.nullable( z.array(z.nullable(LinkedTrackingCategory$outboundSchema)), ).optional(), customer: z.nullable(LinkedCustomerInput$outboundSchema).optional(), rebilling: z.nullable(Rebilling$outboundSchema).optional(), rowVersion: z.nullable(z.string()).optional(), worktags: z.array(z.nullable(LinkedWorktag$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { rowId: "row_id", lineNumber: "line_number", taxAmount: "tax_amount", totalAmount: "total_amount", unitPrice: "unit_price", unitOfMeasure: "unit_of_measure", discountPercentage: "discount_percentage", discountAmount: "discount_amount", locationId: "location_id", departmentId: "department_id", subsidiaryId: "subsidiary_id", categoryId: "category_id", shippingId: "shipping_id", taxApplicableOn: "tax_applicable_on", taxRecoverability: "tax_recoverability", taxMethod: "tax_method", retentionAmount: "retention_amount", paymentAmount: "payment_amount", taxRate: "tax_rate", ledgerAccount: "ledger_account", purchaseOrder: "purchase_order", customFields: "custom_fields", trackingCategories: "tracking_categories", rowVersion: "row_version", }); }) ); export function billLineItemInputToJSON( billLineItemInput: BillLineItemInput, ): string { return JSON.stringify( BillLineItemInput$outboundSchema.parse(billLineItemInput), ); }