/* * 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 AlternativeInvestmentsListAlternativeInvestmentsRequest = { /** * The asset id. */ assetId: string; /** * The maximum number of orders to return. - Max value =100 - Values above 100 will be coerced to 100. - If the specified value is greater than the number of orders, the service will return fewer than the specified value. - If unspecified, at most 100 orders will be returned. */ pageSize?: number | undefined; /** * For pagination, provide the page token, received from a previous `ListAlternativeInvestments` call, to retrieve the subsequent page. All other parameters provided to `ListAlternativeInvestments` must match the request that provided the page token. */ pageToken?: string | undefined; /** * A CEL string to filter results. All fields from the response can be used as filters. * * @remarks * * See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) guide for syntax details and examples. */ filter?: string | undefined; }; export type AlternativeInvestmentsListAlternativeInvestmentsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listAlternativeInvestmentsResponse?: | components.ListAlternativeInvestmentsResponse | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AlternativeInvestmentsListAlternativeInvestmentsRequest$inboundSchema: z.ZodType< AlternativeInvestmentsListAlternativeInvestmentsRequest, z.ZodTypeDef, unknown > = z.object({ asset_id: z.string(), page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "asset_id": "assetId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type AlternativeInvestmentsListAlternativeInvestmentsRequest$Outbound = { asset_id: string; page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const AlternativeInvestmentsListAlternativeInvestmentsRequest$outboundSchema: z.ZodType< AlternativeInvestmentsListAlternativeInvestmentsRequest$Outbound, z.ZodTypeDef, AlternativeInvestmentsListAlternativeInvestmentsRequest > = z.object({ assetId: z.string(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { assetId: "asset_id", pageSize: "page_size", pageToken: "page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeInvestmentsListAlternativeInvestmentsRequest$ { /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsRequest$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentsListAlternativeInvestmentsRequest$inboundSchema; /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsRequest$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentsListAlternativeInvestmentsRequest$outboundSchema; /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsRequest$Outbound` instead. */ export type Outbound = AlternativeInvestmentsListAlternativeInvestmentsRequest$Outbound; } export function alternativeInvestmentsListAlternativeInvestmentsRequestToJSON( alternativeInvestmentsListAlternativeInvestmentsRequest: AlternativeInvestmentsListAlternativeInvestmentsRequest, ): string { return JSON.stringify( AlternativeInvestmentsListAlternativeInvestmentsRequest$outboundSchema .parse(alternativeInvestmentsListAlternativeInvestmentsRequest), ); } export function alternativeInvestmentsListAlternativeInvestmentsRequestFromJSON( jsonString: string, ): SafeParseResult< AlternativeInvestmentsListAlternativeInvestmentsRequest, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeInvestmentsListAlternativeInvestmentsRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AlternativeInvestmentsListAlternativeInvestmentsRequest' from JSON`, ); } /** @internal */ export const AlternativeInvestmentsListAlternativeInvestmentsResponse$inboundSchema: z.ZodType< AlternativeInvestmentsListAlternativeInvestmentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListAlternativeInvestmentsResponse: components .ListAlternativeInvestmentsResponse$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListAlternativeInvestmentsResponse": "listAlternativeInvestmentsResponse", "Status": "status", }); }); /** @internal */ export type AlternativeInvestmentsListAlternativeInvestmentsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListAlternativeInvestmentsResponse?: | components.ListAlternativeInvestmentsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AlternativeInvestmentsListAlternativeInvestmentsResponse$outboundSchema: z.ZodType< AlternativeInvestmentsListAlternativeInvestmentsResponse$Outbound, z.ZodTypeDef, AlternativeInvestmentsListAlternativeInvestmentsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listAlternativeInvestmentsResponse: components .ListAlternativeInvestmentsResponse$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listAlternativeInvestmentsResponse: "ListAlternativeInvestmentsResponse", 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 AlternativeInvestmentsListAlternativeInvestmentsResponse$ { /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsResponse$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentsListAlternativeInvestmentsResponse$inboundSchema; /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsResponse$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentsListAlternativeInvestmentsResponse$outboundSchema; /** @deprecated use `AlternativeInvestmentsListAlternativeInvestmentsResponse$Outbound` instead. */ export type Outbound = AlternativeInvestmentsListAlternativeInvestmentsResponse$Outbound; } export function alternativeInvestmentsListAlternativeInvestmentsResponseToJSON( alternativeInvestmentsListAlternativeInvestmentsResponse: AlternativeInvestmentsListAlternativeInvestmentsResponse, ): string { return JSON.stringify( AlternativeInvestmentsListAlternativeInvestmentsResponse$outboundSchema .parse(alternativeInvestmentsListAlternativeInvestmentsResponse), ); } export function alternativeInvestmentsListAlternativeInvestmentsResponseFromJSON( jsonString: string, ): SafeParseResult< AlternativeInvestmentsListAlternativeInvestmentsResponse, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeInvestmentsListAlternativeInvestmentsResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AlternativeInvestmentsListAlternativeInvestmentsResponse' from JSON`, ); }