/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Information to show the user on their payments statement */ export type StatementDescriptor = { /** * Reflects your doing business as (DBA) name. */ name?: string | null | undefined; /** * A short description about the purchase. */ description?: string | null | undefined; /** * The merchant's city to be displayed in a statement descriptor. */ city?: string | null | undefined; /** * The 2-letter ISO country code of the merchant to be displayed in a statement descriptor. */ country?: string | null | undefined; /** * The value in the phone number field of a customer's statement which should be formatted according to the E164 number standard. */ phoneNumber?: string | null | undefined; /** * The merchant's URL to be displayed in a statement descriptor. */ url?: string | null | undefined; /** * The merchant's postal code or zip code. */ postalCode?: string | null | undefined; }; /** @internal */ export const StatementDescriptor$inboundSchema: z.ZodType< StatementDescriptor, z.ZodTypeDef, unknown > = z.object({ name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), city: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), phone_number: z.nullable(z.string()).optional(), url: z.nullable(z.string()).optional(), postal_code: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "phone_number": "phoneNumber", "postal_code": "postalCode", }); }); /** @internal */ export type StatementDescriptor$Outbound = { name?: string | null | undefined; description?: string | null | undefined; city?: string | null | undefined; country?: string | null | undefined; phone_number?: string | null | undefined; url?: string | null | undefined; postal_code?: string | null | undefined; }; /** @internal */ export const StatementDescriptor$outboundSchema: z.ZodType< StatementDescriptor$Outbound, z.ZodTypeDef, StatementDescriptor > = z.object({ name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), city: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), phoneNumber: z.nullable(z.string()).optional(), url: z.nullable(z.string()).optional(), postalCode: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { phoneNumber: "phone_number", postalCode: "postal_code", }); }); export function statementDescriptorToJSON( statementDescriptor: StatementDescriptor, ): string { return JSON.stringify( StatementDescriptor$outboundSchema.parse(statementDescriptor), ); } export function statementDescriptorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StatementDescriptor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StatementDescriptor' from JSON`, ); }