/* * 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 OrderPriceServiceRetrieveQuoteRequest = { /** * The account id. */ accountId: string; retrieveQuoteRequestCreate: components.RetrieveQuoteRequestCreate; }; export type OrderPriceServiceRetrieveQuoteResponse = { httpMeta: components.HTTPMetadata; /** * OK */ retrieveQuoteResponse?: components.RetrieveQuoteResponse | undefined; /** * INVALID_ARGUMENT: There was an issue with one or more fields in the request. The message field will contain details about which field failed validation and why. */ status?: components.Status | undefined; }; /** @internal */ export const OrderPriceServiceRetrieveQuoteRequest$inboundSchema: z.ZodType< OrderPriceServiceRetrieveQuoteRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), RetrieveQuoteRequestCreate: components.RetrieveQuoteRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "RetrieveQuoteRequestCreate": "retrieveQuoteRequestCreate", }); }); /** @internal */ export type OrderPriceServiceRetrieveQuoteRequest$Outbound = { account_id: string; RetrieveQuoteRequestCreate: components.RetrieveQuoteRequestCreate$Outbound; }; /** @internal */ export const OrderPriceServiceRetrieveQuoteRequest$outboundSchema: z.ZodType< OrderPriceServiceRetrieveQuoteRequest$Outbound, z.ZodTypeDef, OrderPriceServiceRetrieveQuoteRequest > = z.object({ accountId: z.string(), retrieveQuoteRequestCreate: components.RetrieveQuoteRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", retrieveQuoteRequestCreate: "RetrieveQuoteRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace OrderPriceServiceRetrieveQuoteRequest$ { /** @deprecated use `OrderPriceServiceRetrieveQuoteRequest$inboundSchema` instead. */ export const inboundSchema = OrderPriceServiceRetrieveQuoteRequest$inboundSchema; /** @deprecated use `OrderPriceServiceRetrieveQuoteRequest$outboundSchema` instead. */ export const outboundSchema = OrderPriceServiceRetrieveQuoteRequest$outboundSchema; /** @deprecated use `OrderPriceServiceRetrieveQuoteRequest$Outbound` instead. */ export type Outbound = OrderPriceServiceRetrieveQuoteRequest$Outbound; } export function orderPriceServiceRetrieveQuoteRequestToJSON( orderPriceServiceRetrieveQuoteRequest: OrderPriceServiceRetrieveQuoteRequest, ): string { return JSON.stringify( OrderPriceServiceRetrieveQuoteRequest$outboundSchema.parse( orderPriceServiceRetrieveQuoteRequest, ), ); } export function orderPriceServiceRetrieveQuoteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrderPriceServiceRetrieveQuoteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrderPriceServiceRetrieveQuoteRequest' from JSON`, ); } /** @internal */ export const OrderPriceServiceRetrieveQuoteResponse$inboundSchema: z.ZodType< OrderPriceServiceRetrieveQuoteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, RetrieveQuoteResponse: components.RetrieveQuoteResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "RetrieveQuoteResponse": "retrieveQuoteResponse", "Status": "status", }); }); /** @internal */ export type OrderPriceServiceRetrieveQuoteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; RetrieveQuoteResponse?: components.RetrieveQuoteResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const OrderPriceServiceRetrieveQuoteResponse$outboundSchema: z.ZodType< OrderPriceServiceRetrieveQuoteResponse$Outbound, z.ZodTypeDef, OrderPriceServiceRetrieveQuoteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, retrieveQuoteResponse: components.RetrieveQuoteResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", retrieveQuoteResponse: "RetrieveQuoteResponse", 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 OrderPriceServiceRetrieveQuoteResponse$ { /** @deprecated use `OrderPriceServiceRetrieveQuoteResponse$inboundSchema` instead. */ export const inboundSchema = OrderPriceServiceRetrieveQuoteResponse$inboundSchema; /** @deprecated use `OrderPriceServiceRetrieveQuoteResponse$outboundSchema` instead. */ export const outboundSchema = OrderPriceServiceRetrieveQuoteResponse$outboundSchema; /** @deprecated use `OrderPriceServiceRetrieveQuoteResponse$Outbound` instead. */ export type Outbound = OrderPriceServiceRetrieveQuoteResponse$Outbound; } export function orderPriceServiceRetrieveQuoteResponseToJSON( orderPriceServiceRetrieveQuoteResponse: OrderPriceServiceRetrieveQuoteResponse, ): string { return JSON.stringify( OrderPriceServiceRetrieveQuoteResponse$outboundSchema.parse( orderPriceServiceRetrieveQuoteResponse, ), ); } export function orderPriceServiceRetrieveQuoteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrderPriceServiceRetrieveQuoteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrderPriceServiceRetrieveQuoteResponse' from JSON`, ); }