/* * 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 AccountsUpdateLegalEntityRequest = { /** * The legalEntity id. */ legalEntityId: string; /** * The list of fields to update. Updatable Fields `for_the_benefit_of` `tax_profile.withholding_state` `formation_date` `broker_dealer` `legal_address.address_lines` `legal_address.locality` `legal_address.administrative_area` `legal_address.region_code` `legal_address.postal_code` `exempt_verifying_beneficial_owners` `exempt_customer_reason` `foreign_financial_institution` `accredited_investor` `adviser` `regulated_investment_company` `lei_code` `entity_name` `tax_id` `tax_id_type` `institutional_customer` `operating_regions` `doing_business_as` `related_document_ids` `business_industrial_classification` `entity_due_diligence.negative_news.negative_news_against_related_parties` `entity_due_diligence.negative_news.negative_news_against_related_parties_description` */ updateMask?: string | undefined; legalEntityUpdate: components.LegalEntityUpdate; }; export type AccountsUpdateLegalEntityResponse = { httpMeta: components.HTTPMetadata; /** * OK */ legalEntity?: components.LegalEntity | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsUpdateLegalEntityRequest$inboundSchema: z.ZodType< AccountsUpdateLegalEntityRequest, z.ZodTypeDef, unknown > = z.object({ legalEntity_id: z.string(), update_mask: z.string().optional(), LegalEntityUpdate: components.LegalEntityUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "legalEntity_id": "legalEntityId", "update_mask": "updateMask", "LegalEntityUpdate": "legalEntityUpdate", }); }); /** @internal */ export type AccountsUpdateLegalEntityRequest$Outbound = { legalEntity_id: string; update_mask?: string | undefined; LegalEntityUpdate: components.LegalEntityUpdate$Outbound; }; /** @internal */ export const AccountsUpdateLegalEntityRequest$outboundSchema: z.ZodType< AccountsUpdateLegalEntityRequest$Outbound, z.ZodTypeDef, AccountsUpdateLegalEntityRequest > = z.object({ legalEntityId: z.string(), updateMask: z.string().optional(), legalEntityUpdate: components.LegalEntityUpdate$outboundSchema, }).transform((v) => { return remap$(v, { legalEntityId: "legalEntity_id", updateMask: "update_mask", legalEntityUpdate: "LegalEntityUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsUpdateLegalEntityRequest$ { /** @deprecated use `AccountsUpdateLegalEntityRequest$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateLegalEntityRequest$inboundSchema; /** @deprecated use `AccountsUpdateLegalEntityRequest$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateLegalEntityRequest$outboundSchema; /** @deprecated use `AccountsUpdateLegalEntityRequest$Outbound` instead. */ export type Outbound = AccountsUpdateLegalEntityRequest$Outbound; } export function accountsUpdateLegalEntityRequestToJSON( accountsUpdateLegalEntityRequest: AccountsUpdateLegalEntityRequest, ): string { return JSON.stringify( AccountsUpdateLegalEntityRequest$outboundSchema.parse( accountsUpdateLegalEntityRequest, ), ); } export function accountsUpdateLegalEntityRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsUpdateLegalEntityRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsUpdateLegalEntityRequest' from JSON`, ); } /** @internal */ export const AccountsUpdateLegalEntityResponse$inboundSchema: z.ZodType< AccountsUpdateLegalEntityResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LegalEntity: components.LegalEntity$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LegalEntity": "legalEntity", "Status": "status", }); }); /** @internal */ export type AccountsUpdateLegalEntityResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LegalEntity?: components.LegalEntity$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsUpdateLegalEntityResponse$outboundSchema: z.ZodType< AccountsUpdateLegalEntityResponse$Outbound, z.ZodTypeDef, AccountsUpdateLegalEntityResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, legalEntity: components.LegalEntity$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", legalEntity: "LegalEntity", 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 AccountsUpdateLegalEntityResponse$ { /** @deprecated use `AccountsUpdateLegalEntityResponse$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateLegalEntityResponse$inboundSchema; /** @deprecated use `AccountsUpdateLegalEntityResponse$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateLegalEntityResponse$outboundSchema; /** @deprecated use `AccountsUpdateLegalEntityResponse$Outbound` instead. */ export type Outbound = AccountsUpdateLegalEntityResponse$Outbound; } export function accountsUpdateLegalEntityResponseToJSON( accountsUpdateLegalEntityResponse: AccountsUpdateLegalEntityResponse, ): string { return JSON.stringify( AccountsUpdateLegalEntityResponse$outboundSchema.parse( accountsUpdateLegalEntityResponse, ), ); } export function accountsUpdateLegalEntityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsUpdateLegalEntityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsUpdateLegalEntityResponse' from JSON`, ); }