/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { EntityIntegrationMappingResponse, EntityIntegrationMappingResponse$inboundSchema, } from "./entity-integration-mapping-response.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; /** * Customer response object containing all customer information */ export type CustomerResponse = { /** * AddressCity is the city of the customer's address */ addressCity?: string | undefined; /** * AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2) */ addressCountry?: string | undefined; /** * AddressLine1 is the first line of the customer's address */ addressLine1?: string | undefined; /** * AddressLine2 is the second line of the customer's address */ addressLine2?: string | undefined; /** * AddressPostalCode is the postal code of the customer's address */ addressPostalCode?: string | undefined; /** * AddressState is the state of the customer's address */ addressState?: string | undefined; /** * Contact is an optional contact number for the customer (e.g. phone) */ contact?: string | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; /** * Email is the email of the customer */ email?: string | undefined; /** * EnvironmentID is the environment identifier for the customer */ environmentId?: string | undefined; /** * ExternalID is the external identifier for the customer */ externalId?: string | undefined; /** * ID is the unique identifier for the customer */ id?: string | undefined; integrations?: Array | undefined; /** * Metadata */ metadata?: { [k: string]: string } | undefined; /** * Name is the name of the customer */ name?: string | undefined; status?: Status | undefined; tenantId?: string | undefined; /** * Timezone is the customer's IANA timezone name (e.g. "Asia/Kolkata"). * * @remarks * Defaults to "UTC". Inherited by subscriptions at creation time. */ timezone?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const CustomerResponse$inboundSchema: z.ZodMiniType< CustomerResponse, unknown > = z.pipe( z.object({ address_city: types.optional(types.string()), address_country: types.optional(types.string()), address_line1: types.optional(types.string()), address_line2: types.optional(types.string()), address_postal_code: types.optional(types.string()), address_state: types.optional(types.string()), contact: types.optional(types.string()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), email: types.optional(types.string()), environment_id: types.optional(types.string()), external_id: types.optional(types.string()), id: types.optional(types.string()), integrations: types.optional( z.array(EntityIntegrationMappingResponse$inboundSchema), ), metadata: types.optional(z.record(z.string(), types.string())), name: types.optional(types.string()), status: types.optional(Status$inboundSchema), tenant_id: types.optional(types.string()), timezone: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "address_city": "addressCity", "address_country": "addressCountry", "address_line1": "addressLine1", "address_line2": "addressLine2", "address_postal_code": "addressPostalCode", "address_state": "addressState", "created_at": "createdAt", "created_by": "createdBy", "environment_id": "environmentId", "external_id": "externalId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function customerResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomerResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomerResponse' from JSON`, ); }