/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * A request for canceling all executions underneath a trade. */ export type CancelTradeRequestCreate = { /** * The name of the trade to cancel. */ name: string; }; /** @internal */ export const CancelTradeRequestCreate$inboundSchema: z.ZodType< CancelTradeRequestCreate, z.ZodTypeDef, unknown > = z.object({ name: z.string(), }); /** @internal */ export type CancelTradeRequestCreate$Outbound = { name: string; }; /** @internal */ export const CancelTradeRequestCreate$outboundSchema: z.ZodType< CancelTradeRequestCreate$Outbound, z.ZodTypeDef, CancelTradeRequestCreate > = z.object({ name: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelTradeRequestCreate$ { /** @deprecated use `CancelTradeRequestCreate$inboundSchema` instead. */ export const inboundSchema = CancelTradeRequestCreate$inboundSchema; /** @deprecated use `CancelTradeRequestCreate$outboundSchema` instead. */ export const outboundSchema = CancelTradeRequestCreate$outboundSchema; /** @deprecated use `CancelTradeRequestCreate$Outbound` instead. */ export type Outbound = CancelTradeRequestCreate$Outbound; } export function cancelTradeRequestCreateToJSON( cancelTradeRequestCreate: CancelTradeRequestCreate, ): string { return JSON.stringify( CancelTradeRequestCreate$outboundSchema.parse(cancelTradeRequestCreate), ); } export function cancelTradeRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelTradeRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelTradeRequestCreate' from JSON`, ); }