/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { BankAccount, BankAccount$inboundSchema, BankAccount$Outbound, BankAccount$outboundSchema, } from "./bankaccount.js"; import { Currency, Currency$inboundSchema, Currency$outboundSchema, } from "./currency.js"; import { CustomMappings, CustomMappings$inboundSchema, CustomMappings$Outbound, CustomMappings$outboundSchema, } from "./custommappings.js"; import { InvoiceLineItem, InvoiceLineItem$inboundSchema, InvoiceLineItem$Outbound, InvoiceLineItem$outboundSchema, InvoiceLineItemInput, InvoiceLineItemInput$inboundSchema, InvoiceLineItemInput$Outbound, InvoiceLineItemInput$outboundSchema, } from "./invoicelineitem.js"; import { LinkedLedgerAccount, LinkedLedgerAccount$inboundSchema, LinkedLedgerAccount$Outbound, LinkedLedgerAccount$outboundSchema, } from "./linkedledgeraccount.js"; import { LinkedLedgerAccountInput, LinkedLedgerAccountInput$inboundSchema, LinkedLedgerAccountInput$Outbound, LinkedLedgerAccountInput$outboundSchema, } from "./linkedledgeraccountinput.js"; import { LinkedSupplier, LinkedSupplier$inboundSchema, LinkedSupplier$Outbound, LinkedSupplier$outboundSchema, } from "./linkedsupplier.js"; import { LinkedSupplierInput, LinkedSupplierInput$inboundSchema, LinkedSupplierInput$Outbound, LinkedSupplierInput$outboundSchema, } from "./linkedsupplierinput.js"; import { LinkedTrackingCategory, LinkedTrackingCategory$inboundSchema, LinkedTrackingCategory$Outbound, LinkedTrackingCategory$outboundSchema, } from "./linkedtrackingcategory.js"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export const PurchaseOrderStatus = { Draft: "draft", Open: "open", Closed: "closed", Deleted: "deleted", Billed: "billed", Other: "other", } as const; export type PurchaseOrderStatus = ClosedEnum; export type PurchaseOrder = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The third-party API ID of original entity */ downstreamId?: string | null | undefined; /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ poNumber?: string | null | undefined; /** * Optional purchase order reference. */ reference?: string | null | undefined; /** * The supplier this entity is linked to. */ supplier?: LinkedSupplier | null | undefined; /** * The company or subsidiary id the transaction belongs to */ companyId?: string | null | undefined; status?: PurchaseOrderStatus | null | undefined; /** * Date purchase order was issued - YYYY-MM-DD. */ issuedDate?: RFCDate | null | undefined; /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ deliveryDate?: RFCDate | null | undefined; /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ expectedArrivalDate?: RFCDate | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * Currency Exchange Rate at the time entity was recorded/generated. */ currencyRate?: number | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this invoice. */ totalTax?: number | null | undefined; /** * Total amount of invoice, including tax. */ total?: number | null | undefined; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; lineItems?: Array | undefined; shippingAddress?: Address | undefined; ledgerAccount?: LinkedLedgerAccount | null | undefined; /** * Optional purchase order template */ templateId?: string | null | undefined; /** * Discount percentage applied to this transaction. */ discountPercentage?: number | null | undefined; bankAccount?: BankAccount | undefined; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ accountingByRow?: boolean | null | undefined; /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ dueDate?: RFCDate | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * Message for the supplier. This text appears on the Purchase Order. */ memo?: string | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: CustomMappings | 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; /** * The user who last updated the object. */ updatedBy?: string | null | undefined; /** * The user who created the object. */ createdBy?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; export type PurchaseOrderInput = { /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ poNumber?: string | null | undefined; /** * Optional purchase order reference. */ reference?: string | null | undefined; /** * The supplier this entity is linked to. */ supplier?: LinkedSupplierInput | null | undefined; /** * The company or subsidiary id the transaction belongs to */ companyId?: string | null | undefined; status?: PurchaseOrderStatus | null | undefined; /** * Date purchase order was issued - YYYY-MM-DD. */ issuedDate?: RFCDate | null | undefined; /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ deliveryDate?: RFCDate | null | undefined; /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ expectedArrivalDate?: RFCDate | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * Currency Exchange Rate at the time entity was recorded/generated. */ currencyRate?: number | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this invoice. */ totalTax?: number | null | undefined; /** * Total amount of invoice, including tax. */ total?: number | null | undefined; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; lineItems?: Array | undefined; shippingAddress?: Address | undefined; ledgerAccount?: LinkedLedgerAccountInput | null | undefined; /** * Optional purchase order template */ templateId?: string | null | undefined; /** * Discount percentage applied to this transaction. */ discountPercentage?: number | null | undefined; bankAccount?: BankAccount | undefined; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ accountingByRow?: boolean | null | undefined; /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ dueDate?: RFCDate | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * Message for the supplier. This text appears on the Purchase Order. */ memo?: string | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | 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; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const PurchaseOrderStatus$inboundSchema: z.ZodNativeEnum< typeof PurchaseOrderStatus > = z.nativeEnum(PurchaseOrderStatus); /** @internal */ export const PurchaseOrderStatus$outboundSchema: z.ZodNativeEnum< typeof PurchaseOrderStatus > = PurchaseOrderStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PurchaseOrderStatus$ { /** @deprecated use `PurchaseOrderStatus$inboundSchema` instead. */ export const inboundSchema = PurchaseOrderStatus$inboundSchema; /** @deprecated use `PurchaseOrderStatus$outboundSchema` instead. */ export const outboundSchema = PurchaseOrderStatus$outboundSchema; } /** @internal */ export const PurchaseOrder$inboundSchema: z.ZodType< PurchaseOrder, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), downstream_id: z.nullable(z.string()).optional(), po_number: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplier$inboundSchema).optional(), company_id: z.nullable(z.string()).optional(), status: z.nullable(PurchaseOrderStatus$inboundSchema).optional(), issued_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(), delivery_date: z.nullable(z.string().transform(v => new RFCDate(v))) .optional(), expected_arrival_date: z.nullable(z.string().transform(v => new RFCDate(v))) .optional(), currency: z.nullable(Currency$inboundSchema).optional(), currency_rate: z.nullable(z.number()).optional(), sub_total: z.nullable(z.number()).optional(), total_tax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), tax_inclusive: z.nullable(z.boolean()).optional(), line_items: z.array(InvoiceLineItem$inboundSchema).optional(), shipping_address: Address$inboundSchema.optional(), ledger_account: z.nullable(LinkedLedgerAccount$inboundSchema).optional(), template_id: z.nullable(z.string()).optional(), discount_percentage: z.nullable(z.number()).optional(), bank_account: BankAccount$inboundSchema.optional(), accounting_by_row: z.nullable(z.boolean()).optional(), due_date: z.string().transform(v => new RFCDate(v)).optional(), payment_method: z.nullable(z.string()).optional(), tax_code: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), memo: z.nullable(z.string()).optional(), tracking_categories: z.nullable(z.array(LinkedTrackingCategory$inboundSchema)) .optional(), custom_mappings: z.nullable(CustomMappings$inboundSchema).optional(), row_version: z.nullable(z.string()).optional(), updated_by: z.nullable(z.string()).optional(), created_by: z.nullable(z.string()).optional(), updated_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), created_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "downstream_id": "downstreamId", "po_number": "poNumber", "company_id": "companyId", "issued_date": "issuedDate", "delivery_date": "deliveryDate", "expected_arrival_date": "expectedArrivalDate", "currency_rate": "currencyRate", "sub_total": "subTotal", "total_tax": "totalTax", "tax_inclusive": "taxInclusive", "line_items": "lineItems", "shipping_address": "shippingAddress", "ledger_account": "ledgerAccount", "template_id": "templateId", "discount_percentage": "discountPercentage", "bank_account": "bankAccount", "accounting_by_row": "accountingByRow", "due_date": "dueDate", "payment_method": "paymentMethod", "tax_code": "taxCode", "tracking_categories": "trackingCategories", "custom_mappings": "customMappings", "row_version": "rowVersion", "updated_by": "updatedBy", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "pass_through": "passThrough", }); }); /** @internal */ export type PurchaseOrder$Outbound = { id?: string | undefined; downstream_id?: string | null | undefined; po_number?: string | null | undefined; reference?: string | null | undefined; supplier?: LinkedSupplier$Outbound | null | undefined; company_id?: string | null | undefined; status?: string | null | undefined; issued_date?: string | null | undefined; delivery_date?: string | null | undefined; expected_arrival_date?: string | null | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; total?: number | null | undefined; tax_inclusive?: boolean | null | undefined; line_items?: Array | undefined; shipping_address?: Address$Outbound | undefined; ledger_account?: LinkedLedgerAccount$Outbound | null | undefined; template_id?: string | null | undefined; discount_percentage?: number | null | undefined; bank_account?: BankAccount$Outbound | undefined; accounting_by_row?: boolean | null | undefined; due_date?: string | undefined; payment_method?: string | null | undefined; tax_code?: string | null | undefined; channel?: string | null | undefined; memo?: string | null | undefined; tracking_categories?: | Array | null | undefined; custom_mappings?: CustomMappings$Outbound | null | undefined; row_version?: string | null | undefined; updated_by?: string | null | undefined; created_by?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const PurchaseOrder$outboundSchema: z.ZodType< PurchaseOrder$Outbound, z.ZodTypeDef, PurchaseOrder > = z.object({ id: z.string().optional(), downstreamId: z.nullable(z.string()).optional(), poNumber: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplier$outboundSchema).optional(), companyId: z.nullable(z.string()).optional(), status: z.nullable(PurchaseOrderStatus$outboundSchema).optional(), issuedDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), deliveryDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), expectedArrivalDate: z.nullable( z.instanceof(RFCDate).transform(v => v.toString()), ).optional(), currency: z.nullable(Currency$outboundSchema).optional(), currencyRate: z.nullable(z.number()).optional(), subTotal: z.nullable(z.number()).optional(), totalTax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), taxInclusive: z.nullable(z.boolean()).optional(), lineItems: z.array(InvoiceLineItem$outboundSchema).optional(), shippingAddress: Address$outboundSchema.optional(), ledgerAccount: z.nullable(LinkedLedgerAccount$outboundSchema).optional(), templateId: z.nullable(z.string()).optional(), discountPercentage: z.nullable(z.number()).optional(), bankAccount: BankAccount$outboundSchema.optional(), accountingByRow: z.nullable(z.boolean()).optional(), dueDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), paymentMethod: z.nullable(z.string()).optional(), taxCode: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), memo: z.nullable(z.string()).optional(), trackingCategories: z.nullable(z.array(LinkedTrackingCategory$outboundSchema)) .optional(), customMappings: z.nullable(CustomMappings$outboundSchema).optional(), rowVersion: z.nullable(z.string()).optional(), updatedBy: z.nullable(z.string()).optional(), createdBy: z.nullable(z.string()).optional(), updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { downstreamId: "downstream_id", poNumber: "po_number", companyId: "company_id", issuedDate: "issued_date", deliveryDate: "delivery_date", expectedArrivalDate: "expected_arrival_date", currencyRate: "currency_rate", subTotal: "sub_total", totalTax: "total_tax", taxInclusive: "tax_inclusive", lineItems: "line_items", shippingAddress: "shipping_address", ledgerAccount: "ledger_account", templateId: "template_id", discountPercentage: "discount_percentage", bankAccount: "bank_account", accountingByRow: "accounting_by_row", dueDate: "due_date", paymentMethod: "payment_method", taxCode: "tax_code", trackingCategories: "tracking_categories", customMappings: "custom_mappings", rowVersion: "row_version", updatedBy: "updated_by", createdBy: "created_by", updatedAt: "updated_at", createdAt: "created_at", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PurchaseOrder$ { /** @deprecated use `PurchaseOrder$inboundSchema` instead. */ export const inboundSchema = PurchaseOrder$inboundSchema; /** @deprecated use `PurchaseOrder$outboundSchema` instead. */ export const outboundSchema = PurchaseOrder$outboundSchema; /** @deprecated use `PurchaseOrder$Outbound` instead. */ export type Outbound = PurchaseOrder$Outbound; } export function purchaseOrderToJSON(purchaseOrder: PurchaseOrder): string { return JSON.stringify(PurchaseOrder$outboundSchema.parse(purchaseOrder)); } export function purchaseOrderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PurchaseOrder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PurchaseOrder' from JSON`, ); } /** @internal */ export const PurchaseOrderInput$inboundSchema: z.ZodType< PurchaseOrderInput, z.ZodTypeDef, unknown > = z.object({ po_number: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplierInput$inboundSchema).optional(), company_id: z.nullable(z.string()).optional(), status: z.nullable(PurchaseOrderStatus$inboundSchema).optional(), issued_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(), delivery_date: z.nullable(z.string().transform(v => new RFCDate(v))) .optional(), expected_arrival_date: z.nullable(z.string().transform(v => new RFCDate(v))) .optional(), currency: z.nullable(Currency$inboundSchema).optional(), currency_rate: z.nullable(z.number()).optional(), sub_total: z.nullable(z.number()).optional(), total_tax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), tax_inclusive: z.nullable(z.boolean()).optional(), line_items: z.array(InvoiceLineItemInput$inboundSchema).optional(), shipping_address: Address$inboundSchema.optional(), ledger_account: z.nullable(LinkedLedgerAccountInput$inboundSchema).optional(), template_id: z.nullable(z.string()).optional(), discount_percentage: z.nullable(z.number()).optional(), bank_account: BankAccount$inboundSchema.optional(), accounting_by_row: z.nullable(z.boolean()).optional(), due_date: z.string().transform(v => new RFCDate(v)).optional(), payment_method: z.nullable(z.string()).optional(), tax_code: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), memo: z.nullable(z.string()).optional(), tracking_categories: z.nullable(z.array(LinkedTrackingCategory$inboundSchema)) .optional(), row_version: z.nullable(z.string()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "po_number": "poNumber", "company_id": "companyId", "issued_date": "issuedDate", "delivery_date": "deliveryDate", "expected_arrival_date": "expectedArrivalDate", "currency_rate": "currencyRate", "sub_total": "subTotal", "total_tax": "totalTax", "tax_inclusive": "taxInclusive", "line_items": "lineItems", "shipping_address": "shippingAddress", "ledger_account": "ledgerAccount", "template_id": "templateId", "discount_percentage": "discountPercentage", "bank_account": "bankAccount", "accounting_by_row": "accountingByRow", "due_date": "dueDate", "payment_method": "paymentMethod", "tax_code": "taxCode", "tracking_categories": "trackingCategories", "row_version": "rowVersion", "pass_through": "passThrough", }); }); /** @internal */ export type PurchaseOrderInput$Outbound = { po_number?: string | null | undefined; reference?: string | null | undefined; supplier?: LinkedSupplierInput$Outbound | null | undefined; company_id?: string | null | undefined; status?: string | null | undefined; issued_date?: string | null | undefined; delivery_date?: string | null | undefined; expected_arrival_date?: string | null | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; total?: number | null | undefined; tax_inclusive?: boolean | null | undefined; line_items?: Array | undefined; shipping_address?: Address$Outbound | undefined; ledger_account?: LinkedLedgerAccountInput$Outbound | null | undefined; template_id?: string | null | undefined; discount_percentage?: number | null | undefined; bank_account?: BankAccount$Outbound | undefined; accounting_by_row?: boolean | null | undefined; due_date?: string | undefined; payment_method?: string | null | undefined; tax_code?: string | null | undefined; channel?: string | null | undefined; memo?: string | null | undefined; tracking_categories?: | Array | null | undefined; row_version?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const PurchaseOrderInput$outboundSchema: z.ZodType< PurchaseOrderInput$Outbound, z.ZodTypeDef, PurchaseOrderInput > = z.object({ poNumber: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplierInput$outboundSchema).optional(), companyId: z.nullable(z.string()).optional(), status: z.nullable(PurchaseOrderStatus$outboundSchema).optional(), issuedDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), deliveryDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), expectedArrivalDate: z.nullable( z.instanceof(RFCDate).transform(v => v.toString()), ).optional(), currency: z.nullable(Currency$outboundSchema).optional(), currencyRate: z.nullable(z.number()).optional(), subTotal: z.nullable(z.number()).optional(), totalTax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), taxInclusive: z.nullable(z.boolean()).optional(), lineItems: z.array(InvoiceLineItemInput$outboundSchema).optional(), shippingAddress: Address$outboundSchema.optional(), ledgerAccount: z.nullable(LinkedLedgerAccountInput$outboundSchema).optional(), templateId: z.nullable(z.string()).optional(), discountPercentage: z.nullable(z.number()).optional(), bankAccount: BankAccount$outboundSchema.optional(), accountingByRow: z.nullable(z.boolean()).optional(), dueDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), paymentMethod: z.nullable(z.string()).optional(), taxCode: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), memo: z.nullable(z.string()).optional(), trackingCategories: z.nullable(z.array(LinkedTrackingCategory$outboundSchema)) .optional(), rowVersion: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { poNumber: "po_number", companyId: "company_id", issuedDate: "issued_date", deliveryDate: "delivery_date", expectedArrivalDate: "expected_arrival_date", currencyRate: "currency_rate", subTotal: "sub_total", totalTax: "total_tax", taxInclusive: "tax_inclusive", lineItems: "line_items", shippingAddress: "shipping_address", ledgerAccount: "ledger_account", templateId: "template_id", discountPercentage: "discount_percentage", bankAccount: "bank_account", accountingByRow: "accounting_by_row", dueDate: "due_date", paymentMethod: "payment_method", taxCode: "tax_code", trackingCategories: "tracking_categories", rowVersion: "row_version", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PurchaseOrderInput$ { /** @deprecated use `PurchaseOrderInput$inboundSchema` instead. */ export const inboundSchema = PurchaseOrderInput$inboundSchema; /** @deprecated use `PurchaseOrderInput$outboundSchema` instead. */ export const outboundSchema = PurchaseOrderInput$outboundSchema; /** @deprecated use `PurchaseOrderInput$Outbound` instead. */ export type Outbound = PurchaseOrderInput$Outbound; } export function purchaseOrderInputToJSON( purchaseOrderInput: PurchaseOrderInput, ): string { return JSON.stringify( PurchaseOrderInput$outboundSchema.parse(purchaseOrderInput), ); } export function purchaseOrderInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PurchaseOrderInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PurchaseOrderInput' from JSON`, ); }