/* * 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"; /** * A request to remove a party from an account */ export type RemovePartyRequestCreate = { /** * A list of Party IDs on the account that have approved the removal 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 remove Format: accounts/{account}/parties/{party} */ name: string; }; /** @internal */ export const RemovePartyRequestCreate$inboundSchema: z.ZodType< RemovePartyRequestCreate, z.ZodTypeDef, unknown > = z.object({ authorized_by_party_ids: z.array(z.string()).optional(), name: z.string(), }).transform((v) => { return remap$(v, { "authorized_by_party_ids": "authorizedByPartyIds", }); }); /** @internal */ export type RemovePartyRequestCreate$Outbound = { authorized_by_party_ids?: Array | undefined; name: string; }; /** @internal */ export const RemovePartyRequestCreate$outboundSchema: z.ZodType< RemovePartyRequestCreate$Outbound, z.ZodTypeDef, RemovePartyRequestCreate > = z.object({ authorizedByPartyIds: z.array(z.string()).optional(), name: z.string(), }).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 RemovePartyRequestCreate$ { /** @deprecated use `RemovePartyRequestCreate$inboundSchema` instead. */ export const inboundSchema = RemovePartyRequestCreate$inboundSchema; /** @deprecated use `RemovePartyRequestCreate$outboundSchema` instead. */ export const outboundSchema = RemovePartyRequestCreate$outboundSchema; /** @deprecated use `RemovePartyRequestCreate$Outbound` instead. */ export type Outbound = RemovePartyRequestCreate$Outbound; } export function removePartyRequestCreateToJSON( removePartyRequestCreate: RemovePartyRequestCreate, ): string { return JSON.stringify( RemovePartyRequestCreate$outboundSchema.parse(removePartyRequestCreate), ); } export function removePartyRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RemovePartyRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RemovePartyRequestCreate' from JSON`, ); }