/* * 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 { CreateEntityIntegrationMappingRequest, CreateEntityIntegrationMappingRequest$Outbound, CreateEntityIntegrationMappingRequest$outboundSchema, } from "./create-entity-integration-mapping-request.js"; /** * Request object for updating an existing customer. All fields are optional - only provided fields will be updated */ export type UpdateCustomerRequest = { /** * address_city is the updated city name with maximum 100 characters */ addressCity?: string | undefined; /** * address_country is the updated two-letter ISO 3166-1 alpha-2 country code */ addressCountry?: string | undefined; /** * address_line1 is the updated primary address line with maximum 255 characters */ addressLine1?: string | undefined; /** * address_line2 is the updated secondary address line with maximum 255 characters */ addressLine2?: string | undefined; /** * address_postal_code is the updated postal code with maximum 20 characters */ addressPostalCode?: string | undefined; /** * address_state is the updated state, province, or region name with maximum 100 characters */ addressState?: string | undefined; /** * contact is the updated contact number for the customer (e.g. phone) */ contact?: string | undefined; /** * email is the updated email address and must be a valid email format if provided */ email?: string | undefined; /** * external_id is the updated external identifier for the customer */ externalId?: string | undefined; /** * integration_entity_mapping contains provider integration mappings for this customer */ integrationEntityMapping?: | Array | undefined; /** * metadata contains updated key-value pairs that will replace existing metadata */ metadata?: { [k: string]: string } | undefined; /** * name is the updated name or company name for the customer */ name?: string | undefined; /** * timezone is the updated IANA timezone name for the customer (e.g. "Asia/Kolkata", "America/New_York") */ timezone?: string | undefined; }; /** @internal */ export type UpdateCustomerRequest$Outbound = { address_city?: string | undefined; address_country?: string | undefined; address_line1?: string | undefined; address_line2?: string | undefined; address_postal_code?: string | undefined; address_state?: string | undefined; contact?: string | undefined; email?: string | undefined; external_id?: string | undefined; integration_entity_mapping?: | Array | undefined; metadata?: { [k: string]: string } | undefined; name?: string | undefined; timezone?: string | undefined; }; /** @internal */ export const UpdateCustomerRequest$outboundSchema: z.ZodMiniType< UpdateCustomerRequest$Outbound, UpdateCustomerRequest > = z.pipe( z.object({ addressCity: z.optional(z.string()), addressCountry: z.optional(z.string()), addressLine1: z.optional(z.string()), addressLine2: z.optional(z.string()), addressPostalCode: z.optional(z.string()), addressState: z.optional(z.string()), contact: z.optional(z.string()), email: z.optional(z.string()), externalId: z.optional(z.string()), integrationEntityMapping: z.optional( z.array(CreateEntityIntegrationMappingRequest$outboundSchema), ), metadata: z.optional(z.record(z.string(), z.string())), name: z.optional(z.string()), timezone: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { addressCity: "address_city", addressCountry: "address_country", addressLine1: "address_line1", addressLine2: "address_line2", addressPostalCode: "address_postal_code", addressState: "address_state", externalId: "external_id", integrationEntityMapping: "integration_entity_mapping", }); }), ); export function updateCustomerRequestToJSON( updateCustomerRequest: UpdateCustomerRequest, ): string { return JSON.stringify( UpdateCustomerRequest$outboundSchema.parse(updateCustomerRequest), ); }