/* * 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 AccountsEndLargeTraderLegalNaturalPersonRequest = { /** * The legalNaturalPerson id. */ legalNaturalPersonId: string; endLargeTraderRequestCreate: components.EndLargeTraderRequestCreate; }; export type AccountsEndLargeTraderLegalNaturalPersonResponse = { httpMeta: components.HTTPMetadata; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsEndLargeTraderLegalNaturalPersonRequest$inboundSchema: z.ZodType< AccountsEndLargeTraderLegalNaturalPersonRequest, z.ZodTypeDef, unknown > = z.object({ legalNaturalPerson_id: z.string(), EndLargeTraderRequestCreate: components.EndLargeTraderRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "legalNaturalPerson_id": "legalNaturalPersonId", "EndLargeTraderRequestCreate": "endLargeTraderRequestCreate", }); }); /** @internal */ export type AccountsEndLargeTraderLegalNaturalPersonRequest$Outbound = { legalNaturalPerson_id: string; EndLargeTraderRequestCreate: components.EndLargeTraderRequestCreate$Outbound; }; /** @internal */ export const AccountsEndLargeTraderLegalNaturalPersonRequest$outboundSchema: z.ZodType< AccountsEndLargeTraderLegalNaturalPersonRequest$Outbound, z.ZodTypeDef, AccountsEndLargeTraderLegalNaturalPersonRequest > = z.object({ legalNaturalPersonId: z.string(), endLargeTraderRequestCreate: components.EndLargeTraderRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { legalNaturalPersonId: "legalNaturalPerson_id", endLargeTraderRequestCreate: "EndLargeTraderRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsEndLargeTraderLegalNaturalPersonRequest$ { /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonRequest$inboundSchema` instead. */ export const inboundSchema = AccountsEndLargeTraderLegalNaturalPersonRequest$inboundSchema; /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonRequest$outboundSchema` instead. */ export const outboundSchema = AccountsEndLargeTraderLegalNaturalPersonRequest$outboundSchema; /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonRequest$Outbound` instead. */ export type Outbound = AccountsEndLargeTraderLegalNaturalPersonRequest$Outbound; } export function accountsEndLargeTraderLegalNaturalPersonRequestToJSON( accountsEndLargeTraderLegalNaturalPersonRequest: AccountsEndLargeTraderLegalNaturalPersonRequest, ): string { return JSON.stringify( AccountsEndLargeTraderLegalNaturalPersonRequest$outboundSchema.parse( accountsEndLargeTraderLegalNaturalPersonRequest, ), ); } export function accountsEndLargeTraderLegalNaturalPersonRequestFromJSON( jsonString: string, ): SafeParseResult< AccountsEndLargeTraderLegalNaturalPersonRequest, SDKValidationError > { return safeParse( jsonString, (x) => AccountsEndLargeTraderLegalNaturalPersonRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsEndLargeTraderLegalNaturalPersonRequest' from JSON`, ); } /** @internal */ export const AccountsEndLargeTraderLegalNaturalPersonResponse$inboundSchema: z.ZodType< AccountsEndLargeTraderLegalNaturalPersonResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Status": "status", }); }); /** @internal */ export type AccountsEndLargeTraderLegalNaturalPersonResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsEndLargeTraderLegalNaturalPersonResponse$outboundSchema: z.ZodType< AccountsEndLargeTraderLegalNaturalPersonResponse$Outbound, z.ZodTypeDef, AccountsEndLargeTraderLegalNaturalPersonResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", 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 AccountsEndLargeTraderLegalNaturalPersonResponse$ { /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonResponse$inboundSchema` instead. */ export const inboundSchema = AccountsEndLargeTraderLegalNaturalPersonResponse$inboundSchema; /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonResponse$outboundSchema` instead. */ export const outboundSchema = AccountsEndLargeTraderLegalNaturalPersonResponse$outboundSchema; /** @deprecated use `AccountsEndLargeTraderLegalNaturalPersonResponse$Outbound` instead. */ export type Outbound = AccountsEndLargeTraderLegalNaturalPersonResponse$Outbound; } export function accountsEndLargeTraderLegalNaturalPersonResponseToJSON( accountsEndLargeTraderLegalNaturalPersonResponse: AccountsEndLargeTraderLegalNaturalPersonResponse, ): string { return JSON.stringify( AccountsEndLargeTraderLegalNaturalPersonResponse$outboundSchema.parse( accountsEndLargeTraderLegalNaturalPersonResponse, ), ); } export function accountsEndLargeTraderLegalNaturalPersonResponseFromJSON( jsonString: string, ): SafeParseResult< AccountsEndLargeTraderLegalNaturalPersonResponse, SDKValidationError > { return safeParse( jsonString, (x) => AccountsEndLargeTraderLegalNaturalPersonResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsEndLargeTraderLegalNaturalPersonResponse' from JSON`, ); }