/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AlternativeInvestmentsGetAlternativeInvestmentRequest = { /** * The asset id. */ assetId: string; }; export type AlternativeInvestmentsGetAlternativeInvestmentResponse = { httpMeta: components.HTTPMetadata; /** * OK */ alternativeInvestment?: components.AlternativeInvestment | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AlternativeInvestmentsGetAlternativeInvestmentRequest$inboundSchema: z.ZodType< AlternativeInvestmentsGetAlternativeInvestmentRequest, z.ZodTypeDef, unknown > = z.object({ asset_id: z.string(), }).transform((v) => { return remap$(v, { "asset_id": "assetId", }); }); /** @internal */ export type AlternativeInvestmentsGetAlternativeInvestmentRequest$Outbound = { asset_id: string; }; /** @internal */ export const AlternativeInvestmentsGetAlternativeInvestmentRequest$outboundSchema: z.ZodType< AlternativeInvestmentsGetAlternativeInvestmentRequest$Outbound, z.ZodTypeDef, AlternativeInvestmentsGetAlternativeInvestmentRequest > = z.object({ assetId: z.string(), }).transform((v) => { return remap$(v, { assetId: "asset_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeInvestmentsGetAlternativeInvestmentRequest$ { /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentRequest$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentsGetAlternativeInvestmentRequest$inboundSchema; /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentRequest$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentsGetAlternativeInvestmentRequest$outboundSchema; /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentRequest$Outbound` instead. */ export type Outbound = AlternativeInvestmentsGetAlternativeInvestmentRequest$Outbound; } export function alternativeInvestmentsGetAlternativeInvestmentRequestToJSON( alternativeInvestmentsGetAlternativeInvestmentRequest: AlternativeInvestmentsGetAlternativeInvestmentRequest, ): string { return JSON.stringify( AlternativeInvestmentsGetAlternativeInvestmentRequest$outboundSchema.parse( alternativeInvestmentsGetAlternativeInvestmentRequest, ), ); } export function alternativeInvestmentsGetAlternativeInvestmentRequestFromJSON( jsonString: string, ): SafeParseResult< AlternativeInvestmentsGetAlternativeInvestmentRequest, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeInvestmentsGetAlternativeInvestmentRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AlternativeInvestmentsGetAlternativeInvestmentRequest' from JSON`, ); } /** @internal */ export const AlternativeInvestmentsGetAlternativeInvestmentResponse$inboundSchema: z.ZodType< AlternativeInvestmentsGetAlternativeInvestmentResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AlternativeInvestment: components.AlternativeInvestment$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AlternativeInvestment": "alternativeInvestment", "Status": "status", }); }); /** @internal */ export type AlternativeInvestmentsGetAlternativeInvestmentResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AlternativeInvestment?: components.AlternativeInvestment$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AlternativeInvestmentsGetAlternativeInvestmentResponse$outboundSchema: z.ZodType< AlternativeInvestmentsGetAlternativeInvestmentResponse$Outbound, z.ZodTypeDef, AlternativeInvestmentsGetAlternativeInvestmentResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, alternativeInvestment: components.AlternativeInvestment$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", alternativeInvestment: "AlternativeInvestment", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeInvestmentsGetAlternativeInvestmentResponse$ { /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentResponse$inboundSchema` instead. */ export const inboundSchema = AlternativeInvestmentsGetAlternativeInvestmentResponse$inboundSchema; /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentResponse$outboundSchema` instead. */ export const outboundSchema = AlternativeInvestmentsGetAlternativeInvestmentResponse$outboundSchema; /** @deprecated use `AlternativeInvestmentsGetAlternativeInvestmentResponse$Outbound` instead. */ export type Outbound = AlternativeInvestmentsGetAlternativeInvestmentResponse$Outbound; } export function alternativeInvestmentsGetAlternativeInvestmentResponseToJSON( alternativeInvestmentsGetAlternativeInvestmentResponse: AlternativeInvestmentsGetAlternativeInvestmentResponse, ): string { return JSON.stringify( AlternativeInvestmentsGetAlternativeInvestmentResponse$outboundSchema.parse( alternativeInvestmentsGetAlternativeInvestmentResponse, ), ); } export function alternativeInvestmentsGetAlternativeInvestmentResponseFromJSON( jsonString: string, ): SafeParseResult< AlternativeInvestmentsGetAlternativeInvestmentResponse, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeInvestmentsGetAlternativeInvestmentResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AlternativeInvestmentsGetAlternativeInvestmentResponse' from JSON`, ); }