/* * 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 ExerciseServiceListOptionInstructionsRequest = { /** * The account id. */ accountId: string; /** * The asset id. */ assetId: string; /** * Maximum number of instructions to return (1000). If unspecified, the server will set a default value of 1000. */ pageSize?: number | undefined; /** * A token to retrieve the next page of results. Set this to the value of `next_page_token` from a previous `ListInstructions` call, or leave it empty to retrieve the first page. */ pageToken?: string | undefined; /** * Optional filter to limit results to specific criteria. Example: "type == 'DO_NOT_EXERCISE' && account_id == '12345'" */ filter?: string | undefined; }; export type ExerciseServiceListOptionInstructionsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listOptionInstructionsResponse?: | components.ListOptionInstructionsResponse | undefined; /** * Default error response */ status?: components.Status | undefined; }; /** @internal */ export const ExerciseServiceListOptionInstructionsRequest$inboundSchema: z.ZodType< ExerciseServiceListOptionInstructionsRequest, z.ZodTypeDef, unknown > = z.object({ account_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, { "account_id": "accountId", "asset_id": "assetId", "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type ExerciseServiceListOptionInstructionsRequest$Outbound = { account_id: string; asset_id: string; page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const ExerciseServiceListOptionInstructionsRequest$outboundSchema: z.ZodType< ExerciseServiceListOptionInstructionsRequest$Outbound, z.ZodTypeDef, ExerciseServiceListOptionInstructionsRequest > = z.object({ accountId: z.string(), assetId: z.string(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { accountId: "account_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 ExerciseServiceListOptionInstructionsRequest$ { /** @deprecated use `ExerciseServiceListOptionInstructionsRequest$inboundSchema` instead. */ export const inboundSchema = ExerciseServiceListOptionInstructionsRequest$inboundSchema; /** @deprecated use `ExerciseServiceListOptionInstructionsRequest$outboundSchema` instead. */ export const outboundSchema = ExerciseServiceListOptionInstructionsRequest$outboundSchema; /** @deprecated use `ExerciseServiceListOptionInstructionsRequest$Outbound` instead. */ export type Outbound = ExerciseServiceListOptionInstructionsRequest$Outbound; } export function exerciseServiceListOptionInstructionsRequestToJSON( exerciseServiceListOptionInstructionsRequest: ExerciseServiceListOptionInstructionsRequest, ): string { return JSON.stringify( ExerciseServiceListOptionInstructionsRequest$outboundSchema.parse( exerciseServiceListOptionInstructionsRequest, ), ); } export function exerciseServiceListOptionInstructionsRequestFromJSON( jsonString: string, ): SafeParseResult< ExerciseServiceListOptionInstructionsRequest, SDKValidationError > { return safeParse( jsonString, (x) => ExerciseServiceListOptionInstructionsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ExerciseServiceListOptionInstructionsRequest' from JSON`, ); } /** @internal */ export const ExerciseServiceListOptionInstructionsResponse$inboundSchema: z.ZodType< ExerciseServiceListOptionInstructionsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListOptionInstructionsResponse: components .ListOptionInstructionsResponse$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListOptionInstructionsResponse": "listOptionInstructionsResponse", "Status": "status", }); }); /** @internal */ export type ExerciseServiceListOptionInstructionsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListOptionInstructionsResponse?: | components.ListOptionInstructionsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const ExerciseServiceListOptionInstructionsResponse$outboundSchema: z.ZodType< ExerciseServiceListOptionInstructionsResponse$Outbound, z.ZodTypeDef, ExerciseServiceListOptionInstructionsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listOptionInstructionsResponse: components .ListOptionInstructionsResponse$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listOptionInstructionsResponse: "ListOptionInstructionsResponse", 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 ExerciseServiceListOptionInstructionsResponse$ { /** @deprecated use `ExerciseServiceListOptionInstructionsResponse$inboundSchema` instead. */ export const inboundSchema = ExerciseServiceListOptionInstructionsResponse$inboundSchema; /** @deprecated use `ExerciseServiceListOptionInstructionsResponse$outboundSchema` instead. */ export const outboundSchema = ExerciseServiceListOptionInstructionsResponse$outboundSchema; /** @deprecated use `ExerciseServiceListOptionInstructionsResponse$Outbound` instead. */ export type Outbound = ExerciseServiceListOptionInstructionsResponse$Outbound; } export function exerciseServiceListOptionInstructionsResponseToJSON( exerciseServiceListOptionInstructionsResponse: ExerciseServiceListOptionInstructionsResponse, ): string { return JSON.stringify( ExerciseServiceListOptionInstructionsResponse$outboundSchema.parse( exerciseServiceListOptionInstructionsResponse, ), ); } export function exerciseServiceListOptionInstructionsResponseFromJSON( jsonString: string, ): SafeParseResult< ExerciseServiceListOptionInstructionsResponse, SDKValidationError > { return safeParse( jsonString, (x) => ExerciseServiceListOptionInstructionsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ExerciseServiceListOptionInstructionsResponse' from JSON`, ); }