/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PartyRequestCreate, PartyRequestCreate$inboundSchema, PartyRequestCreate$Outbound, PartyRequestCreate$outboundSchema, } from "./partyrequestcreate.js"; /** * A request to add a party to an account */ export type AddPartyRequestCreate = { /** * A list of Party IDs on the account that have approved the addition of a party. The required signers are defined by the Registration Type of the Account. e.g. Individual Registrations require one signer, Joint Registrations require all Joint Owners to sign */ authorizedByPartyIds?: Array | undefined; /** * The parent, which is the account to which the party is being added Format: accounts/{account}/parties */ parent: string; /** * A single record representing an owner or manager of an Account. Contains fully populated Party Identity object. */ party: PartyRequestCreate; }; /** @internal */ export const AddPartyRequestCreate$inboundSchema: z.ZodType< AddPartyRequestCreate, z.ZodTypeDef, unknown > = z.object({ authorized_by_party_ids: z.array(z.string()).optional(), parent: z.string(), party: PartyRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "authorized_by_party_ids": "authorizedByPartyIds", }); }); /** @internal */ export type AddPartyRequestCreate$Outbound = { authorized_by_party_ids?: Array | undefined; parent: string; party: PartyRequestCreate$Outbound; }; /** @internal */ export const AddPartyRequestCreate$outboundSchema: z.ZodType< AddPartyRequestCreate$Outbound, z.ZodTypeDef, AddPartyRequestCreate > = z.object({ authorizedByPartyIds: z.array(z.string()).optional(), parent: z.string(), party: PartyRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { authorizedByPartyIds: "authorized_by_party_ids", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AddPartyRequestCreate$ { /** @deprecated use `AddPartyRequestCreate$inboundSchema` instead. */ export const inboundSchema = AddPartyRequestCreate$inboundSchema; /** @deprecated use `AddPartyRequestCreate$outboundSchema` instead. */ export const outboundSchema = AddPartyRequestCreate$outboundSchema; /** @deprecated use `AddPartyRequestCreate$Outbound` instead. */ export type Outbound = AddPartyRequestCreate$Outbound; } export function addPartyRequestCreateToJSON( addPartyRequestCreate: AddPartyRequestCreate, ): string { return JSON.stringify( AddPartyRequestCreate$outboundSchema.parse(addPartyRequestCreate), ); } export function addPartyRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddPartyRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddPartyRequestCreate' from JSON`, ); }