/* * 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 replace a party on an account */ export type ReplacePartyRequestCreate = { /** * A list of Party IDs on the account that have approved the replacing 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 ID of the party to replace Format: accounts/{account}/parties/{party} */ name: string; /** * A single record representing an owner or manager of an Account. Contains fully populated Party Identity object. */ party: PartyRequestCreate; }; /** @internal */ export const ReplacePartyRequestCreate$inboundSchema: z.ZodType< ReplacePartyRequestCreate, z.ZodTypeDef, unknown > = z.object({ authorized_by_party_ids: z.array(z.string()).optional(), name: z.string(), party: PartyRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "authorized_by_party_ids": "authorizedByPartyIds", }); }); /** @internal */ export type ReplacePartyRequestCreate$Outbound = { authorized_by_party_ids?: Array | undefined; name: string; party: PartyRequestCreate$Outbound; }; /** @internal */ export const ReplacePartyRequestCreate$outboundSchema: z.ZodType< ReplacePartyRequestCreate$Outbound, z.ZodTypeDef, ReplacePartyRequestCreate > = z.object({ authorizedByPartyIds: z.array(z.string()).optional(), name: 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 ReplacePartyRequestCreate$ { /** @deprecated use `ReplacePartyRequestCreate$inboundSchema` instead. */ export const inboundSchema = ReplacePartyRequestCreate$inboundSchema; /** @deprecated use `ReplacePartyRequestCreate$outboundSchema` instead. */ export const outboundSchema = ReplacePartyRequestCreate$outboundSchema; /** @deprecated use `ReplacePartyRequestCreate$Outbound` instead. */ export type Outbound = ReplacePartyRequestCreate$Outbound; } export function replacePartyRequestCreateToJSON( replacePartyRequestCreate: ReplacePartyRequestCreate, ): string { return JSON.stringify( ReplacePartyRequestCreate$outboundSchema.parse(replacePartyRequestCreate), ); } export function replacePartyRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReplacePartyRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReplacePartyRequestCreate' from JSON`, ); }