/* * 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 a trade allocation. */ export type CancelTradeAllocationRequestCreate = { /** * The name of the trade allocation to cancel. */ name: string; }; /** @internal */ export const CancelTradeAllocationRequestCreate$inboundSchema: z.ZodType< CancelTradeAllocationRequestCreate, z.ZodTypeDef, unknown > = z.object({ name: z.string(), }); /** @internal */ export type CancelTradeAllocationRequestCreate$Outbound = { name: string; }; /** @internal */ export const CancelTradeAllocationRequestCreate$outboundSchema: z.ZodType< CancelTradeAllocationRequestCreate$Outbound, z.ZodTypeDef, CancelTradeAllocationRequestCreate > = 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 CancelTradeAllocationRequestCreate$ { /** @deprecated use `CancelTradeAllocationRequestCreate$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationRequestCreate$inboundSchema; /** @deprecated use `CancelTradeAllocationRequestCreate$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationRequestCreate$outboundSchema; /** @deprecated use `CancelTradeAllocationRequestCreate$Outbound` instead. */ export type Outbound = CancelTradeAllocationRequestCreate$Outbound; } export function cancelTradeAllocationRequestCreateToJSON( cancelTradeAllocationRequestCreate: CancelTradeAllocationRequestCreate, ): string { return JSON.stringify( CancelTradeAllocationRequestCreate$outboundSchema.parse( cancelTradeAllocationRequestCreate, ), ); } export function cancelTradeAllocationRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelTradeAllocationRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelTradeAllocationRequestCreate' from JSON`, ); }