/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type ApiInfoResource = { current?: string | null | undefined; deprecated?: Array | null | undefined; }; /** @internal */ export const ApiInfoResource$inboundSchema: z.ZodType< ApiInfoResource, z.ZodTypeDef, unknown > = z.object({ current: z.nullable(z.string()).optional(), deprecated: z.nullable(z.array(z.string())).optional(), }); /** @internal */ export type ApiInfoResource$Outbound = { current?: string | null | undefined; deprecated?: Array | null | undefined; }; /** @internal */ export const ApiInfoResource$outboundSchema: z.ZodType< ApiInfoResource$Outbound, z.ZodTypeDef, ApiInfoResource > = z.object({ current: z.nullable(z.string()).optional(), deprecated: z.nullable(z.array(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 ApiInfoResource$ { /** @deprecated use `ApiInfoResource$inboundSchema` instead. */ export const inboundSchema = ApiInfoResource$inboundSchema; /** @deprecated use `ApiInfoResource$outboundSchema` instead. */ export const outboundSchema = ApiInfoResource$outboundSchema; /** @deprecated use `ApiInfoResource$Outbound` instead. */ export type Outbound = ApiInfoResource$Outbound; } export function apiInfoResourceToJSON( apiInfoResource: ApiInfoResource, ): string { return JSON.stringify(ApiInfoResource$outboundSchema.parse(apiInfoResource)); } export function apiInfoResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ApiInfoResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApiInfoResource' from JSON`, ); }