/* * 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 AccountsAssignLargeTraderLegalEntityRequest = { /** * The legalEntity id. */ legalEntityId: string; assignLargeTraderRequestCreate: components.AssignLargeTraderRequestCreate; }; export type AccountsAssignLargeTraderLegalEntityResponse = { httpMeta: components.HTTPMetadata; /** * OK */ largeTrader?: components.LargeTrader | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsAssignLargeTraderLegalEntityRequest$inboundSchema: z.ZodType< AccountsAssignLargeTraderLegalEntityRequest, z.ZodTypeDef, unknown > = z.object({ legalEntity_id: z.string(), AssignLargeTraderRequestCreate: components.AssignLargeTraderRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "legalEntity_id": "legalEntityId", "AssignLargeTraderRequestCreate": "assignLargeTraderRequestCreate", }); }); /** @internal */ export type AccountsAssignLargeTraderLegalEntityRequest$Outbound = { legalEntity_id: string; AssignLargeTraderRequestCreate: components.AssignLargeTraderRequestCreate$Outbound; }; /** @internal */ export const AccountsAssignLargeTraderLegalEntityRequest$outboundSchema: z.ZodType< AccountsAssignLargeTraderLegalEntityRequest$Outbound, z.ZodTypeDef, AccountsAssignLargeTraderLegalEntityRequest > = z.object({ legalEntityId: z.string(), assignLargeTraderRequestCreate: components.AssignLargeTraderRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { legalEntityId: "legalEntity_id", assignLargeTraderRequestCreate: "AssignLargeTraderRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsAssignLargeTraderLegalEntityRequest$ { /** @deprecated use `AccountsAssignLargeTraderLegalEntityRequest$inboundSchema` instead. */ export const inboundSchema = AccountsAssignLargeTraderLegalEntityRequest$inboundSchema; /** @deprecated use `AccountsAssignLargeTraderLegalEntityRequest$outboundSchema` instead. */ export const outboundSchema = AccountsAssignLargeTraderLegalEntityRequest$outboundSchema; /** @deprecated use `AccountsAssignLargeTraderLegalEntityRequest$Outbound` instead. */ export type Outbound = AccountsAssignLargeTraderLegalEntityRequest$Outbound; } export function accountsAssignLargeTraderLegalEntityRequestToJSON( accountsAssignLargeTraderLegalEntityRequest: AccountsAssignLargeTraderLegalEntityRequest, ): string { return JSON.stringify( AccountsAssignLargeTraderLegalEntityRequest$outboundSchema.parse( accountsAssignLargeTraderLegalEntityRequest, ), ); } export function accountsAssignLargeTraderLegalEntityRequestFromJSON( jsonString: string, ): SafeParseResult< AccountsAssignLargeTraderLegalEntityRequest, SDKValidationError > { return safeParse( jsonString, (x) => AccountsAssignLargeTraderLegalEntityRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsAssignLargeTraderLegalEntityRequest' from JSON`, ); } /** @internal */ export const AccountsAssignLargeTraderLegalEntityResponse$inboundSchema: z.ZodType< AccountsAssignLargeTraderLegalEntityResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LargeTrader: components.LargeTrader$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LargeTrader": "largeTrader", "Status": "status", }); }); /** @internal */ export type AccountsAssignLargeTraderLegalEntityResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LargeTrader?: components.LargeTrader$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsAssignLargeTraderLegalEntityResponse$outboundSchema: z.ZodType< AccountsAssignLargeTraderLegalEntityResponse$Outbound, z.ZodTypeDef, AccountsAssignLargeTraderLegalEntityResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, largeTrader: components.LargeTrader$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", largeTrader: "LargeTrader", 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 AccountsAssignLargeTraderLegalEntityResponse$ { /** @deprecated use `AccountsAssignLargeTraderLegalEntityResponse$inboundSchema` instead. */ export const inboundSchema = AccountsAssignLargeTraderLegalEntityResponse$inboundSchema; /** @deprecated use `AccountsAssignLargeTraderLegalEntityResponse$outboundSchema` instead. */ export const outboundSchema = AccountsAssignLargeTraderLegalEntityResponse$outboundSchema; /** @deprecated use `AccountsAssignLargeTraderLegalEntityResponse$Outbound` instead. */ export type Outbound = AccountsAssignLargeTraderLegalEntityResponse$Outbound; } export function accountsAssignLargeTraderLegalEntityResponseToJSON( accountsAssignLargeTraderLegalEntityResponse: AccountsAssignLargeTraderLegalEntityResponse, ): string { return JSON.stringify( AccountsAssignLargeTraderLegalEntityResponse$outboundSchema.parse( accountsAssignLargeTraderLegalEntityResponse, ), ); } export function accountsAssignLargeTraderLegalEntityResponseFromJSON( jsonString: string, ): SafeParseResult< AccountsAssignLargeTraderLegalEntityResponse, SDKValidationError > { return safeParse( jsonString, (x) => AccountsAssignLargeTraderLegalEntityResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AccountsAssignLargeTraderLegalEntityResponse' from JSON`, ); }