/* * 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 ExerciseServiceGetOptionInstructionRequest = { /** * The account id. */ accountId: string; /** * The asset id. */ assetId: string; /** * The instruction id. */ instructionId: string; }; export type ExerciseServiceGetOptionInstructionResponse = { httpMeta: components.HTTPMetadata; /** * OK */ optionInstruction?: components.OptionInstruction | undefined; /** * Default error response */ status?: components.Status | undefined; }; /** @internal */ export const ExerciseServiceGetOptionInstructionRequest$inboundSchema: z.ZodType = z.object({ account_id: z.string(), asset_id: z.string(), instruction_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "asset_id": "assetId", "instruction_id": "instructionId", }); }); /** @internal */ export type ExerciseServiceGetOptionInstructionRequest$Outbound = { account_id: string; asset_id: string; instruction_id: string; }; /** @internal */ export const ExerciseServiceGetOptionInstructionRequest$outboundSchema: z.ZodType< ExerciseServiceGetOptionInstructionRequest$Outbound, z.ZodTypeDef, ExerciseServiceGetOptionInstructionRequest > = z.object({ accountId: z.string(), assetId: z.string(), instructionId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", assetId: "asset_id", instructionId: "instruction_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ExerciseServiceGetOptionInstructionRequest$ { /** @deprecated use `ExerciseServiceGetOptionInstructionRequest$inboundSchema` instead. */ export const inboundSchema = ExerciseServiceGetOptionInstructionRequest$inboundSchema; /** @deprecated use `ExerciseServiceGetOptionInstructionRequest$outboundSchema` instead. */ export const outboundSchema = ExerciseServiceGetOptionInstructionRequest$outboundSchema; /** @deprecated use `ExerciseServiceGetOptionInstructionRequest$Outbound` instead. */ export type Outbound = ExerciseServiceGetOptionInstructionRequest$Outbound; } export function exerciseServiceGetOptionInstructionRequestToJSON( exerciseServiceGetOptionInstructionRequest: ExerciseServiceGetOptionInstructionRequest, ): string { return JSON.stringify( ExerciseServiceGetOptionInstructionRequest$outboundSchema.parse( exerciseServiceGetOptionInstructionRequest, ), ); } export function exerciseServiceGetOptionInstructionRequestFromJSON( jsonString: string, ): SafeParseResult< ExerciseServiceGetOptionInstructionRequest, SDKValidationError > { return safeParse( jsonString, (x) => ExerciseServiceGetOptionInstructionRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ExerciseServiceGetOptionInstructionRequest' from JSON`, ); } /** @internal */ export const ExerciseServiceGetOptionInstructionResponse$inboundSchema: z.ZodType< ExerciseServiceGetOptionInstructionResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, OptionInstruction: components.OptionInstruction$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "OptionInstruction": "optionInstruction", "Status": "status", }); }); /** @internal */ export type ExerciseServiceGetOptionInstructionResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; OptionInstruction?: components.OptionInstruction$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const ExerciseServiceGetOptionInstructionResponse$outboundSchema: z.ZodType< ExerciseServiceGetOptionInstructionResponse$Outbound, z.ZodTypeDef, ExerciseServiceGetOptionInstructionResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, optionInstruction: components.OptionInstruction$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", optionInstruction: "OptionInstruction", 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 ExerciseServiceGetOptionInstructionResponse$ { /** @deprecated use `ExerciseServiceGetOptionInstructionResponse$inboundSchema` instead. */ export const inboundSchema = ExerciseServiceGetOptionInstructionResponse$inboundSchema; /** @deprecated use `ExerciseServiceGetOptionInstructionResponse$outboundSchema` instead. */ export const outboundSchema = ExerciseServiceGetOptionInstructionResponse$outboundSchema; /** @deprecated use `ExerciseServiceGetOptionInstructionResponse$Outbound` instead. */ export type Outbound = ExerciseServiceGetOptionInstructionResponse$Outbound; } export function exerciseServiceGetOptionInstructionResponseToJSON( exerciseServiceGetOptionInstructionResponse: ExerciseServiceGetOptionInstructionResponse, ): string { return JSON.stringify( ExerciseServiceGetOptionInstructionResponse$outboundSchema.parse( exerciseServiceGetOptionInstructionResponse, ), ); } export function exerciseServiceGetOptionInstructionResponseFromJSON( jsonString: string, ): SafeParseResult< ExerciseServiceGetOptionInstructionResponse, SDKValidationError > { return safeParse( jsonString, (x) => ExerciseServiceGetOptionInstructionResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ExerciseServiceGetOptionInstructionResponse' from JSON`, ); }