/* * 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 investment document’s type. */ export enum AlternativeInvestmentDocumentType { TypeUnspecified = "TYPE_UNSPECIFIED", OfferingDocument = "OFFERING_DOCUMENT", SubscriptionAgreement = "SUBSCRIPTION_AGREEMENT", K1 = "K1", RiskFactors = "RISK_FACTORS", KeyTerms = "KEY_TERMS", } /** * The investment document’s type. */ export type AlternativeInvestmentDocumentTypeOpen = OpenEnum< typeof AlternativeInvestmentDocumentType >; /** * An alternative investment asset document. */ export type AlternativeInvestmentDocument = { /** * The ID of the parent asset. */ assetId?: string | undefined; /** * The ID of the investment document. */ documentId?: string | undefined; /** * The resource name of the document. Format: assets/{asset}/alternativeInvestmentDocuments/{alternative_investment_document} Note that `{asset}` will be the parent `asset_id` value and `{alternative_investment_document}` will be the `alternativeInvestmentDocument_id` value. */ name?: string | undefined; /** * The investment document’s title. */ title?: string | undefined; /** * The investment document’s type. */ type?: AlternativeInvestmentDocumentTypeOpen | undefined; }; /** @internal */ export const AlternativeInvestmentDocumentType$inboundSchema: z.ZodType< AlternativeInvestmentDocumentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AlternativeInvestmentDocumentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AlternativeInvestmentDocumentType$outboundSchema: z.ZodType< AlternativeInvestmentDocumentTypeOpen, z.ZodTypeDef, AlternativeInvestmentDocumentTypeOpen > = z.union([ z.nativeEnum(AlternativeInvestmentDocumentType), 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 AlternativeInvestmentDocumentType$ { /** @deprecated use `AlternativeInvestmentDocumentType$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentDocumentType$inboundSchema; /** @deprecated use `AlternativeInvestmentDocumentType$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentDocumentType$outboundSchema; } /** @internal */ export const AlternativeInvestmentDocument$inboundSchema: z.ZodType< AlternativeInvestmentDocument, z.ZodTypeDef, unknown > = z.object({ asset_id: z.string().optional(), document_id: z.string().optional(), name: z.string().optional(), title: z.string().optional(), type: AlternativeInvestmentDocumentType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "asset_id": "assetId", "document_id": "documentId", }); }); /** @internal */ export type AlternativeInvestmentDocument$Outbound = { asset_id?: string | undefined; document_id?: string | undefined; name?: string | undefined; title?: string | undefined; type?: string | undefined; }; /** @internal */ export const AlternativeInvestmentDocument$outboundSchema: z.ZodType< AlternativeInvestmentDocument$Outbound, z.ZodTypeDef, AlternativeInvestmentDocument > = z.object({ assetId: z.string().optional(), documentId: z.string().optional(), name: z.string().optional(), title: z.string().optional(), type: AlternativeInvestmentDocumentType$outboundSchema.optional(), }).transform((v) => { return remap$(v, { assetId: "asset_id", documentId: "document_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeInvestmentDocument$ { /** @deprecated use `AlternativeInvestmentDocument$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentDocument$inboundSchema; /** @deprecated use `AlternativeInvestmentDocument$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentDocument$outboundSchema; /** @deprecated use `AlternativeInvestmentDocument$Outbound` instead. */ export type Outbound = AlternativeInvestmentDocument$Outbound; } export function alternativeInvestmentDocumentToJSON( alternativeInvestmentDocument: AlternativeInvestmentDocument, ): string { return JSON.stringify( AlternativeInvestmentDocument$outboundSchema.parse( alternativeInvestmentDocument, ), ); } export function alternativeInvestmentDocumentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeInvestmentDocument$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeInvestmentDocument' from JSON`, ); }