/* * 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 HostStatistics = { host?: string | null | undefined; numberOfQueries?: number | undefined; numberOfGrabs?: number | undefined; }; /** @internal */ export const HostStatistics$inboundSchema: z.ZodType< HostStatistics, z.ZodTypeDef, unknown > = z.object({ host: z.nullable(z.string()).optional(), numberOfQueries: z.number().int().optional(), numberOfGrabs: z.number().int().optional(), }); /** @internal */ export type HostStatistics$Outbound = { host?: string | null | undefined; numberOfQueries?: number | undefined; numberOfGrabs?: number | undefined; }; /** @internal */ export const HostStatistics$outboundSchema: z.ZodType< HostStatistics$Outbound, z.ZodTypeDef, HostStatistics > = z.object({ host: z.nullable(z.string()).optional(), numberOfQueries: z.number().int().optional(), numberOfGrabs: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HostStatistics$ { /** @deprecated use `HostStatistics$inboundSchema` instead. */ export const inboundSchema = HostStatistics$inboundSchema; /** @deprecated use `HostStatistics$outboundSchema` instead. */ export const outboundSchema = HostStatistics$outboundSchema; /** @deprecated use `HostStatistics$Outbound` instead. */ export type Outbound = HostStatistics$Outbound; } export function hostStatisticsToJSON(hostStatistics: HostStatistics): string { return JSON.stringify(HostStatistics$outboundSchema.parse(hostStatistics)); } export function hostStatisticsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HostStatistics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HostStatistics' from JSON`, ); }