/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The new accreditation type for the specified account. */ export enum SetAccountAccreditationTypeRequestCreateAccreditationType { AccreditationTypeUnspecified = "ACCREDITATION_TYPE_UNSPECIFIED", NetWorthGt1M = "NET_WORTH_GT_1M", IndividualIncomeGt200K = "INDIVIDUAL_INCOME_GT_200K", JointIncomeGt300K = "JOINT_INCOME_GT_300K", ProfessionDesignation = "PROFESSION_DESIGNATION", TrustGt5M = "TRUST_GT_5M", GrantorsAccredited = "GRANTORS_ACCREDITED", EquityOwnersAccredited = "EQUITY_OWNERS_ACCREDITED", TotalAssetsGt5M = "TOTAL_ASSETS_GT_5M", InvestmentCompany = "INVESTMENT_COMPANY", SecOrExemptAdvisor = "SEC_OR_EXEMPT_ADVISOR", KnowledgeableEmployee = "KNOWLEDGEABLE_EMPLOYEE", KnowledgeableExecutive = "KNOWLEDGEABLE_EXECUTIVE", FamilyOfficeGt5M = "FAMILY_OFFICE_GT_5M", NotAccredited = "NOT_ACCREDITED", } /** * The new accreditation type for the specified account. */ export type SetAccountAccreditationTypeRequestCreateAccreditationTypeOpen = OpenEnum; /** * Request for setting an account's accreditation type */ export type SetAccountAccreditationTypeRequestCreate = { /** * The new accreditation type for the specified account. */ accreditationType: SetAccountAccreditationTypeRequestCreateAccreditationTypeOpen; /** * The resource name of the account accreditation. Note `{account}` will be the `account_id` value. * * @remarks * * Format: accounts/{account}/accreditation */ name: string; }; /** @internal */ export const SetAccountAccreditationTypeRequestCreateAccreditationType$inboundSchema: z.ZodType< SetAccountAccreditationTypeRequestCreateAccreditationTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetAccountAccreditationTypeRequestCreateAccreditationType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetAccountAccreditationTypeRequestCreateAccreditationType$outboundSchema: z.ZodType< SetAccountAccreditationTypeRequestCreateAccreditationTypeOpen, z.ZodTypeDef, SetAccountAccreditationTypeRequestCreateAccreditationTypeOpen > = z.union([ z.nativeEnum(SetAccountAccreditationTypeRequestCreateAccreditationType), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SetAccountAccreditationTypeRequestCreateAccreditationType$ { /** @deprecated use `SetAccountAccreditationTypeRequestCreateAccreditationType$inboundSchema` instead. */ export const inboundSchema = SetAccountAccreditationTypeRequestCreateAccreditationType$inboundSchema; /** @deprecated use `SetAccountAccreditationTypeRequestCreateAccreditationType$outboundSchema` instead. */ export const outboundSchema = SetAccountAccreditationTypeRequestCreateAccreditationType$outboundSchema; } /** @internal */ export const SetAccountAccreditationTypeRequestCreate$inboundSchema: z.ZodType< SetAccountAccreditationTypeRequestCreate, z.ZodTypeDef, unknown > = z.object({ accreditation_type: SetAccountAccreditationTypeRequestCreateAccreditationType$inboundSchema, name: z.string(), }).transform((v) => { return remap$(v, { "accreditation_type": "accreditationType", }); }); /** @internal */ export type SetAccountAccreditationTypeRequestCreate$Outbound = { accreditation_type: string; name: string; }; /** @internal */ export const SetAccountAccreditationTypeRequestCreate$outboundSchema: z.ZodType< SetAccountAccreditationTypeRequestCreate$Outbound, z.ZodTypeDef, SetAccountAccreditationTypeRequestCreate > = z.object({ accreditationType: SetAccountAccreditationTypeRequestCreateAccreditationType$outboundSchema, name: z.string(), }).transform((v) => { return remap$(v, { accreditationType: "accreditation_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SetAccountAccreditationTypeRequestCreate$ { /** @deprecated use `SetAccountAccreditationTypeRequestCreate$inboundSchema` instead. */ export const inboundSchema = SetAccountAccreditationTypeRequestCreate$inboundSchema; /** @deprecated use `SetAccountAccreditationTypeRequestCreate$outboundSchema` instead. */ export const outboundSchema = SetAccountAccreditationTypeRequestCreate$outboundSchema; /** @deprecated use `SetAccountAccreditationTypeRequestCreate$Outbound` instead. */ export type Outbound = SetAccountAccreditationTypeRequestCreate$Outbound; } export function setAccountAccreditationTypeRequestCreateToJSON( setAccountAccreditationTypeRequestCreate: SetAccountAccreditationTypeRequestCreate, ): string { return JSON.stringify( SetAccountAccreditationTypeRequestCreate$outboundSchema.parse( setAccountAccreditationTypeRequestCreate, ), ); } export function setAccountAccreditationTypeRequestCreateFromJSON( jsonString: string, ): SafeParseResult< SetAccountAccreditationTypeRequestCreate, SDKValidationError > { return safeParse( jsonString, (x) => SetAccountAccreditationTypeRequestCreate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetAccountAccreditationTypeRequestCreate' from JSON`, ); }