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