/* * 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 BankRelationshipsUpdateBankRelationshipRequest = { /** * The account id. */ accountId: string; /** * The bankRelationship id. */ bankRelationshipId: string; /** * The field of the bank relationship to update. Only `nickname` is supported. */ updateMask?: string | undefined; bankRelationshipUpdate: components.BankRelationshipUpdate; }; export type BankRelationshipsUpdateBankRelationshipResponse = { httpMeta: components.HTTPMetadata; /** * OK */ bankRelationship?: components.BankRelationship | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const BankRelationshipsUpdateBankRelationshipRequest$inboundSchema: z.ZodType< BankRelationshipsUpdateBankRelationshipRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), bankRelationship_id: z.string(), update_mask: z.string().optional(), BankRelationshipUpdate: components.BankRelationshipUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "bankRelationship_id": "bankRelationshipId", "update_mask": "updateMask", "BankRelationshipUpdate": "bankRelationshipUpdate", }); }); /** @internal */ export type BankRelationshipsUpdateBankRelationshipRequest$Outbound = { account_id: string; bankRelationship_id: string; update_mask?: string | undefined; BankRelationshipUpdate: components.BankRelationshipUpdate$Outbound; }; /** @internal */ export const BankRelationshipsUpdateBankRelationshipRequest$outboundSchema: z.ZodType< BankRelationshipsUpdateBankRelationshipRequest$Outbound, z.ZodTypeDef, BankRelationshipsUpdateBankRelationshipRequest > = z.object({ accountId: z.string(), bankRelationshipId: z.string(), updateMask: z.string().optional(), bankRelationshipUpdate: components.BankRelationshipUpdate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", bankRelationshipId: "bankRelationship_id", updateMask: "update_mask", bankRelationshipUpdate: "BankRelationshipUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BankRelationshipsUpdateBankRelationshipRequest$ { /** @deprecated use `BankRelationshipsUpdateBankRelationshipRequest$inboundSchema` instead. */ export const inboundSchema = BankRelationshipsUpdateBankRelationshipRequest$inboundSchema; /** @deprecated use `BankRelationshipsUpdateBankRelationshipRequest$outboundSchema` instead. */ export const outboundSchema = BankRelationshipsUpdateBankRelationshipRequest$outboundSchema; /** @deprecated use `BankRelationshipsUpdateBankRelationshipRequest$Outbound` instead. */ export type Outbound = BankRelationshipsUpdateBankRelationshipRequest$Outbound; } export function bankRelationshipsUpdateBankRelationshipRequestToJSON( bankRelationshipsUpdateBankRelationshipRequest: BankRelationshipsUpdateBankRelationshipRequest, ): string { return JSON.stringify( BankRelationshipsUpdateBankRelationshipRequest$outboundSchema.parse( bankRelationshipsUpdateBankRelationshipRequest, ), ); } export function bankRelationshipsUpdateBankRelationshipRequestFromJSON( jsonString: string, ): SafeParseResult< BankRelationshipsUpdateBankRelationshipRequest, SDKValidationError > { return safeParse( jsonString, (x) => BankRelationshipsUpdateBankRelationshipRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'BankRelationshipsUpdateBankRelationshipRequest' from JSON`, ); } /** @internal */ export const BankRelationshipsUpdateBankRelationshipResponse$inboundSchema: z.ZodType< BankRelationshipsUpdateBankRelationshipResponse, 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 BankRelationshipsUpdateBankRelationshipResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; BankRelationship?: components.BankRelationship$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const BankRelationshipsUpdateBankRelationshipResponse$outboundSchema: z.ZodType< BankRelationshipsUpdateBankRelationshipResponse$Outbound, z.ZodTypeDef, BankRelationshipsUpdateBankRelationshipResponse > = 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 BankRelationshipsUpdateBankRelationshipResponse$ { /** @deprecated use `BankRelationshipsUpdateBankRelationshipResponse$inboundSchema` instead. */ export const inboundSchema = BankRelationshipsUpdateBankRelationshipResponse$inboundSchema; /** @deprecated use `BankRelationshipsUpdateBankRelationshipResponse$outboundSchema` instead. */ export const outboundSchema = BankRelationshipsUpdateBankRelationshipResponse$outboundSchema; /** @deprecated use `BankRelationshipsUpdateBankRelationshipResponse$Outbound` instead. */ export type Outbound = BankRelationshipsUpdateBankRelationshipResponse$Outbound; } export function bankRelationshipsUpdateBankRelationshipResponseToJSON( bankRelationshipsUpdateBankRelationshipResponse: BankRelationshipsUpdateBankRelationshipResponse, ): string { return JSON.stringify( BankRelationshipsUpdateBankRelationshipResponse$outboundSchema.parse( bankRelationshipsUpdateBankRelationshipResponse, ), ); } export function bankRelationshipsUpdateBankRelationshipResponseFromJSON( jsonString: string, ): SafeParseResult< BankRelationshipsUpdateBankRelationshipResponse, SDKValidationError > { return safeParse( jsonString, (x) => BankRelationshipsUpdateBankRelationshipResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'BankRelationshipsUpdateBankRelationshipResponse' from JSON`, ); }