/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; /** * Address detail used for Dow Jones Profile details */ export type AddressDetail = { /** * Dow Jones persons address city */ addressCity?: string | undefined; /** * Dow Jones persons address line */ addressLine?: string | undefined; /** * Dow Jones persons address administrative area */ administrativeArea?: string | undefined; /** * Dow Jones persons address postal code */ postalCode?: string | undefined; /** * Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ regionCode?: string | undefined; }; /** @internal */ export const AddressDetail$inboundSchema: z.ZodType< AddressDetail, z.ZodTypeDef, unknown > = z.object({ address_city: z.string().optional(), address_line: z.string().optional(), administrative_area: z.string().optional(), postal_code: z.string().optional(), region_code: z.string().optional(), }).transform((v) => { return remap$(v, { "address_city": "addressCity", "address_line": "addressLine", "administrative_area": "administrativeArea", "postal_code": "postalCode", "region_code": "regionCode", }); }); /** @internal */ export type AddressDetail$Outbound = { address_city?: string | undefined; address_line?: string | undefined; administrative_area?: string | undefined; postal_code?: string | undefined; region_code?: string | undefined; }; /** @internal */ export const AddressDetail$outboundSchema: z.ZodType< AddressDetail$Outbound, z.ZodTypeDef, AddressDetail > = z.object({ addressCity: z.string().optional(), addressLine: z.string().optional(), administrativeArea: z.string().optional(), postalCode: z.string().optional(), regionCode: z.string().optional(), }).transform((v) => { return remap$(v, { addressCity: "address_city", addressLine: "address_line", administrativeArea: "administrative_area", postalCode: "postal_code", regionCode: "region_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AddressDetail$ { /** @deprecated use `AddressDetail$inboundSchema` instead. */ export const inboundSchema = AddressDetail$inboundSchema; /** @deprecated use `AddressDetail$outboundSchema` instead. */ export const outboundSchema = AddressDetail$outboundSchema; /** @deprecated use `AddressDetail$Outbound` instead. */ export type Outbound = AddressDetail$Outbound; } export function addressDetailToJSON(addressDetail: AddressDetail): string { return JSON.stringify(AddressDetail$outboundSchema.parse(addressDetail)); } export function addressDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddressDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddressDetail' from JSON`, ); }