/* * 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"; /** * The issue price of the closing. */ export type IssuePrice = { /** * 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; }; /** * Closing details of a Pre IPO Company Funding Round. */ export type PreIpoCompanyFundingRoundClosing = { /** * The issue price of the closing. */ issuePrice?: IssuePrice | null | undefined; /** * The time shares were issued. */ issueTime?: Date | null | undefined; /** * The name of the closing. */ name?: string | undefined; /** * The time the closing was updated. */ updateTime?: Date | null | undefined; }; /** @internal */ export const IssuePrice$inboundSchema: z.ZodType< IssuePrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type IssuePrice$Outbound = { value?: string | undefined; }; /** @internal */ export const IssuePrice$outboundSchema: z.ZodType< IssuePrice$Outbound, z.ZodTypeDef, IssuePrice > = 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 IssuePrice$ { /** @deprecated use `IssuePrice$inboundSchema` instead. */ export const inboundSchema = IssuePrice$inboundSchema; /** @deprecated use `IssuePrice$outboundSchema` instead. */ export const outboundSchema = IssuePrice$outboundSchema; /** @deprecated use `IssuePrice$Outbound` instead. */ export type Outbound = IssuePrice$Outbound; } export function issuePriceToJSON(issuePrice: IssuePrice): string { return JSON.stringify(IssuePrice$outboundSchema.parse(issuePrice)); } export function issuePriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IssuePrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IssuePrice' from JSON`, ); } /** @internal */ export const PreIpoCompanyFundingRoundClosing$inboundSchema: z.ZodType< PreIpoCompanyFundingRoundClosing, z.ZodTypeDef, unknown > = z.object({ issue_price: z.nullable(z.lazy(() => IssuePrice$inboundSchema)).optional(), issue_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), name: z.string().optional(), update_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "issue_price": "issuePrice", "issue_time": "issueTime", "update_time": "updateTime", }); }); /** @internal */ export type PreIpoCompanyFundingRoundClosing$Outbound = { issue_price?: IssuePrice$Outbound | null | undefined; issue_time?: string | null | undefined; name?: string | undefined; update_time?: string | null | undefined; }; /** @internal */ export const PreIpoCompanyFundingRoundClosing$outboundSchema: z.ZodType< PreIpoCompanyFundingRoundClosing$Outbound, z.ZodTypeDef, PreIpoCompanyFundingRoundClosing > = z.object({ issuePrice: z.nullable(z.lazy(() => IssuePrice$outboundSchema)).optional(), issueTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), name: z.string().optional(), updateTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { issuePrice: "issue_price", issueTime: "issue_time", updateTime: "update_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PreIpoCompanyFundingRoundClosing$ { /** @deprecated use `PreIpoCompanyFundingRoundClosing$inboundSchema` instead. */ export const inboundSchema = PreIpoCompanyFundingRoundClosing$inboundSchema; /** @deprecated use `PreIpoCompanyFundingRoundClosing$outboundSchema` instead. */ export const outboundSchema = PreIpoCompanyFundingRoundClosing$outboundSchema; /** @deprecated use `PreIpoCompanyFundingRoundClosing$Outbound` instead. */ export type Outbound = PreIpoCompanyFundingRoundClosing$Outbound; } export function preIpoCompanyFundingRoundClosingToJSON( preIpoCompanyFundingRoundClosing: PreIpoCompanyFundingRoundClosing, ): string { return JSON.stringify( PreIpoCompanyFundingRoundClosing$outboundSchema.parse( preIpoCompanyFundingRoundClosing, ), ); } export function preIpoCompanyFundingRoundClosingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PreIpoCompanyFundingRoundClosing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PreIpoCompanyFundingRoundClosing' from JSON`, ); }