/* * 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 last valuation of the Pre IPO Company in USD. */ export type LastValuation = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The total funding amount the Pre IPO Company has raised in USD. */ export type TotalFunding = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The total revenue generated by the Pre IPO Company in the last twelve months in USD. */ export type TwelveMonthTrailingRevenue = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The type of the Pre IPO Company. */ export enum PreIpoCompanyType { TypeUnspecified = "TYPE_UNSPECIFIED", SoleProprietor = "SOLE_PROPRIETOR", SingleMemberLlc = "SINGLE_MEMBER_LLC", Llc = "LLC", Partnership = "PARTNERSHIP", CCorporation = "C_CORPORATION", SCorporation = "S_CORPORATION", Trust = "TRUST", IraOrTaxExempt = "IRA_OR_TAX_EXEMPT", NonUsCorporation = "NON_US_CORPORATION", PrivateLimitedCompany = "PRIVATE_LIMITED_COMPANY", PublicLimitedCompany = "PUBLIC_LIMITED_COMPANY", TaxExemptEntity = "TAX_EXEMPT_ENTITY", ForeignTrust = "FOREIGN_TRUST", Other = "OTHER", } /** * The type of the Pre IPO Company. */ export type PreIpoCompanyTypeOpen = OpenEnum; /** * A Pre IPO Company. */ export type PreIpoCompany = { /** * Whether the Pre IPO Company is currently active. Companies are updated to inactive if they experience a bankruptcy, shutdown, or similar corporate event. */ active?: boolean | undefined; /** * The categories the Pre IPO Company belongs to. */ categories?: Array | undefined; /** * The description of the Pre IPO Company. */ description?: string | undefined; /** * The executive team of the Pre IPO Company. */ executiveTeam?: Array | undefined; /** * The company's Facebook URI. */ facebookUri?: string | undefined; /** * The founder of the Pre IPO Company. */ founder?: string | undefined; /** * The last valuation of the Pre IPO Company in USD. */ lastValuation?: LastValuation | null | undefined; /** * The company's LinkedIn URI. */ linkedinUri?: string | undefined; /** * The company's logo URI. */ logoUri?: string | undefined; /** * The resource name of the Pre IPO Company. Format: preIpoCompanies/{pre_ipo_company} */ name?: string | undefined; /** * The ID of the Pre IPO Company. */ preIpoCompanyId?: string | undefined; /** * The region code where the Pre IPO Company is located. */ regionCode?: string | undefined; /** * The unique symbol assigned to the Pre IPO Company. */ symbol?: string | undefined; /** * The title of the Pre IPO Company. */ title?: string | undefined; /** * The total funding amount the Pre IPO Company has raised in USD. */ totalFunding?: TotalFunding | null | undefined; /** * The total revenue generated by the Pre IPO Company in the last twelve months in USD. */ twelveMonthTrailingRevenue?: TwelveMonthTrailingRevenue | null | undefined; /** * The type of the Pre IPO Company. */ type?: PreIpoCompanyTypeOpen | undefined; /** * The company's official website URI. */ websiteUri?: string | undefined; /** * The company's X URI. */ xUri?: string | undefined; /** * The year the Pre IPO Company was established. */ yearEstablished?: number | undefined; }; /** @internal */ export const LastValuation$inboundSchema: z.ZodType< LastValuation, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type LastValuation$Outbound = { value?: string | undefined; }; /** @internal */ export const LastValuation$outboundSchema: z.ZodType< LastValuation$Outbound, z.ZodTypeDef, LastValuation > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LastValuation$ { /** @deprecated use `LastValuation$inboundSchema` instead. */ export const inboundSchema = LastValuation$inboundSchema; /** @deprecated use `LastValuation$outboundSchema` instead. */ export const outboundSchema = LastValuation$outboundSchema; /** @deprecated use `LastValuation$Outbound` instead. */ export type Outbound = LastValuation$Outbound; } export function lastValuationToJSON(lastValuation: LastValuation): string { return JSON.stringify(LastValuation$outboundSchema.parse(lastValuation)); } export function lastValuationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LastValuation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LastValuation' from JSON`, ); } /** @internal */ export const TotalFunding$inboundSchema: z.ZodType< TotalFunding, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TotalFunding$Outbound = { value?: string | undefined; }; /** @internal */ export const TotalFunding$outboundSchema: z.ZodType< TotalFunding$Outbound, z.ZodTypeDef, TotalFunding > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TotalFunding$ { /** @deprecated use `TotalFunding$inboundSchema` instead. */ export const inboundSchema = TotalFunding$inboundSchema; /** @deprecated use `TotalFunding$outboundSchema` instead. */ export const outboundSchema = TotalFunding$outboundSchema; /** @deprecated use `TotalFunding$Outbound` instead. */ export type Outbound = TotalFunding$Outbound; } export function totalFundingToJSON(totalFunding: TotalFunding): string { return JSON.stringify(TotalFunding$outboundSchema.parse(totalFunding)); } export function totalFundingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TotalFunding$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TotalFunding' from JSON`, ); } /** @internal */ export const TwelveMonthTrailingRevenue$inboundSchema: z.ZodType< TwelveMonthTrailingRevenue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TwelveMonthTrailingRevenue$Outbound = { value?: string | undefined; }; /** @internal */ export const TwelveMonthTrailingRevenue$outboundSchema: z.ZodType< TwelveMonthTrailingRevenue$Outbound, z.ZodTypeDef, TwelveMonthTrailingRevenue > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TwelveMonthTrailingRevenue$ { /** @deprecated use `TwelveMonthTrailingRevenue$inboundSchema` instead. */ export const inboundSchema = TwelveMonthTrailingRevenue$inboundSchema; /** @deprecated use `TwelveMonthTrailingRevenue$outboundSchema` instead. */ export const outboundSchema = TwelveMonthTrailingRevenue$outboundSchema; /** @deprecated use `TwelveMonthTrailingRevenue$Outbound` instead. */ export type Outbound = TwelveMonthTrailingRevenue$Outbound; } export function twelveMonthTrailingRevenueToJSON( twelveMonthTrailingRevenue: TwelveMonthTrailingRevenue, ): string { return JSON.stringify( TwelveMonthTrailingRevenue$outboundSchema.parse(twelveMonthTrailingRevenue), ); } export function twelveMonthTrailingRevenueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TwelveMonthTrailingRevenue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TwelveMonthTrailingRevenue' from JSON`, ); } /** @internal */ export const PreIpoCompanyType$inboundSchema: z.ZodType< PreIpoCompanyTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(PreIpoCompanyType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const PreIpoCompanyType$outboundSchema: z.ZodType< PreIpoCompanyTypeOpen, z.ZodTypeDef, PreIpoCompanyTypeOpen > = z.union([ z.nativeEnum(PreIpoCompanyType), 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 PreIpoCompanyType$ { /** @deprecated use `PreIpoCompanyType$inboundSchema` instead. */ export const inboundSchema = PreIpoCompanyType$inboundSchema; /** @deprecated use `PreIpoCompanyType$outboundSchema` instead. */ export const outboundSchema = PreIpoCompanyType$outboundSchema; } /** @internal */ export const PreIpoCompany$inboundSchema: z.ZodType< PreIpoCompany, z.ZodTypeDef, unknown > = z.object({ active: z.boolean().optional(), categories: z.array(z.string()).optional(), description: z.string().optional(), executive_team: z.array(z.string()).optional(), facebook_uri: z.string().optional(), founder: z.string().optional(), last_valuation: z.nullable(z.lazy(() => LastValuation$inboundSchema)) .optional(), linkedin_uri: z.string().optional(), logo_uri: z.string().optional(), name: z.string().optional(), pre_ipo_company_id: z.string().optional(), region_code: z.string().optional(), symbol: z.string().optional(), title: z.string().optional(), total_funding: z.nullable(z.lazy(() => TotalFunding$inboundSchema)) .optional(), twelve_month_trailing_revenue: z.nullable( z.lazy(() => TwelveMonthTrailingRevenue$inboundSchema), ).optional(), type: PreIpoCompanyType$inboundSchema.optional(), website_uri: z.string().optional(), x_uri: z.string().optional(), year_established: z.number().int().optional(), }).transform((v) => { return remap$(v, { "executive_team": "executiveTeam", "facebook_uri": "facebookUri", "last_valuation": "lastValuation", "linkedin_uri": "linkedinUri", "logo_uri": "logoUri", "pre_ipo_company_id": "preIpoCompanyId", "region_code": "regionCode", "total_funding": "totalFunding", "twelve_month_trailing_revenue": "twelveMonthTrailingRevenue", "website_uri": "websiteUri", "x_uri": "xUri", "year_established": "yearEstablished", }); }); /** @internal */ export type PreIpoCompany$Outbound = { active?: boolean | undefined; categories?: Array | undefined; description?: string | undefined; executive_team?: Array | undefined; facebook_uri?: string | undefined; founder?: string | undefined; last_valuation?: LastValuation$Outbound | null | undefined; linkedin_uri?: string | undefined; logo_uri?: string | undefined; name?: string | undefined; pre_ipo_company_id?: string | undefined; region_code?: string | undefined; symbol?: string | undefined; title?: string | undefined; total_funding?: TotalFunding$Outbound | null | undefined; twelve_month_trailing_revenue?: | TwelveMonthTrailingRevenue$Outbound | null | undefined; type?: string | undefined; website_uri?: string | undefined; x_uri?: string | undefined; year_established?: number | undefined; }; /** @internal */ export const PreIpoCompany$outboundSchema: z.ZodType< PreIpoCompany$Outbound, z.ZodTypeDef, PreIpoCompany > = z.object({ active: z.boolean().optional(), categories: z.array(z.string()).optional(), description: z.string().optional(), executiveTeam: z.array(z.string()).optional(), facebookUri: z.string().optional(), founder: z.string().optional(), lastValuation: z.nullable(z.lazy(() => LastValuation$outboundSchema)) .optional(), linkedinUri: z.string().optional(), logoUri: z.string().optional(), name: z.string().optional(), preIpoCompanyId: z.string().optional(), regionCode: z.string().optional(), symbol: z.string().optional(), title: z.string().optional(), totalFunding: z.nullable(z.lazy(() => TotalFunding$outboundSchema)) .optional(), twelveMonthTrailingRevenue: z.nullable( z.lazy(() => TwelveMonthTrailingRevenue$outboundSchema), ).optional(), type: PreIpoCompanyType$outboundSchema.optional(), websiteUri: z.string().optional(), xUri: z.string().optional(), yearEstablished: z.number().int().optional(), }).transform((v) => { return remap$(v, { executiveTeam: "executive_team", facebookUri: "facebook_uri", lastValuation: "last_valuation", linkedinUri: "linkedin_uri", logoUri: "logo_uri", preIpoCompanyId: "pre_ipo_company_id", regionCode: "region_code", totalFunding: "total_funding", twelveMonthTrailingRevenue: "twelve_month_trailing_revenue", websiteUri: "website_uri", xUri: "x_uri", yearEstablished: "year_established", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PreIpoCompany$ { /** @deprecated use `PreIpoCompany$inboundSchema` instead. */ export const inboundSchema = PreIpoCompany$inboundSchema; /** @deprecated use `PreIpoCompany$outboundSchema` instead. */ export const outboundSchema = PreIpoCompany$outboundSchema; /** @deprecated use `PreIpoCompany$Outbound` instead. */ export type Outbound = PreIpoCompany$Outbound; } export function preIpoCompanyToJSON(preIpoCompany: PreIpoCompany): string { return JSON.stringify(PreIpoCompany$outboundSchema.parse(preIpoCompany)); } export function preIpoCompanyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PreIpoCompany$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PreIpoCompany' from JSON`, ); }