/* * 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 AlternativeOrdersGetAlternativeOrderRequest = { /** * The account id. */ accountId: string; /** * The alternativeOrder id. */ alternativeOrderId: string; }; export type AlternativeOrdersGetAlternativeOrderResponse = { httpMeta: components.HTTPMetadata; /** * OK */ alternativeOrder?: components.AlternativeOrder | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AlternativeOrdersGetAlternativeOrderRequest$inboundSchema: z.ZodType< AlternativeOrdersGetAlternativeOrderRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), alternativeOrder_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "alternativeOrder_id": "alternativeOrderId", }); }); /** @internal */ export type AlternativeOrdersGetAlternativeOrderRequest$Outbound = { account_id: string; alternativeOrder_id: string; }; /** @internal */ export const AlternativeOrdersGetAlternativeOrderRequest$outboundSchema: z.ZodType< AlternativeOrdersGetAlternativeOrderRequest$Outbound, z.ZodTypeDef, AlternativeOrdersGetAlternativeOrderRequest > = z.object({ accountId: z.string(), alternativeOrderId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", alternativeOrderId: "alternativeOrder_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrdersGetAlternativeOrderRequest$ { /** @deprecated use `AlternativeOrdersGetAlternativeOrderRequest$inboundSchema` instead. */ export const inboundSchema = AlternativeOrdersGetAlternativeOrderRequest$inboundSchema; /** @deprecated use `AlternativeOrdersGetAlternativeOrderRequest$outboundSchema` instead. */ export const outboundSchema = AlternativeOrdersGetAlternativeOrderRequest$outboundSchema; /** @deprecated use `AlternativeOrdersGetAlternativeOrderRequest$Outbound` instead. */ export type Outbound = AlternativeOrdersGetAlternativeOrderRequest$Outbound; } export function alternativeOrdersGetAlternativeOrderRequestToJSON( alternativeOrdersGetAlternativeOrderRequest: AlternativeOrdersGetAlternativeOrderRequest, ): string { return JSON.stringify( AlternativeOrdersGetAlternativeOrderRequest$outboundSchema.parse( alternativeOrdersGetAlternativeOrderRequest, ), ); } export function alternativeOrdersGetAlternativeOrderRequestFromJSON( jsonString: string, ): SafeParseResult< AlternativeOrdersGetAlternativeOrderRequest, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeOrdersGetAlternativeOrderRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AlternativeOrdersGetAlternativeOrderRequest' from JSON`, ); } /** @internal */ export const AlternativeOrdersGetAlternativeOrderResponse$inboundSchema: z.ZodType< AlternativeOrdersGetAlternativeOrderResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AlternativeOrder: components.AlternativeOrder$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AlternativeOrder": "alternativeOrder", "Status": "status", }); }); /** @internal */ export type AlternativeOrdersGetAlternativeOrderResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AlternativeOrder?: components.AlternativeOrder$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AlternativeOrdersGetAlternativeOrderResponse$outboundSchema: z.ZodType< AlternativeOrdersGetAlternativeOrderResponse$Outbound, z.ZodTypeDef, AlternativeOrdersGetAlternativeOrderResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, alternativeOrder: components.AlternativeOrder$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", alternativeOrder: "AlternativeOrder", 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 AlternativeOrdersGetAlternativeOrderResponse$ { /** @deprecated use `AlternativeOrdersGetAlternativeOrderResponse$inboundSchema` instead. */ export const inboundSchema = AlternativeOrdersGetAlternativeOrderResponse$inboundSchema; /** @deprecated use `AlternativeOrdersGetAlternativeOrderResponse$outboundSchema` instead. */ export const outboundSchema = AlternativeOrdersGetAlternativeOrderResponse$outboundSchema; /** @deprecated use `AlternativeOrdersGetAlternativeOrderResponse$Outbound` instead. */ export type Outbound = AlternativeOrdersGetAlternativeOrderResponse$Outbound; } export function alternativeOrdersGetAlternativeOrderResponseToJSON( alternativeOrdersGetAlternativeOrderResponse: AlternativeOrdersGetAlternativeOrderResponse, ): string { return JSON.stringify( AlternativeOrdersGetAlternativeOrderResponse$outboundSchema.parse( alternativeOrdersGetAlternativeOrderResponse, ), ); } export function alternativeOrdersGetAlternativeOrderResponseFromJSON( jsonString: string, ): SafeParseResult< AlternativeOrdersGetAlternativeOrderResponse, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeOrdersGetAlternativeOrderResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AlternativeOrdersGetAlternativeOrderResponse' from JSON`, ); }