/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AlternativeOrder, AlternativeOrder$inboundSchema, AlternativeOrder$Outbound, AlternativeOrder$outboundSchema, } from "./alternativeorder.js"; /** * Response to list Alternative Orders. */ export type ListAlternativeOrdersResponse = { /** * The alternative investment orders associated with the specified account. */ alternativeOrders?: Array | undefined; /** * A token that can be sent as the `page_token` query param value to retrieve the next page, when pagination is needed. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string | undefined; }; /** @internal */ export const ListAlternativeOrdersResponse$inboundSchema: z.ZodType< ListAlternativeOrdersResponse, z.ZodTypeDef, unknown > = z.object({ alternative_orders: z.array(AlternativeOrder$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "alternative_orders": "alternativeOrders", "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListAlternativeOrdersResponse$Outbound = { alternative_orders?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListAlternativeOrdersResponse$outboundSchema: z.ZodType< ListAlternativeOrdersResponse$Outbound, z.ZodTypeDef, ListAlternativeOrdersResponse > = z.object({ alternativeOrders: z.array(AlternativeOrder$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { alternativeOrders: "alternative_orders", nextPageToken: "next_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 ListAlternativeOrdersResponse$ { /** @deprecated use `ListAlternativeOrdersResponse$inboundSchema` instead. */ export const inboundSchema = ListAlternativeOrdersResponse$inboundSchema; /** @deprecated use `ListAlternativeOrdersResponse$outboundSchema` instead. */ export const outboundSchema = ListAlternativeOrdersResponse$outboundSchema; /** @deprecated use `ListAlternativeOrdersResponse$Outbound` instead. */ export type Outbound = ListAlternativeOrdersResponse$Outbound; } export function listAlternativeOrdersResponseToJSON( listAlternativeOrdersResponse: ListAlternativeOrdersResponse, ): string { return JSON.stringify( ListAlternativeOrdersResponse$outboundSchema.parse( listAlternativeOrdersResponse, ), ); } export function listAlternativeOrdersResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListAlternativeOrdersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListAlternativeOrdersResponse' from JSON`, ); }