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