/* * 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"; /** * Country detail used for Dow Jones Profile details */ export type CountryDetail = { /** * Dow Jones persons country type */ countryType?: string | undefined; /** * Two character region code, complies with https://cldr.unicode.org/index Example values: "US", "CA" */ regionCode?: string | undefined; }; /** @internal */ export const CountryDetail$inboundSchema: z.ZodType< CountryDetail, z.ZodTypeDef, unknown > = z.object({ country_type: z.string().optional(), region_code: z.string().optional(), }).transform((v) => { return remap$(v, { "country_type": "countryType", "region_code": "regionCode", }); }); /** @internal */ export type CountryDetail$Outbound = { country_type?: string | undefined; region_code?: string | undefined; }; /** @internal */ export const CountryDetail$outboundSchema: z.ZodType< CountryDetail$Outbound, z.ZodTypeDef, CountryDetail > = z.object({ countryType: z.string().optional(), regionCode: z.string().optional(), }).transform((v) => { return remap$(v, { countryType: "country_type", 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 CountryDetail$ { /** @deprecated use `CountryDetail$inboundSchema` instead. */ export const inboundSchema = CountryDetail$inboundSchema; /** @deprecated use `CountryDetail$outboundSchema` instead. */ export const outboundSchema = CountryDetail$outboundSchema; /** @deprecated use `CountryDetail$Outbound` instead. */ export type Outbound = CountryDetail$Outbound; } export function countryDetailToJSON(countryDetail: CountryDetail): string { return JSON.stringify(CountryDetail$outboundSchema.parse(countryDetail)); } export function countryDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CountryDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountryDetail' from JSON`, ); }