/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Request to reject internal Ascend transfers. */ export type RejectTransferRequestCreate = { /** * Comment to add to the transfer resource's audit trail */ comment?: string | undefined; /** * The name of the transfer to reject Format: correspondents/{correspondent_id}/accounts/{account_id}/transfers/{transfer_id} */ name: string; /** * The reason for the rejection to add to the the transfer resource's audit trail */ stateReason?: string | undefined; }; /** @internal */ export const RejectTransferRequestCreate$inboundSchema: z.ZodType< RejectTransferRequestCreate, z.ZodTypeDef, unknown > = z.object({ comment: z.string().optional(), name: z.string(), state_reason: z.string().optional(), }).transform((v) => { return remap$(v, { "state_reason": "stateReason", }); }); /** @internal */ export type RejectTransferRequestCreate$Outbound = { comment?: string | undefined; name: string; state_reason?: string | undefined; }; /** @internal */ export const RejectTransferRequestCreate$outboundSchema: z.ZodType< RejectTransferRequestCreate$Outbound, z.ZodTypeDef, RejectTransferRequestCreate > = z.object({ comment: z.string().optional(), name: z.string(), stateReason: z.string().optional(), }).transform((v) => { return remap$(v, { stateReason: "state_reason", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RejectTransferRequestCreate$ { /** @deprecated use `RejectTransferRequestCreate$inboundSchema` instead. */ export const inboundSchema = RejectTransferRequestCreate$inboundSchema; /** @deprecated use `RejectTransferRequestCreate$outboundSchema` instead. */ export const outboundSchema = RejectTransferRequestCreate$outboundSchema; /** @deprecated use `RejectTransferRequestCreate$Outbound` instead. */ export type Outbound = RejectTransferRequestCreate$Outbound; } export function rejectTransferRequestCreateToJSON( rejectTransferRequestCreate: RejectTransferRequestCreate, ): string { return JSON.stringify( RejectTransferRequestCreate$outboundSchema.parse( rejectTransferRequestCreate, ), ); } export function rejectTransferRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferRequestCreate' from JSON`, ); }