/* * 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 { Position, Position$inboundSchema, Position$Outbound, Position$outboundSchema, } from "./position.js"; /** * positions with 0 values will be returned if there are offsetting position deltas or a position was reduced to 0 */ export type ListPositionsResponse = { /** * The next page token returned by this call. Can be provided in another request to retrieve the subsequent page */ nextPageToken?: string | undefined; /** * The positions returned */ positions?: Array | undefined; }; /** @internal */ export const ListPositionsResponse$inboundSchema: z.ZodType< ListPositionsResponse, z.ZodTypeDef, unknown > = z.object({ next_page_token: z.string().optional(), positions: z.array(Position$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListPositionsResponse$Outbound = { next_page_token?: string | undefined; positions?: Array | undefined; }; /** @internal */ export const ListPositionsResponse$outboundSchema: z.ZodType< ListPositionsResponse$Outbound, z.ZodTypeDef, ListPositionsResponse > = z.object({ nextPageToken: z.string().optional(), positions: z.array(Position$outboundSchema).optional(), }).transform((v) => { return remap$(v, { 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 ListPositionsResponse$ { /** @deprecated use `ListPositionsResponse$inboundSchema` instead. */ export const inboundSchema = ListPositionsResponse$inboundSchema; /** @deprecated use `ListPositionsResponse$outboundSchema` instead. */ export const outboundSchema = ListPositionsResponse$outboundSchema; /** @deprecated use `ListPositionsResponse$Outbound` instead. */ export type Outbound = ListPositionsResponse$Outbound; } export function listPositionsResponseToJSON( listPositionsResponse: ListPositionsResponse, ): string { return JSON.stringify( ListPositionsResponse$outboundSchema.parse(listPositionsResponse), ); } export function listPositionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPositionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPositionsResponse' from JSON`, ); }