/* * 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"; import { ExecutionCreate, ExecutionCreate$inboundSchema, ExecutionCreate$Outbound, ExecutionCreate$outboundSchema, } from "./executioncreate.js"; /** * A response for the rebook execution method. */ export type RebookExecutionRequestCreate = { /** * An execution represents a partial-fill or a fill that is part of an order. Executions are children to a Trade, which collectively represents an entire order made by a client. */ execution: ExecutionCreate; /** * The name of the execution to rebook. */ name: string; }; /** @internal */ export const RebookExecutionRequestCreate$inboundSchema: z.ZodType< RebookExecutionRequestCreate, z.ZodTypeDef, unknown > = z.object({ execution: ExecutionCreate$inboundSchema, name: z.string(), }); /** @internal */ export type RebookExecutionRequestCreate$Outbound = { execution: ExecutionCreate$Outbound; name: string; }; /** @internal */ export const RebookExecutionRequestCreate$outboundSchema: z.ZodType< RebookExecutionRequestCreate$Outbound, z.ZodTypeDef, RebookExecutionRequestCreate > = z.object({ execution: ExecutionCreate$outboundSchema, 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 RebookExecutionRequestCreate$ { /** @deprecated use `RebookExecutionRequestCreate$inboundSchema` instead. */ export const inboundSchema = RebookExecutionRequestCreate$inboundSchema; /** @deprecated use `RebookExecutionRequestCreate$outboundSchema` instead. */ export const outboundSchema = RebookExecutionRequestCreate$outboundSchema; /** @deprecated use `RebookExecutionRequestCreate$Outbound` instead. */ export type Outbound = RebookExecutionRequestCreate$Outbound; } export function rebookExecutionRequestCreateToJSON( rebookExecutionRequestCreate: RebookExecutionRequestCreate, ): string { return JSON.stringify( RebookExecutionRequestCreate$outboundSchema.parse( rebookExecutionRequestCreate, ), ); } export function rebookExecutionRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionRequestCreate' from JSON`, ); }