/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AccountsUpdateLegalNaturalPersonRequest = { /** * The legalNaturalPerson id. */ legalNaturalPersonId: string; /** * The list of fields to update. Updatable Fields `marital_status` `citizenship_countries` `personal_address.address_lines` `personal_address.locality` `personal_address.administrative_area` `personal_address.region_code` `personal_address.postal_code` `control_person_company_symbols` `finra_associated_entity` `politically_exposed_organization` `politically_exposed_immediate_family_names` `correspondent_employee` `employment.employer` `employment.occupation` `employment.start_year` `employment.employment_status` `employment.employer_address.address_lines` `employment.employer_address.locality` `employment.employer_address.administrative_area` `employment.employer_address.region_code` `employment.employer_address.postal_code` `given_name` `middle_names` `family_name` `name_suffix` `tax_id` `tax_id_type` `birth_date.year` `birth_date.month` `birth_date.day` `identity_verification_result.raw_vendor_data_document_id` `identity_verification_result.identity_verification_document_ids` `accredited_investor` `adviser` `institutional_customer` `foreign_identification.ftin` `foreign_identification.identification_number` `foreign_identification.issuing_region_code` `foreign_identification.type` `foreign_identification.issue_date.year` `foreign_identification.issue_date.month` `foreign_identification.issue_date.day` `foreign_identification.expiration_date.year` `foreign_identification.expiration_date.month` `foreign_identification.expiration_date.day` `tax_profile.withholding_state` `natural_person_fdd.customer_referral_source.name` `natural_person_fdd.customer_referral_source.relationship_to_applicant` `natural_person_fdd.customer_referral_source.relationship_years_with_applicant` `natural_person_fdd.customer_referral_source.relationship_years_with_broker` `natural_person_fdd.customer_non_referral_source` `natural_person_fdd.employment_and_employer_description` `natural_person_fdd.negative_news.negative_news_against_related_parties` `natural_person_fdd.negative_news.negative_news_against_related_parties_description` `natural_person_fdd.other_sources_of_wealth.applicant_has_other_sources_of_wealth` `natural_person_fdd.other_sources_of_wealth.other_sources_of_wealth` `natural_person_fdd.other_sources_of_wealth.other_sources_of_wealth_verification` `doing_business_as` `non_citizen_residency.residency_status` */ updateMask?: string | undefined; legalNaturalPersonUpdate: components.LegalNaturalPersonUpdate; }; export type AccountsUpdateLegalNaturalPersonResponse = { httpMeta: components.HTTPMetadata; /** * OK */ legalNaturalPerson?: components.LegalNaturalPerson | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsUpdateLegalNaturalPersonRequest$inboundSchema: z.ZodType< AccountsUpdateLegalNaturalPersonRequest, z.ZodTypeDef, unknown > = z.object({ legalNaturalPerson_id: z.string(), update_mask: z.string().optional(), LegalNaturalPersonUpdate: components.LegalNaturalPersonUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "legalNaturalPerson_id": "legalNaturalPersonId", "update_mask": "updateMask", "LegalNaturalPersonUpdate": "legalNaturalPersonUpdate", }); }); /** @internal */ export type AccountsUpdateLegalNaturalPersonRequest$Outbound = { legalNaturalPerson_id: string; update_mask?: string | undefined; LegalNaturalPersonUpdate: components.LegalNaturalPersonUpdate$Outbound; }; /** @internal */ export const AccountsUpdateLegalNaturalPersonRequest$outboundSchema: z.ZodType< AccountsUpdateLegalNaturalPersonRequest$Outbound, z.ZodTypeDef, AccountsUpdateLegalNaturalPersonRequest > = z.object({ legalNaturalPersonId: z.string(), updateMask: z.string().optional(), legalNaturalPersonUpdate: components.LegalNaturalPersonUpdate$outboundSchema, }).transform((v) => { return remap$(v, { legalNaturalPersonId: "legalNaturalPerson_id", updateMask: "update_mask", legalNaturalPersonUpdate: "LegalNaturalPersonUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsUpdateLegalNaturalPersonRequest$ { /** @deprecated use `AccountsUpdateLegalNaturalPersonRequest$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateLegalNaturalPersonRequest$inboundSchema; /** @deprecated use `AccountsUpdateLegalNaturalPersonRequest$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateLegalNaturalPersonRequest$outboundSchema; /** @deprecated use `AccountsUpdateLegalNaturalPersonRequest$Outbound` instead. */ export type Outbound = AccountsUpdateLegalNaturalPersonRequest$Outbound; } export function accountsUpdateLegalNaturalPersonRequestToJSON( accountsUpdateLegalNaturalPersonRequest: AccountsUpdateLegalNaturalPersonRequest, ): string { return JSON.stringify( AccountsUpdateLegalNaturalPersonRequest$outboundSchema.parse( accountsUpdateLegalNaturalPersonRequest, ), ); } export function accountsUpdateLegalNaturalPersonRequestFromJSON( jsonString: string, ): SafeParseResult< AccountsUpdateLegalNaturalPersonRequest, SDKValidationError > { return safeParse( jsonString, (x) => AccountsUpdateLegalNaturalPersonRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsUpdateLegalNaturalPersonRequest' from JSON`, ); } /** @internal */ export const AccountsUpdateLegalNaturalPersonResponse$inboundSchema: z.ZodType< AccountsUpdateLegalNaturalPersonResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LegalNaturalPerson: components.LegalNaturalPerson$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LegalNaturalPerson": "legalNaturalPerson", "Status": "status", }); }); /** @internal */ export type AccountsUpdateLegalNaturalPersonResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LegalNaturalPerson?: components.LegalNaturalPerson$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsUpdateLegalNaturalPersonResponse$outboundSchema: z.ZodType< AccountsUpdateLegalNaturalPersonResponse$Outbound, z.ZodTypeDef, AccountsUpdateLegalNaturalPersonResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, legalNaturalPerson: components.LegalNaturalPerson$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", legalNaturalPerson: "LegalNaturalPerson", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsUpdateLegalNaturalPersonResponse$ { /** @deprecated use `AccountsUpdateLegalNaturalPersonResponse$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateLegalNaturalPersonResponse$inboundSchema; /** @deprecated use `AccountsUpdateLegalNaturalPersonResponse$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateLegalNaturalPersonResponse$outboundSchema; /** @deprecated use `AccountsUpdateLegalNaturalPersonResponse$Outbound` instead. */ export type Outbound = AccountsUpdateLegalNaturalPersonResponse$Outbound; } export function accountsUpdateLegalNaturalPersonResponseToJSON( accountsUpdateLegalNaturalPersonResponse: AccountsUpdateLegalNaturalPersonResponse, ): string { return JSON.stringify( AccountsUpdateLegalNaturalPersonResponse$outboundSchema.parse( accountsUpdateLegalNaturalPersonResponse, ), ); } export function accountsUpdateLegalNaturalPersonResponseFromJSON( jsonString: string, ): SafeParseResult< AccountsUpdateLegalNaturalPersonResponse, SDKValidationError > { return safeParse( jsonString, (x) => AccountsUpdateLegalNaturalPersonResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsUpdateLegalNaturalPersonResponse' from JSON`, ); }