/* * 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 AccountTransfersGetTransferRequest = { /** * The correspondent id. */ correspondentId: string; /** * The account id. */ accountId: string; /** * The transfer id. */ transferId: string; }; export type AccountTransfersGetTransferResponse = { httpMeta: components.HTTPMetadata; /** * OK */ acatsTransfer?: components.AcatsTransfer | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AccountTransfersGetTransferRequest$inboundSchema: z.ZodType< AccountTransfersGetTransferRequest, z.ZodTypeDef, unknown > = z.object({ correspondent_id: z.string(), account_id: z.string(), transfer_id: z.string(), }).transform((v) => { return remap$(v, { "correspondent_id": "correspondentId", "account_id": "accountId", "transfer_id": "transferId", }); }); /** @internal */ export type AccountTransfersGetTransferRequest$Outbound = { correspondent_id: string; account_id: string; transfer_id: string; }; /** @internal */ export const AccountTransfersGetTransferRequest$outboundSchema: z.ZodType< AccountTransfersGetTransferRequest$Outbound, z.ZodTypeDef, AccountTransfersGetTransferRequest > = z.object({ correspondentId: z.string(), accountId: z.string(), transferId: z.string(), }).transform((v) => { return remap$(v, { correspondentId: "correspondent_id", accountId: "account_id", transferId: "transfer_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountTransfersGetTransferRequest$ { /** @deprecated use `AccountTransfersGetTransferRequest$inboundSchema` instead. */ export const inboundSchema = AccountTransfersGetTransferRequest$inboundSchema; /** @deprecated use `AccountTransfersGetTransferRequest$outboundSchema` instead. */ export const outboundSchema = AccountTransfersGetTransferRequest$outboundSchema; /** @deprecated use `AccountTransfersGetTransferRequest$Outbound` instead. */ export type Outbound = AccountTransfersGetTransferRequest$Outbound; } export function accountTransfersGetTransferRequestToJSON( accountTransfersGetTransferRequest: AccountTransfersGetTransferRequest, ): string { return JSON.stringify( AccountTransfersGetTransferRequest$outboundSchema.parse( accountTransfersGetTransferRequest, ), ); } export function accountTransfersGetTransferRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountTransfersGetTransferRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountTransfersGetTransferRequest' from JSON`, ); } /** @internal */ export const AccountTransfersGetTransferResponse$inboundSchema: z.ZodType< AccountTransfersGetTransferResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AcatsTransfer: components.AcatsTransfer$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AcatsTransfer": "acatsTransfer", "Status": "status", }); }); /** @internal */ export type AccountTransfersGetTransferResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AcatsTransfer?: components.AcatsTransfer$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountTransfersGetTransferResponse$outboundSchema: z.ZodType< AccountTransfersGetTransferResponse$Outbound, z.ZodTypeDef, AccountTransfersGetTransferResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, acatsTransfer: components.AcatsTransfer$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", acatsTransfer: "AcatsTransfer", 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 AccountTransfersGetTransferResponse$ { /** @deprecated use `AccountTransfersGetTransferResponse$inboundSchema` instead. */ export const inboundSchema = AccountTransfersGetTransferResponse$inboundSchema; /** @deprecated use `AccountTransfersGetTransferResponse$outboundSchema` instead. */ export const outboundSchema = AccountTransfersGetTransferResponse$outboundSchema; /** @deprecated use `AccountTransfersGetTransferResponse$Outbound` instead. */ export type Outbound = AccountTransfersGetTransferResponse$Outbound; } export function accountTransfersGetTransferResponseToJSON( accountTransfersGetTransferResponse: AccountTransfersGetTransferResponse, ): string { return JSON.stringify( AccountTransfersGetTransferResponse$outboundSchema.parse( accountTransfersGetTransferResponse, ), ); } export function accountTransfersGetTransferResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountTransfersGetTransferResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountTransfersGetTransferResponse' from JSON`, ); }