/* * 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 WireWithdrawalsCreateWireWithdrawalRequest = { /** * The account id. */ accountId: string; wireWithdrawalCreate: components.WireWithdrawalCreate; }; export type WireWithdrawalsCreateWireWithdrawalResponse = { httpMeta: components.HTTPMetadata; /** * OK */ wireWithdrawal?: components.WireWithdrawal | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const WireWithdrawalsCreateWireWithdrawalRequest$inboundSchema: z.ZodType = z.object({ account_id: z.string(), WireWithdrawalCreate: components.WireWithdrawalCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "WireWithdrawalCreate": "wireWithdrawalCreate", }); }); /** @internal */ export type WireWithdrawalsCreateWireWithdrawalRequest$Outbound = { account_id: string; WireWithdrawalCreate: components.WireWithdrawalCreate$Outbound; }; /** @internal */ export const WireWithdrawalsCreateWireWithdrawalRequest$outboundSchema: z.ZodType< WireWithdrawalsCreateWireWithdrawalRequest$Outbound, z.ZodTypeDef, WireWithdrawalsCreateWireWithdrawalRequest > = z.object({ accountId: z.string(), wireWithdrawalCreate: components.WireWithdrawalCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", wireWithdrawalCreate: "WireWithdrawalCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalsCreateWireWithdrawalRequest$ { /** @deprecated use `WireWithdrawalsCreateWireWithdrawalRequest$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalsCreateWireWithdrawalRequest$inboundSchema; /** @deprecated use `WireWithdrawalsCreateWireWithdrawalRequest$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalsCreateWireWithdrawalRequest$outboundSchema; /** @deprecated use `WireWithdrawalsCreateWireWithdrawalRequest$Outbound` instead. */ export type Outbound = WireWithdrawalsCreateWireWithdrawalRequest$Outbound; } export function wireWithdrawalsCreateWireWithdrawalRequestToJSON( wireWithdrawalsCreateWireWithdrawalRequest: WireWithdrawalsCreateWireWithdrawalRequest, ): string { return JSON.stringify( WireWithdrawalsCreateWireWithdrawalRequest$outboundSchema.parse( wireWithdrawalsCreateWireWithdrawalRequest, ), ); } export function wireWithdrawalsCreateWireWithdrawalRequestFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalsCreateWireWithdrawalRequest, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalsCreateWireWithdrawalRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalsCreateWireWithdrawalRequest' from JSON`, ); } /** @internal */ export const WireWithdrawalsCreateWireWithdrawalResponse$inboundSchema: z.ZodType< WireWithdrawalsCreateWireWithdrawalResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, WireWithdrawal: components.WireWithdrawal$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "WireWithdrawal": "wireWithdrawal", "Status": "status", }); }); /** @internal */ export type WireWithdrawalsCreateWireWithdrawalResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; WireWithdrawal?: components.WireWithdrawal$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const WireWithdrawalsCreateWireWithdrawalResponse$outboundSchema: z.ZodType< WireWithdrawalsCreateWireWithdrawalResponse$Outbound, z.ZodTypeDef, WireWithdrawalsCreateWireWithdrawalResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, wireWithdrawal: components.WireWithdrawal$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", wireWithdrawal: "WireWithdrawal", 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 WireWithdrawalsCreateWireWithdrawalResponse$ { /** @deprecated use `WireWithdrawalsCreateWireWithdrawalResponse$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalsCreateWireWithdrawalResponse$inboundSchema; /** @deprecated use `WireWithdrawalsCreateWireWithdrawalResponse$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalsCreateWireWithdrawalResponse$outboundSchema; /** @deprecated use `WireWithdrawalsCreateWireWithdrawalResponse$Outbound` instead. */ export type Outbound = WireWithdrawalsCreateWireWithdrawalResponse$Outbound; } export function wireWithdrawalsCreateWireWithdrawalResponseToJSON( wireWithdrawalsCreateWireWithdrawalResponse: WireWithdrawalsCreateWireWithdrawalResponse, ): string { return JSON.stringify( WireWithdrawalsCreateWireWithdrawalResponse$outboundSchema.parse( wireWithdrawalsCreateWireWithdrawalResponse, ), ); } export function wireWithdrawalsCreateWireWithdrawalResponseFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalsCreateWireWithdrawalResponse, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalsCreateWireWithdrawalResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WireWithdrawalsCreateWireWithdrawalResponse' from JSON`, ); }