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