/* * 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 { BankAccount, BankAccount$inboundSchema, BankAccount$Outbound, BankAccount$outboundSchema, } from "./bankaccount.js"; import { BillLineItem, BillLineItem$inboundSchema, BillLineItem$Outbound, BillLineItem$outboundSchema, BillLineItemInput, BillLineItemInput$inboundSchema, BillLineItemInput$Outbound, BillLineItemInput$outboundSchema, } from "./billlineitem.js"; import { Currency, Currency$inboundSchema, Currency$outboundSchema, } from "./currency.js"; import { CustomMappings, CustomMappings$inboundSchema, CustomMappings$Outbound, CustomMappings$outboundSchema, } from "./custommappings.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"; /** * Invoice status */ export const BillStatus = { Draft: "draft", Submitted: "submitted", Authorised: "authorised", PartiallyPaid: "partially_paid", Paid: "paid", Void: "void", Credit: "credit", Deleted: "deleted", } as const; /** * Invoice status */ export type BillStatus = ClosedEnum; export type Bill = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The third-party API ID of original entity */ downstreamId?: string | null | undefined; /** * Reference to supplier bill number */ billNumber?: 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; /** * 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; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; /** * Date bill was issued - YYYY-MM-DD. */ billDate?: RFCDate | undefined; /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ dueDate?: RFCDate | undefined; /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ paidDate?: RFCDate | null | undefined; /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ poNumber?: string | null | undefined; /** * Optional bill reference. */ reference?: string | null | undefined; lineItems?: Array | undefined; /** * Terms of payment. */ terms?: string | null | undefined; /** * Balance of bill due. */ balance?: number | null | undefined; /** * Amount of deposit made to this bill. */ deposit?: number | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this bill. */ totalTax?: number | null | undefined; /** * Total amount of bill, including tax. */ total?: number | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; notes?: string | null | undefined; /** * Invoice status */ status?: BillStatus | null | undefined; ledgerAccount?: LinkedLedgerAccount | null | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * language code according to ISO 639-1. For the United States - EN */ language?: string | null | 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; bankAccount?: BankAccount | undefined; /** * Discount percentage applied to this transaction. */ discountPercentage?: number | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | 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; /** * 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; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: CustomMappings | 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; /** * Accounting period */ accountingPeriod?: string | null | undefined; }; export type BillInput = { /** * Reference to supplier bill number */ billNumber?: 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; /** * 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; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; /** * Date bill was issued - YYYY-MM-DD. */ billDate?: RFCDate | undefined; /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ dueDate?: RFCDate | undefined; /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ paidDate?: RFCDate | null | undefined; /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ poNumber?: string | null | undefined; /** * Optional bill reference. */ reference?: string | null | undefined; lineItems?: Array | undefined; /** * Terms of payment. */ terms?: string | null | undefined; /** * Balance of bill due. */ balance?: number | null | undefined; /** * Amount of deposit made to this bill. */ deposit?: number | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this bill. */ totalTax?: number | null | undefined; /** * Total amount of bill, including tax. */ total?: number | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; notes?: string | null | undefined; /** * Invoice status */ status?: BillStatus | null | undefined; ledgerAccount?: LinkedLedgerAccountInput | null | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * language code according to ISO 639-1. For the United States - EN */ language?: string | null | 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; bankAccount?: BankAccount | undefined; /** * Discount percentage applied to this transaction. */ discountPercentage?: number | 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; /** * Accounting period */ accountingPeriod?: string | null | undefined; }; /** @internal */ export const BillStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(BillStatus); /** @internal */ export const BillStatus$outboundSchema: z.ZodNativeEnum = BillStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BillStatus$ { /** @deprecated use `BillStatus$inboundSchema` instead. */ export const inboundSchema = BillStatus$inboundSchema; /** @deprecated use `BillStatus$outboundSchema` instead. */ export const outboundSchema = BillStatus$outboundSchema; } /** @internal */ export const Bill$inboundSchema: z.ZodType = z .object({ id: z.string().optional(), downstream_id: z.nullable(z.string()).optional(), bill_number: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplier$inboundSchema).optional(), company_id: z.nullable(z.string()).optional(), currency: z.nullable(Currency$inboundSchema).optional(), currency_rate: z.nullable(z.number()).optional(), tax_inclusive: z.nullable(z.boolean()).optional(), bill_date: z.string().transform(v => new RFCDate(v)).optional(), due_date: z.string().transform(v => new RFCDate(v)).optional(), paid_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(), po_number: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), line_items: z.array(BillLineItem$inboundSchema).optional(), terms: z.nullable(z.string()).optional(), balance: z.nullable(z.number()).optional(), deposit: 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_code: z.nullable(z.string()).optional(), notes: z.nullable(z.string()).optional(), status: z.nullable(BillStatus$inboundSchema).optional(), ledger_account: z.nullable(LinkedLedgerAccount$inboundSchema).optional(), payment_method: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), language: z.nullable(z.string()).optional(), accounting_by_row: z.nullable(z.boolean()).optional(), bank_account: BankAccount$inboundSchema.optional(), discount_percentage: z.nullable(z.number()).optional(), tracking_categories: z.nullable( z.array(LinkedTrackingCategory$inboundSchema), ).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(), row_version: z.nullable(z.string()).optional(), custom_mappings: z.nullable(CustomMappings$inboundSchema).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), accounting_period: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "downstream_id": "downstreamId", "bill_number": "billNumber", "company_id": "companyId", "currency_rate": "currencyRate", "tax_inclusive": "taxInclusive", "bill_date": "billDate", "due_date": "dueDate", "paid_date": "paidDate", "po_number": "poNumber", "line_items": "lineItems", "sub_total": "subTotal", "total_tax": "totalTax", "tax_code": "taxCode", "ledger_account": "ledgerAccount", "payment_method": "paymentMethod", "accounting_by_row": "accountingByRow", "bank_account": "bankAccount", "discount_percentage": "discountPercentage", "tracking_categories": "trackingCategories", "updated_by": "updatedBy", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "row_version": "rowVersion", "custom_mappings": "customMappings", "pass_through": "passThrough", "accounting_period": "accountingPeriod", }); }); /** @internal */ export type Bill$Outbound = { id?: string | undefined; downstream_id?: string | null | undefined; bill_number?: string | null | undefined; supplier?: LinkedSupplier$Outbound | null | undefined; company_id?: string | null | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; tax_inclusive?: boolean | null | undefined; bill_date?: string | undefined; due_date?: string | undefined; paid_date?: string | null | undefined; po_number?: string | null | undefined; reference?: string | null | undefined; line_items?: Array | undefined; terms?: string | null | undefined; balance?: number | null | undefined; deposit?: number | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; total?: number | null | undefined; tax_code?: string | null | undefined; notes?: string | null | undefined; status?: string | null | undefined; ledger_account?: LinkedLedgerAccount$Outbound | null | undefined; payment_method?: string | null | undefined; channel?: string | null | undefined; language?: string | null | undefined; accounting_by_row?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; discount_percentage?: number | null | undefined; tracking_categories?: | Array | null | undefined; updated_by?: string | null | undefined; created_by?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; row_version?: string | null | undefined; custom_mappings?: CustomMappings$Outbound | null | undefined; pass_through?: Array | undefined; accounting_period?: string | null | undefined; }; /** @internal */ export const Bill$outboundSchema: z.ZodType = z.object({ id: z.string().optional(), downstreamId: z.nullable(z.string()).optional(), billNumber: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplier$outboundSchema).optional(), companyId: z.nullable(z.string()).optional(), currency: z.nullable(Currency$outboundSchema).optional(), currencyRate: z.nullable(z.number()).optional(), taxInclusive: z.nullable(z.boolean()).optional(), billDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), dueDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), paidDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), poNumber: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), lineItems: z.array(BillLineItem$outboundSchema).optional(), terms: z.nullable(z.string()).optional(), balance: z.nullable(z.number()).optional(), deposit: z.nullable(z.number()).optional(), subTotal: z.nullable(z.number()).optional(), totalTax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), taxCode: z.nullable(z.string()).optional(), notes: z.nullable(z.string()).optional(), status: z.nullable(BillStatus$outboundSchema).optional(), ledgerAccount: z.nullable(LinkedLedgerAccount$outboundSchema).optional(), paymentMethod: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), language: z.nullable(z.string()).optional(), accountingByRow: z.nullable(z.boolean()).optional(), bankAccount: BankAccount$outboundSchema.optional(), discountPercentage: z.nullable(z.number()).optional(), trackingCategories: z.nullable( z.array(LinkedTrackingCategory$outboundSchema), ).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(), rowVersion: z.nullable(z.string()).optional(), customMappings: z.nullable(CustomMappings$outboundSchema).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), accountingPeriod: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { downstreamId: "downstream_id", billNumber: "bill_number", companyId: "company_id", currencyRate: "currency_rate", taxInclusive: "tax_inclusive", billDate: "bill_date", dueDate: "due_date", paidDate: "paid_date", poNumber: "po_number", lineItems: "line_items", subTotal: "sub_total", totalTax: "total_tax", taxCode: "tax_code", ledgerAccount: "ledger_account", paymentMethod: "payment_method", accountingByRow: "accounting_by_row", bankAccount: "bank_account", discountPercentage: "discount_percentage", trackingCategories: "tracking_categories", updatedBy: "updated_by", createdBy: "created_by", updatedAt: "updated_at", createdAt: "created_at", rowVersion: "row_version", customMappings: "custom_mappings", passThrough: "pass_through", accountingPeriod: "accounting_period", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Bill$ { /** @deprecated use `Bill$inboundSchema` instead. */ export const inboundSchema = Bill$inboundSchema; /** @deprecated use `Bill$outboundSchema` instead. */ export const outboundSchema = Bill$outboundSchema; /** @deprecated use `Bill$Outbound` instead. */ export type Outbound = Bill$Outbound; } export function billToJSON(bill: Bill): string { return JSON.stringify(Bill$outboundSchema.parse(bill)); } export function billFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Bill$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bill' from JSON`, ); } /** @internal */ export const BillInput$inboundSchema: z.ZodType< BillInput, z.ZodTypeDef, unknown > = z.object({ bill_number: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplierInput$inboundSchema).optional(), company_id: z.nullable(z.string()).optional(), currency: z.nullable(Currency$inboundSchema).optional(), currency_rate: z.nullable(z.number()).optional(), tax_inclusive: z.nullable(z.boolean()).optional(), bill_date: z.string().transform(v => new RFCDate(v)).optional(), due_date: z.string().transform(v => new RFCDate(v)).optional(), paid_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(), po_number: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), line_items: z.array(BillLineItemInput$inboundSchema).optional(), terms: z.nullable(z.string()).optional(), balance: z.nullable(z.number()).optional(), deposit: 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_code: z.nullable(z.string()).optional(), notes: z.nullable(z.string()).optional(), status: z.nullable(BillStatus$inboundSchema).optional(), ledger_account: z.nullable(LinkedLedgerAccountInput$inboundSchema).optional(), payment_method: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), language: z.nullable(z.string()).optional(), accounting_by_row: z.nullable(z.boolean()).optional(), bank_account: BankAccount$inboundSchema.optional(), discount_percentage: z.nullable(z.number()).optional(), tracking_categories: z.nullable(z.array(LinkedTrackingCategory$inboundSchema)) .optional(), row_version: z.nullable(z.string()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), accounting_period: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "bill_number": "billNumber", "company_id": "companyId", "currency_rate": "currencyRate", "tax_inclusive": "taxInclusive", "bill_date": "billDate", "due_date": "dueDate", "paid_date": "paidDate", "po_number": "poNumber", "line_items": "lineItems", "sub_total": "subTotal", "total_tax": "totalTax", "tax_code": "taxCode", "ledger_account": "ledgerAccount", "payment_method": "paymentMethod", "accounting_by_row": "accountingByRow", "bank_account": "bankAccount", "discount_percentage": "discountPercentage", "tracking_categories": "trackingCategories", "row_version": "rowVersion", "pass_through": "passThrough", "accounting_period": "accountingPeriod", }); }); /** @internal */ export type BillInput$Outbound = { bill_number?: string | null | undefined; supplier?: LinkedSupplierInput$Outbound | null | undefined; company_id?: string | null | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; tax_inclusive?: boolean | null | undefined; bill_date?: string | undefined; due_date?: string | undefined; paid_date?: string | null | undefined; po_number?: string | null | undefined; reference?: string | null | undefined; line_items?: Array | undefined; terms?: string | null | undefined; balance?: number | null | undefined; deposit?: number | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; total?: number | null | undefined; tax_code?: string | null | undefined; notes?: string | null | undefined; status?: string | null | undefined; ledger_account?: LinkedLedgerAccountInput$Outbound | null | undefined; payment_method?: string | null | undefined; channel?: string | null | undefined; language?: string | null | undefined; accounting_by_row?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; discount_percentage?: number | null | undefined; tracking_categories?: | Array | null | undefined; row_version?: string | null | undefined; pass_through?: Array | undefined; accounting_period?: string | null | undefined; }; /** @internal */ export const BillInput$outboundSchema: z.ZodType< BillInput$Outbound, z.ZodTypeDef, BillInput > = z.object({ billNumber: z.nullable(z.string()).optional(), supplier: z.nullable(LinkedSupplierInput$outboundSchema).optional(), companyId: z.nullable(z.string()).optional(), currency: z.nullable(Currency$outboundSchema).optional(), currencyRate: z.nullable(z.number()).optional(), taxInclusive: z.nullable(z.boolean()).optional(), billDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), dueDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), paidDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString())) .optional(), poNumber: z.nullable(z.string()).optional(), reference: z.nullable(z.string()).optional(), lineItems: z.array(BillLineItemInput$outboundSchema).optional(), terms: z.nullable(z.string()).optional(), balance: z.nullable(z.number()).optional(), deposit: z.nullable(z.number()).optional(), subTotal: z.nullable(z.number()).optional(), totalTax: z.nullable(z.number()).optional(), total: z.nullable(z.number()).optional(), taxCode: z.nullable(z.string()).optional(), notes: z.nullable(z.string()).optional(), status: z.nullable(BillStatus$outboundSchema).optional(), ledgerAccount: z.nullable(LinkedLedgerAccountInput$outboundSchema).optional(), paymentMethod: z.nullable(z.string()).optional(), channel: z.nullable(z.string()).optional(), language: z.nullable(z.string()).optional(), accountingByRow: z.nullable(z.boolean()).optional(), bankAccount: BankAccount$outboundSchema.optional(), discountPercentage: z.nullable(z.number()).optional(), trackingCategories: z.nullable(z.array(LinkedTrackingCategory$outboundSchema)) .optional(), rowVersion: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), accountingPeriod: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { billNumber: "bill_number", companyId: "company_id", currencyRate: "currency_rate", taxInclusive: "tax_inclusive", billDate: "bill_date", dueDate: "due_date", paidDate: "paid_date", poNumber: "po_number", lineItems: "line_items", subTotal: "sub_total", totalTax: "total_tax", taxCode: "tax_code", ledgerAccount: "ledger_account", paymentMethod: "payment_method", accountingByRow: "accounting_by_row", bankAccount: "bank_account", discountPercentage: "discount_percentage", trackingCategories: "tracking_categories", rowVersion: "row_version", passThrough: "pass_through", accountingPeriod: "accounting_period", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BillInput$ { /** @deprecated use `BillInput$inboundSchema` instead. */ export const inboundSchema = BillInput$inboundSchema; /** @deprecated use `BillInput$outboundSchema` instead. */ export const outboundSchema = BillInput$outboundSchema; /** @deprecated use `BillInput$Outbound` instead. */ export type Outbound = BillInput$Outbound; } export function billInputToJSON(billInput: BillInput): string { return JSON.stringify(BillInput$outboundSchema.parse(billInput)); } export function billInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BillInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BillInput' from JSON`, ); }