/* * 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 UserAgentStatistics = { userAgent?: string | null | undefined; numberOfQueries?: number | undefined; numberOfGrabs?: number | undefined; }; /** @internal */ export const UserAgentStatistics$inboundSchema: z.ZodType< UserAgentStatistics, z.ZodTypeDef, unknown > = z.object({ userAgent: z.nullable(z.string()).optional(), numberOfQueries: z.number().int().optional(), numberOfGrabs: z.number().int().optional(), }); /** @internal */ export type UserAgentStatistics$Outbound = { userAgent?: string | null | undefined; numberOfQueries?: number | undefined; numberOfGrabs?: number | undefined; }; /** @internal */ export const UserAgentStatistics$outboundSchema: z.ZodType< UserAgentStatistics$Outbound, z.ZodTypeDef, UserAgentStatistics > = z.object({ userAgent: 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 UserAgentStatistics$ { /** @deprecated use `UserAgentStatistics$inboundSchema` instead. */ export const inboundSchema = UserAgentStatistics$inboundSchema; /** @deprecated use `UserAgentStatistics$outboundSchema` instead. */ export const outboundSchema = UserAgentStatistics$outboundSchema; /** @deprecated use `UserAgentStatistics$Outbound` instead. */ export type Outbound = UserAgentStatistics$Outbound; } export function userAgentStatisticsToJSON( userAgentStatistics: UserAgentStatistics, ): string { return JSON.stringify( UserAgentStatistics$outboundSchema.parse(userAgentStatistics), ); } export function userAgentStatisticsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserAgentStatistics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserAgentStatistics' from JSON`, ); }