/* * 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"; /** * Name detail used for Dow Jones Profile details */ export type NameDetail = { /** * Dow Jones persons first name */ givenName?: string | undefined; /** * Dow Jones persons middle name */ middleNames?: string | undefined; /** * Dow Jones persons name suffix */ nameSuffix?: string | undefined; /** * Dow Jones persons name type */ nameType?: string | undefined; /** * Dow Jones persons last name */ surname?: string | undefined; /** * Dow Jones persons title */ titleHonorific?: string | undefined; }; /** @internal */ export const NameDetail$inboundSchema: z.ZodType< NameDetail, z.ZodTypeDef, unknown > = z.object({ given_name: z.string().optional(), middle_names: z.string().optional(), name_suffix: z.string().optional(), name_type: z.string().optional(), surname: z.string().optional(), title_honorific: z.string().optional(), }).transform((v) => { return remap$(v, { "given_name": "givenName", "middle_names": "middleNames", "name_suffix": "nameSuffix", "name_type": "nameType", "title_honorific": "titleHonorific", }); }); /** @internal */ export type NameDetail$Outbound = { given_name?: string | undefined; middle_names?: string | undefined; name_suffix?: string | undefined; name_type?: string | undefined; surname?: string | undefined; title_honorific?: string | undefined; }; /** @internal */ export const NameDetail$outboundSchema: z.ZodType< NameDetail$Outbound, z.ZodTypeDef, NameDetail > = z.object({ givenName: z.string().optional(), middleNames: z.string().optional(), nameSuffix: z.string().optional(), nameType: z.string().optional(), surname: z.string().optional(), titleHonorific: z.string().optional(), }).transform((v) => { return remap$(v, { givenName: "given_name", middleNames: "middle_names", nameSuffix: "name_suffix", nameType: "name_type", titleHonorific: "title_honorific", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NameDetail$ { /** @deprecated use `NameDetail$inboundSchema` instead. */ export const inboundSchema = NameDetail$inboundSchema; /** @deprecated use `NameDetail$outboundSchema` instead. */ export const outboundSchema = NameDetail$outboundSchema; /** @deprecated use `NameDetail$Outbound` instead. */ export type Outbound = NameDetail$Outbound; } export function nameDetailToJSON(nameDetail: NameDetail): string { return JSON.stringify(NameDetail$outboundSchema.parse(nameDetail)); } export function nameDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NameDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NameDetail' from JSON`, ); }