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