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