/* * 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 BankRelationshipsGetBankRelationshipRequest = { /** * The account id. */ accountId: string; /** * The bankRelationship id. */ bankRelationshipId: string; }; export type BankRelationshipsGetBankRelationshipResponse = { httpMeta: components.HTTPMetadata; /** * OK */ bankRelationship?: components.BankRelationship | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const BankRelationshipsGetBankRelationshipRequest$inboundSchema: z.ZodType< BankRelationshipsGetBankRelationshipRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), bankRelationship_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "bankRelationship_id": "bankRelationshipId", }); }); /** @internal */ export type BankRelationshipsGetBankRelationshipRequest$Outbound = { account_id: string; bankRelationship_id: string; }; /** @internal */ export const BankRelationshipsGetBankRelationshipRequest$outboundSchema: z.ZodType< BankRelationshipsGetBankRelationshipRequest$Outbound, z.ZodTypeDef, BankRelationshipsGetBankRelationshipRequest > = z.object({ accountId: z.string(), bankRelationshipId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", bankRelationshipId: "bankRelationship_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BankRelationshipsGetBankRelationshipRequest$ { /** @deprecated use `BankRelationshipsGetBankRelationshipRequest$inboundSchema` instead. */ export const inboundSchema = BankRelationshipsGetBankRelationshipRequest$inboundSchema; /** @deprecated use `BankRelationshipsGetBankRelationshipRequest$outboundSchema` instead. */ export const outboundSchema = BankRelationshipsGetBankRelationshipRequest$outboundSchema; /** @deprecated use `BankRelationshipsGetBankRelationshipRequest$Outbound` instead. */ export type Outbound = BankRelationshipsGetBankRelationshipRequest$Outbound; } export function bankRelationshipsGetBankRelationshipRequestToJSON( bankRelationshipsGetBankRelationshipRequest: BankRelationshipsGetBankRelationshipRequest, ): string { return JSON.stringify( BankRelationshipsGetBankRelationshipRequest$outboundSchema.parse( bankRelationshipsGetBankRelationshipRequest, ), ); } export function bankRelationshipsGetBankRelationshipRequestFromJSON( jsonString: string, ): SafeParseResult< BankRelationshipsGetBankRelationshipRequest, SDKValidationError > { return safeParse( jsonString, (x) => BankRelationshipsGetBankRelationshipRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'BankRelationshipsGetBankRelationshipRequest' from JSON`, ); } /** @internal */ export const BankRelationshipsGetBankRelationshipResponse$inboundSchema: z.ZodType< BankRelationshipsGetBankRelationshipResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, BankRelationship: components.BankRelationship$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "BankRelationship": "bankRelationship", "Status": "status", }); }); /** @internal */ export type BankRelationshipsGetBankRelationshipResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; BankRelationship?: components.BankRelationship$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const BankRelationshipsGetBankRelationshipResponse$outboundSchema: z.ZodType< BankRelationshipsGetBankRelationshipResponse$Outbound, z.ZodTypeDef, BankRelationshipsGetBankRelationshipResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, bankRelationship: components.BankRelationship$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", bankRelationship: "BankRelationship", 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 BankRelationshipsGetBankRelationshipResponse$ { /** @deprecated use `BankRelationshipsGetBankRelationshipResponse$inboundSchema` instead. */ export const inboundSchema = BankRelationshipsGetBankRelationshipResponse$inboundSchema; /** @deprecated use `BankRelationshipsGetBankRelationshipResponse$outboundSchema` instead. */ export const outboundSchema = BankRelationshipsGetBankRelationshipResponse$outboundSchema; /** @deprecated use `BankRelationshipsGetBankRelationshipResponse$Outbound` instead. */ export type Outbound = BankRelationshipsGetBankRelationshipResponse$Outbound; } export function bankRelationshipsGetBankRelationshipResponseToJSON( bankRelationshipsGetBankRelationshipResponse: BankRelationshipsGetBankRelationshipResponse, ): string { return JSON.stringify( BankRelationshipsGetBankRelationshipResponse$outboundSchema.parse( bankRelationshipsGetBankRelationshipResponse, ), ); } export function bankRelationshipsGetBankRelationshipResponseFromJSON( jsonString: string, ): SafeParseResult< BankRelationshipsGetBankRelationshipResponse, SDKValidationError > { return safeParse( jsonString, (x) => BankRelationshipsGetBankRelationshipResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'BankRelationshipsGetBankRelationshipResponse' from JSON`, ); }