/* * 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 AccountsUpdateInterestedPartyRequest = { /** * The account id. */ accountId: string; /** * The interestedParty id. */ interestedPartyId: string; /** * The list of fields to update. Updatable Fields `recipient` `statement_delivery_preference` `trade_confirmation_delivery_preference` `mailing_address.region_code` `mailing_address.postal_code` `mailing_address.administrative_area` `mailing_address.locality` `mailing_address.address_lines` */ updateMask?: string | undefined; interestedPartyUpdate: components.InterestedPartyUpdate; }; export type AccountsUpdateInterestedPartyResponse = { httpMeta: components.HTTPMetadata; /** * OK */ interestedParty?: components.InterestedParty | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsUpdateInterestedPartyRequest$inboundSchema: z.ZodType< AccountsUpdateInterestedPartyRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), interestedParty_id: z.string(), update_mask: z.string().optional(), InterestedPartyUpdate: components.InterestedPartyUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "interestedParty_id": "interestedPartyId", "update_mask": "updateMask", "InterestedPartyUpdate": "interestedPartyUpdate", }); }); /** @internal */ export type AccountsUpdateInterestedPartyRequest$Outbound = { account_id: string; interestedParty_id: string; update_mask?: string | undefined; InterestedPartyUpdate: components.InterestedPartyUpdate$Outbound; }; /** @internal */ export const AccountsUpdateInterestedPartyRequest$outboundSchema: z.ZodType< AccountsUpdateInterestedPartyRequest$Outbound, z.ZodTypeDef, AccountsUpdateInterestedPartyRequest > = z.object({ accountId: z.string(), interestedPartyId: z.string(), updateMask: z.string().optional(), interestedPartyUpdate: components.InterestedPartyUpdate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", interestedPartyId: "interestedParty_id", updateMask: "update_mask", interestedPartyUpdate: "InterestedPartyUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsUpdateInterestedPartyRequest$ { /** @deprecated use `AccountsUpdateInterestedPartyRequest$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateInterestedPartyRequest$inboundSchema; /** @deprecated use `AccountsUpdateInterestedPartyRequest$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateInterestedPartyRequest$outboundSchema; /** @deprecated use `AccountsUpdateInterestedPartyRequest$Outbound` instead. */ export type Outbound = AccountsUpdateInterestedPartyRequest$Outbound; } export function accountsUpdateInterestedPartyRequestToJSON( accountsUpdateInterestedPartyRequest: AccountsUpdateInterestedPartyRequest, ): string { return JSON.stringify( AccountsUpdateInterestedPartyRequest$outboundSchema.parse( accountsUpdateInterestedPartyRequest, ), ); } export function accountsUpdateInterestedPartyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsUpdateInterestedPartyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsUpdateInterestedPartyRequest' from JSON`, ); } /** @internal */ export const AccountsUpdateInterestedPartyResponse$inboundSchema: z.ZodType< AccountsUpdateInterestedPartyResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, InterestedParty: components.InterestedParty$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "InterestedParty": "interestedParty", "Status": "status", }); }); /** @internal */ export type AccountsUpdateInterestedPartyResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; InterestedParty?: components.InterestedParty$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsUpdateInterestedPartyResponse$outboundSchema: z.ZodType< AccountsUpdateInterestedPartyResponse$Outbound, z.ZodTypeDef, AccountsUpdateInterestedPartyResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, interestedParty: components.InterestedParty$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", interestedParty: "InterestedParty", 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 AccountsUpdateInterestedPartyResponse$ { /** @deprecated use `AccountsUpdateInterestedPartyResponse$inboundSchema` instead. */ export const inboundSchema = AccountsUpdateInterestedPartyResponse$inboundSchema; /** @deprecated use `AccountsUpdateInterestedPartyResponse$outboundSchema` instead. */ export const outboundSchema = AccountsUpdateInterestedPartyResponse$outboundSchema; /** @deprecated use `AccountsUpdateInterestedPartyResponse$Outbound` instead. */ export type Outbound = AccountsUpdateInterestedPartyResponse$Outbound; } export function accountsUpdateInterestedPartyResponseToJSON( accountsUpdateInterestedPartyResponse: AccountsUpdateInterestedPartyResponse, ): string { return JSON.stringify( AccountsUpdateInterestedPartyResponse$outboundSchema.parse( accountsUpdateInterestedPartyResponse, ), ); } export function accountsUpdateInterestedPartyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsUpdateInterestedPartyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsUpdateInterestedPartyResponse' from JSON`, ); }