/* * 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 { LineItemType, LineItemType$outboundSchema } from "./lineitemtype.js"; import { LinkedCustomerInput, LinkedCustomerInput$Outbound, LinkedCustomerInput$outboundSchema, } from "./linkedcustomerinput.js"; import { LinkedDepartmentInput, LinkedDepartmentInput$Outbound, LinkedDepartmentInput$outboundSchema, } from "./linkeddepartmentinput.js"; import { LinkedInvoiceItem, LinkedInvoiceItem$Outbound, LinkedInvoiceItem$outboundSchema, } from "./linkedinvoiceitem.js"; import { LinkedLedgerAccount, LinkedLedgerAccount$Outbound, LinkedLedgerAccount$outboundSchema, } from "./linkedledgeraccount.js"; import { LinkedLocationInput, LinkedLocationInput$Outbound, LinkedLocationInput$outboundSchema, } from "./linkedlocationinput.js"; import { LinkedTaxRateInput, LinkedTaxRateInput$Outbound, LinkedTaxRateInput$outboundSchema, } from "./linkedtaxrateinput.js"; import { LinkedTrackingCategory, LinkedTrackingCategory$Outbound, LinkedTrackingCategory$outboundSchema, } from "./linkedtrackingcategory.js"; import { Rebilling, Rebilling$Outbound, Rebilling$outboundSchema, } from "./rebilling.js"; export type ExpenseLineItemInput = { /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; /** * The unique identifier for the ledger account. Deprecated, use account instead. * * @deprecated field: Deprecated. Use account instead.. */ accountId?: string | undefined; account?: LinkedLedgerAccount | null | undefined; /** * The ID of the customer this expense item is linked to. Deprecated in favor of `customer`. * * @deprecated field: Deprecated. Use customer instead.. */ customerId?: string | undefined; /** * The customer this entity is linked to. */ customer?: LinkedCustomerInput | null | undefined; /** * The ID of the department */ departmentId?: string | null | undefined; department?: LinkedDepartmentInput | null | undefined; /** * The ID of the location */ locationId?: string | null | undefined; location?: LinkedLocationInput | null | undefined; taxRate?: LinkedTaxRateInput | undefined; /** * The expense line item description */ description?: string | null | undefined; /** * Line Item type */ type?: LineItemType | null | undefined; /** * The total amount of the expense line item. */ totalAmount: number | null; /** * Tax amount */ taxAmount?: number | null | undefined; quantity?: number | null | undefined; unitPrice?: number | null | undefined; item?: LinkedInvoiceItem | undefined; /** * Line number of the resource */ lineNumber?: number | null | undefined; /** * Rebilling metadata for this line item. */ rebilling?: Rebilling | null | undefined; }; /** @internal */ export type ExpenseLineItemInput$Outbound = { tracking_categories?: | Array | null | undefined; account_id?: string | undefined; account?: LinkedLedgerAccount$Outbound | null | undefined; customer_id?: string | undefined; customer?: LinkedCustomerInput$Outbound | null | undefined; department_id?: string | null | undefined; department?: LinkedDepartmentInput$Outbound | null | undefined; location_id?: string | null | undefined; location?: LinkedLocationInput$Outbound | null | undefined; tax_rate?: LinkedTaxRateInput$Outbound | undefined; description?: string | null | undefined; type?: string | null | undefined; total_amount: number | null; tax_amount?: number | null | undefined; quantity?: number | null | undefined; unit_price?: number | null | undefined; item?: LinkedInvoiceItem$Outbound | undefined; line_number?: number | null | undefined; rebilling?: Rebilling$Outbound | null | undefined; }; /** @internal */ export const ExpenseLineItemInput$outboundSchema: z.ZodType< ExpenseLineItemInput$Outbound, z.ZodTypeDef, ExpenseLineItemInput > = /* @__PURE__ */ lazySchema$(() => z.object({ trackingCategories: z.nullable( z.array(z.nullable(LinkedTrackingCategory$outboundSchema)), ).optional(), accountId: z.string().optional(), account: z.nullable(LinkedLedgerAccount$outboundSchema).optional(), customerId: z.string().optional(), customer: z.nullable(LinkedCustomerInput$outboundSchema).optional(), departmentId: z.nullable(z.string()).optional(), department: z.nullable(LinkedDepartmentInput$outboundSchema).optional(), locationId: z.nullable(z.string()).optional(), location: z.nullable(LinkedLocationInput$outboundSchema).optional(), taxRate: LinkedTaxRateInput$outboundSchema.optional(), description: z.nullable(z.string()).optional(), type: z.nullable(LineItemType$outboundSchema).optional(), totalAmount: z.nullable(z.number()), taxAmount: z.nullable(z.number()).optional(), quantity: z.nullable(z.number()).optional(), unitPrice: z.nullable(z.number()).optional(), item: LinkedInvoiceItem$outboundSchema.optional(), lineNumber: z.nullable(z.number().int()).optional(), rebilling: z.nullable(Rebilling$outboundSchema).optional(), }).transform((v) => { return remap$(v, { trackingCategories: "tracking_categories", accountId: "account_id", customerId: "customer_id", departmentId: "department_id", locationId: "location_id", taxRate: "tax_rate", totalAmount: "total_amount", taxAmount: "tax_amount", unitPrice: "unit_price", lineNumber: "line_number", }); }) ); export function expenseLineItemInputToJSON( expenseLineItemInput: ExpenseLineItemInput, ): string { return JSON.stringify( ExpenseLineItemInput$outboundSchema.parse(expenseLineItemInput), ); }