/* * 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"; /** * A news article related to the Pre IPO Company News Event. */ export type PreIpoCompanyNewsEventArticle = { /** * The headline of the news article. */ headline?: string | undefined; /** * The publication that published the news article. */ publication?: string | undefined; /** * The time the news article was published. */ publishTime?: Date | null | undefined; /** * A brief summary of the news article. */ summary?: string | undefined; /** * The URI of the news article. */ uri?: string | undefined; }; /** @internal */ export const PreIpoCompanyNewsEventArticle$inboundSchema: z.ZodType< PreIpoCompanyNewsEventArticle, z.ZodTypeDef, unknown > = z.object({ headline: z.string().optional(), publication: z.string().optional(), publish_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), summary: z.string().optional(), uri: z.string().optional(), }).transform((v) => { return remap$(v, { "publish_time": "publishTime", }); }); /** @internal */ export type PreIpoCompanyNewsEventArticle$Outbound = { headline?: string | undefined; publication?: string | undefined; publish_time?: string | null | undefined; summary?: string | undefined; uri?: string | undefined; }; /** @internal */ export const PreIpoCompanyNewsEventArticle$outboundSchema: z.ZodType< PreIpoCompanyNewsEventArticle$Outbound, z.ZodTypeDef, PreIpoCompanyNewsEventArticle > = z.object({ headline: z.string().optional(), publication: z.string().optional(), publishTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), summary: z.string().optional(), uri: z.string().optional(), }).transform((v) => { return remap$(v, { publishTime: "publish_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PreIpoCompanyNewsEventArticle$ { /** @deprecated use `PreIpoCompanyNewsEventArticle$inboundSchema` instead. */ export const inboundSchema = PreIpoCompanyNewsEventArticle$inboundSchema; /** @deprecated use `PreIpoCompanyNewsEventArticle$outboundSchema` instead. */ export const outboundSchema = PreIpoCompanyNewsEventArticle$outboundSchema; /** @deprecated use `PreIpoCompanyNewsEventArticle$Outbound` instead. */ export type Outbound = PreIpoCompanyNewsEventArticle$Outbound; } export function preIpoCompanyNewsEventArticleToJSON( preIpoCompanyNewsEventArticle: PreIpoCompanyNewsEventArticle, ): string { return JSON.stringify( PreIpoCompanyNewsEventArticle$outboundSchema.parse( preIpoCompanyNewsEventArticle, ), ); } export function preIpoCompanyNewsEventArticleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PreIpoCompanyNewsEventArticle$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PreIpoCompanyNewsEventArticle' from JSON`, ); }