/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { smartUnion } from "../../types/smartUnion.js"; import { AddressInput, AddressInput$Outbound, AddressInput$outboundSchema, } from "./addressinput.js"; export type CustomerUpdateExternalIDMetadata = | string | number | number | boolean; export type CustomerUpdateExternalID = { /** * Key-value object allowing you to store additional information. * * @remarks * * The key must be a string with a maximum length of **40 characters**. * The value must be either: * * * A string with a maximum length of **500 characters** * * An integer * * A floating-point number * * A boolean * * You can store up to **50 key-value pairs**. */ metadata?: { [k: string]: string | number | number | boolean } | undefined; /** * The email address of the customer. This must be unique within the organization. */ email?: string | null | undefined; name?: string | null | undefined; billingAddress?: AddressInput | null | undefined; taxId?: string | null | undefined; locale?: string | null | undefined; }; /** @internal */ export type CustomerUpdateExternalIDMetadata$Outbound = | string | number | number | boolean; /** @internal */ export const CustomerUpdateExternalIDMetadata$outboundSchema: z.ZodMiniType< CustomerUpdateExternalIDMetadata$Outbound, CustomerUpdateExternalIDMetadata > = smartUnion([z.string(), z.int(), z.number(), z.boolean()]); export function customerUpdateExternalIDMetadataToJSON( customerUpdateExternalIDMetadata: CustomerUpdateExternalIDMetadata, ): string { return JSON.stringify( CustomerUpdateExternalIDMetadata$outboundSchema.parse( customerUpdateExternalIDMetadata, ), ); } /** @internal */ export type CustomerUpdateExternalID$Outbound = { metadata?: { [k: string]: string | number | number | boolean } | undefined; email?: string | null | undefined; name?: string | null | undefined; billing_address?: AddressInput$Outbound | null | undefined; tax_id?: string | null | undefined; locale?: string | null | undefined; }; /** @internal */ export const CustomerUpdateExternalID$outboundSchema: z.ZodMiniType< CustomerUpdateExternalID$Outbound, CustomerUpdateExternalID > = z.pipe( z.object({ metadata: z.optional( z.record( z.string(), smartUnion([z.string(), z.int(), z.number(), z.boolean()]), ), ), email: z.optional(z.nullable(z.string())), name: z.optional(z.nullable(z.string())), billingAddress: z.optional(z.nullable(AddressInput$outboundSchema)), taxId: z.optional(z.nullable(z.string())), locale: z.optional(z.nullable(z.string())), }), z.transform((v) => { return remap$(v, { billingAddress: "billing_address", taxId: "tax_id", }); }), ); export function customerUpdateExternalIDToJSON( customerUpdateExternalID: CustomerUpdateExternalID, ): string { return JSON.stringify( CustomerUpdateExternalID$outboundSchema.parse(customerUpdateExternalID), ); }