/* * 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 AssetTradingConfigServiceListAssetTradingConfigsRequest = { /** * The correspondent id. */ correspondentId: string; /** * The asset id. */ assetId: string; /** * The maximum number of asset trading configs to return. The service may return fewer than this value. Default is 100 (subject to change) The maximum is 1000, values exceeding this will be set to 1000 (subject to change) */ pageSize?: number | undefined; /** * A page token, received from a previous `ListAssetTradingConfigRequest` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAssetTradingConfigRequest` must match the call that provided the page token in order to maintain a stable result set. */ pageToken?: string | undefined; /** * A CEL string to filter results; See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) page in Guides for more information; symbol, cusip, isin, and asset_type are available in the CEL string. Additional fields will be available in the future. This is subject to change. */ filter?: string | undefined; }; export type AssetTradingConfigServiceListAssetTradingConfigsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listAssetTradingConfigsResponse?: | components.ListAssetTradingConfigsResponse | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AssetTradingConfigServiceListAssetTradingConfigsRequest$inboundSchema: z.ZodType< AssetTradingConfigServiceListAssetTradingConfigsRequest, z.ZodTypeDef, unknown > = z.object({ correspondent_id: z.string(), asset_id: z.string(), page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "correspondent_id": "correspondentId", "asset_id": "assetId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type AssetTradingConfigServiceListAssetTradingConfigsRequest$Outbound = { correspondent_id: string; asset_id: string; page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const AssetTradingConfigServiceListAssetTradingConfigsRequest$outboundSchema: z.ZodType< AssetTradingConfigServiceListAssetTradingConfigsRequest$Outbound, z.ZodTypeDef, AssetTradingConfigServiceListAssetTradingConfigsRequest > = z.object({ correspondentId: z.string(), assetId: z.string(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { correspondentId: "correspondent_id", 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 AssetTradingConfigServiceListAssetTradingConfigsRequest$ { /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsRequest$inboundSchema` instead. */ export const inboundSchema = AssetTradingConfigServiceListAssetTradingConfigsRequest$inboundSchema; /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsRequest$outboundSchema` instead. */ export const outboundSchema = AssetTradingConfigServiceListAssetTradingConfigsRequest$outboundSchema; /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsRequest$Outbound` instead. */ export type Outbound = AssetTradingConfigServiceListAssetTradingConfigsRequest$Outbound; } export function assetTradingConfigServiceListAssetTradingConfigsRequestToJSON( assetTradingConfigServiceListAssetTradingConfigsRequest: AssetTradingConfigServiceListAssetTradingConfigsRequest, ): string { return JSON.stringify( AssetTradingConfigServiceListAssetTradingConfigsRequest$outboundSchema .parse(assetTradingConfigServiceListAssetTradingConfigsRequest), ); } export function assetTradingConfigServiceListAssetTradingConfigsRequestFromJSON( jsonString: string, ): SafeParseResult< AssetTradingConfigServiceListAssetTradingConfigsRequest, SDKValidationError > { return safeParse( jsonString, (x) => AssetTradingConfigServiceListAssetTradingConfigsRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AssetTradingConfigServiceListAssetTradingConfigsRequest' from JSON`, ); } /** @internal */ export const AssetTradingConfigServiceListAssetTradingConfigsResponse$inboundSchema: z.ZodType< AssetTradingConfigServiceListAssetTradingConfigsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListAssetTradingConfigsResponse: components .ListAssetTradingConfigsResponse$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListAssetTradingConfigsResponse": "listAssetTradingConfigsResponse", "Status": "status", }); }); /** @internal */ export type AssetTradingConfigServiceListAssetTradingConfigsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListAssetTradingConfigsResponse?: | components.ListAssetTradingConfigsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AssetTradingConfigServiceListAssetTradingConfigsResponse$outboundSchema: z.ZodType< AssetTradingConfigServiceListAssetTradingConfigsResponse$Outbound, z.ZodTypeDef, AssetTradingConfigServiceListAssetTradingConfigsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listAssetTradingConfigsResponse: components .ListAssetTradingConfigsResponse$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listAssetTradingConfigsResponse: "ListAssetTradingConfigsResponse", 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 AssetTradingConfigServiceListAssetTradingConfigsResponse$ { /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsResponse$inboundSchema` instead. */ export const inboundSchema = AssetTradingConfigServiceListAssetTradingConfigsResponse$inboundSchema; /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsResponse$outboundSchema` instead. */ export const outboundSchema = AssetTradingConfigServiceListAssetTradingConfigsResponse$outboundSchema; /** @deprecated use `AssetTradingConfigServiceListAssetTradingConfigsResponse$Outbound` instead. */ export type Outbound = AssetTradingConfigServiceListAssetTradingConfigsResponse$Outbound; } export function assetTradingConfigServiceListAssetTradingConfigsResponseToJSON( assetTradingConfigServiceListAssetTradingConfigsResponse: AssetTradingConfigServiceListAssetTradingConfigsResponse, ): string { return JSON.stringify( AssetTradingConfigServiceListAssetTradingConfigsResponse$outboundSchema .parse(assetTradingConfigServiceListAssetTradingConfigsResponse), ); } export function assetTradingConfigServiceListAssetTradingConfigsResponseFromJSON( jsonString: string, ): SafeParseResult< AssetTradingConfigServiceListAssetTradingConfigsResponse, SDKValidationError > { return safeParse( jsonString, (x) => AssetTradingConfigServiceListAssetTradingConfigsResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AssetTradingConfigServiceListAssetTradingConfigsResponse' from JSON`, ); }