/* * 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 { BillingDetails, BillingDetails$Outbound, BillingDetails$outboundSchema, } from "./billingdetails.js"; /** * Request body for creating a new buyer */ export type BuyerCreate = { /** * The display name for the buyer. */ displayName?: string | null | undefined; /** * The merchant identifier for this buyer. */ externalIdentifier?: string | null | undefined; /** * The billing name, address, email, and other fields for this buyer. */ billingDetails?: BillingDetails | null | undefined; /** * The buyer account number */ accountNumber?: string | null | undefined; }; /** @internal */ export type BuyerCreate$Outbound = { display_name?: string | null | undefined; external_identifier?: string | null | undefined; billing_details?: BillingDetails$Outbound | null | undefined; account_number?: string | null | undefined; }; /** @internal */ export const BuyerCreate$outboundSchema: z.ZodType< BuyerCreate$Outbound, z.ZodTypeDef, BuyerCreate > = z.object({ displayName: z.nullable(z.string()).optional(), externalIdentifier: z.nullable(z.string()).optional(), billingDetails: z.nullable(BillingDetails$outboundSchema).optional(), accountNumber: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { displayName: "display_name", externalIdentifier: "external_identifier", billingDetails: "billing_details", accountNumber: "account_number", }); }); export function buyerCreateToJSON(buyerCreate: BuyerCreate): string { return JSON.stringify(BuyerCreate$outboundSchema.parse(buyerCreate)); }