/* * 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"; import { DescriptionDetail, DescriptionDetail$inboundSchema, DescriptionDetail$Outbound, DescriptionDetail$outboundSchema, } from "./descriptiondetail.js"; import { SanctionsListDetail, SanctionsListDetail$inboundSchema, SanctionsListDetail$Outbound, SanctionsListDetail$outboundSchema, } from "./sanctionslistdetail.js"; /** * Profiles related to dow jones profile */ export type RelatedProfile = { /** * Description details */ descriptionDetails?: Array | undefined; /** * Dow Jones person id */ dowJonesPersonId?: number | undefined; /** * Given name relating to profile */ givenName?: string | undefined; /** * Middle names relating to profile */ middleNames?: string | undefined; /** * Surname relating to profile */ nameSuffix?: string | undefined; /** * Relationship type */ relationshipType?: string | undefined; /** * Sanctions list details */ sanctionsListDetails?: Array | undefined; /** * Surname relating to profile */ surname?: string | undefined; /** * Dow Jones persons title */ titleHonorific?: string | undefined; }; /** @internal */ export const RelatedProfile$inboundSchema: z.ZodType< RelatedProfile, z.ZodTypeDef, unknown > = z.object({ description_details: z.array(DescriptionDetail$inboundSchema).optional(), dow_jones_person_id: z.number().int().optional(), given_name: z.string().optional(), middle_names: z.string().optional(), name_suffix: z.string().optional(), relationship_type: z.string().optional(), sanctions_list_details: z.array(SanctionsListDetail$inboundSchema).optional(), surname: z.string().optional(), title_honorific: z.string().optional(), }).transform((v) => { return remap$(v, { "description_details": "descriptionDetails", "dow_jones_person_id": "dowJonesPersonId", "given_name": "givenName", "middle_names": "middleNames", "name_suffix": "nameSuffix", "relationship_type": "relationshipType", "sanctions_list_details": "sanctionsListDetails", "title_honorific": "titleHonorific", }); }); /** @internal */ export type RelatedProfile$Outbound = { description_details?: Array | undefined; dow_jones_person_id?: number | undefined; given_name?: string | undefined; middle_names?: string | undefined; name_suffix?: string | undefined; relationship_type?: string | undefined; sanctions_list_details?: Array | undefined; surname?: string | undefined; title_honorific?: string | undefined; }; /** @internal */ export const RelatedProfile$outboundSchema: z.ZodType< RelatedProfile$Outbound, z.ZodTypeDef, RelatedProfile > = z.object({ descriptionDetails: z.array(DescriptionDetail$outboundSchema).optional(), dowJonesPersonId: z.number().int().optional(), givenName: z.string().optional(), middleNames: z.string().optional(), nameSuffix: z.string().optional(), relationshipType: z.string().optional(), sanctionsListDetails: z.array(SanctionsListDetail$outboundSchema).optional(), surname: z.string().optional(), titleHonorific: z.string().optional(), }).transform((v) => { return remap$(v, { descriptionDetails: "description_details", dowJonesPersonId: "dow_jones_person_id", givenName: "given_name", middleNames: "middle_names", nameSuffix: "name_suffix", relationshipType: "relationship_type", sanctionsListDetails: "sanctions_list_details", 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 RelatedProfile$ { /** @deprecated use `RelatedProfile$inboundSchema` instead. */ export const inboundSchema = RelatedProfile$inboundSchema; /** @deprecated use `RelatedProfile$outboundSchema` instead. */ export const outboundSchema = RelatedProfile$outboundSchema; /** @deprecated use `RelatedProfile$Outbound` instead. */ export type Outbound = RelatedProfile$Outbound; } export function relatedProfileToJSON(relatedProfile: RelatedProfile): string { return JSON.stringify(RelatedProfile$outboundSchema.parse(relatedProfile)); } export function relatedProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RelatedProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RelatedProfile' from JSON`, ); }