/* * 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 WireDepositsSimulateWireDepositRequest = { /** * The account id. */ accountId: string; simulateWireDepositRequestCreate: components.SimulateWireDepositRequestCreate; }; export type WireDepositsSimulateWireDepositResponse = { httpMeta: components.HTTPMetadata; /** * OK */ wireDeposit?: components.WireDeposit | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const WireDepositsSimulateWireDepositRequest$inboundSchema: z.ZodType< WireDepositsSimulateWireDepositRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), SimulateWireDepositRequestCreate: components.SimulateWireDepositRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "SimulateWireDepositRequestCreate": "simulateWireDepositRequestCreate", }); }); /** @internal */ export type WireDepositsSimulateWireDepositRequest$Outbound = { account_id: string; SimulateWireDepositRequestCreate: components.SimulateWireDepositRequestCreate$Outbound; }; /** @internal */ export const WireDepositsSimulateWireDepositRequest$outboundSchema: z.ZodType< WireDepositsSimulateWireDepositRequest$Outbound, z.ZodTypeDef, WireDepositsSimulateWireDepositRequest > = z.object({ accountId: z.string(), simulateWireDepositRequestCreate: components.SimulateWireDepositRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", simulateWireDepositRequestCreate: "SimulateWireDepositRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireDepositsSimulateWireDepositRequest$ { /** @deprecated use `WireDepositsSimulateWireDepositRequest$inboundSchema` instead. */ export const inboundSchema = WireDepositsSimulateWireDepositRequest$inboundSchema; /** @deprecated use `WireDepositsSimulateWireDepositRequest$outboundSchema` instead. */ export const outboundSchema = WireDepositsSimulateWireDepositRequest$outboundSchema; /** @deprecated use `WireDepositsSimulateWireDepositRequest$Outbound` instead. */ export type Outbound = WireDepositsSimulateWireDepositRequest$Outbound; } export function wireDepositsSimulateWireDepositRequestToJSON( wireDepositsSimulateWireDepositRequest: WireDepositsSimulateWireDepositRequest, ): string { return JSON.stringify( WireDepositsSimulateWireDepositRequest$outboundSchema.parse( wireDepositsSimulateWireDepositRequest, ), ); } export function wireDepositsSimulateWireDepositRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireDepositsSimulateWireDepositRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireDepositsSimulateWireDepositRequest' from JSON`, ); } /** @internal */ export const WireDepositsSimulateWireDepositResponse$inboundSchema: z.ZodType< WireDepositsSimulateWireDepositResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, WireDeposit: components.WireDeposit$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "WireDeposit": "wireDeposit", "Status": "status", }); }); /** @internal */ export type WireDepositsSimulateWireDepositResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; WireDeposit?: components.WireDeposit$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const WireDepositsSimulateWireDepositResponse$outboundSchema: z.ZodType< WireDepositsSimulateWireDepositResponse$Outbound, z.ZodTypeDef, WireDepositsSimulateWireDepositResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, wireDeposit: components.WireDeposit$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", wireDeposit: "WireDeposit", 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 WireDepositsSimulateWireDepositResponse$ { /** @deprecated use `WireDepositsSimulateWireDepositResponse$inboundSchema` instead. */ export const inboundSchema = WireDepositsSimulateWireDepositResponse$inboundSchema; /** @deprecated use `WireDepositsSimulateWireDepositResponse$outboundSchema` instead. */ export const outboundSchema = WireDepositsSimulateWireDepositResponse$outboundSchema; /** @deprecated use `WireDepositsSimulateWireDepositResponse$Outbound` instead. */ export type Outbound = WireDepositsSimulateWireDepositResponse$Outbound; } export function wireDepositsSimulateWireDepositResponseToJSON( wireDepositsSimulateWireDepositResponse: WireDepositsSimulateWireDepositResponse, ): string { return JSON.stringify( WireDepositsSimulateWireDepositResponse$outboundSchema.parse( wireDepositsSimulateWireDepositResponse, ), ); } export function wireDepositsSimulateWireDepositResponseFromJSON( jsonString: string, ): SafeParseResult< WireDepositsSimulateWireDepositResponse, SDKValidationError > { return safeParse( jsonString, (x) => WireDepositsSimulateWireDepositResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireDepositsSimulateWireDepositResponse' from JSON`, ); }