/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetApiV3MetricsIcSubnetTotalFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3MetricsIcSubnetTotalFormat = ClosedEnum< typeof GetApiV3MetricsIcSubnetTotalFormat >; export type GetApiV3MetricsIcSubnetTotalRequest = { /** * End Timestamp */ end?: number | null | undefined; format?: GetApiV3MetricsIcSubnetTotalFormat | undefined; /** * Start Timestamp */ start?: number | null | undefined; /** * Float Step value */ step?: number | undefined; }; /** @internal */ export const GetApiV3MetricsIcSubnetTotalFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV3MetricsIcSubnetTotalFormat > = z.nativeEnum(GetApiV3MetricsIcSubnetTotalFormat); /** @internal */ export const GetApiV3MetricsIcSubnetTotalFormat$outboundSchema: z.ZodNativeEnum< typeof GetApiV3MetricsIcSubnetTotalFormat > = GetApiV3MetricsIcSubnetTotalFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsIcSubnetTotalFormat$ { /** @deprecated use `GetApiV3MetricsIcSubnetTotalFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsIcSubnetTotalFormat$inboundSchema; /** @deprecated use `GetApiV3MetricsIcSubnetTotalFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsIcSubnetTotalFormat$outboundSchema; } /** @internal */ export const GetApiV3MetricsIcSubnetTotalRequest$inboundSchema: z.ZodType< GetApiV3MetricsIcSubnetTotalRequest, z.ZodTypeDef, unknown > = z.object({ end: z.nullable(z.number()).default(null), format: GetApiV3MetricsIcSubnetTotalFormat$inboundSchema.default("json"), start: z.nullable(z.number()).default(null), step: z.number().default(7200), }); /** @internal */ export type GetApiV3MetricsIcSubnetTotalRequest$Outbound = { end: number | null; format: string; start: number | null; step: number; }; /** @internal */ export const GetApiV3MetricsIcSubnetTotalRequest$outboundSchema: z.ZodType< GetApiV3MetricsIcSubnetTotalRequest$Outbound, z.ZodTypeDef, GetApiV3MetricsIcSubnetTotalRequest > = z.object({ end: z.nullable(z.number()).default(null), format: GetApiV3MetricsIcSubnetTotalFormat$outboundSchema.default("json"), start: z.nullable(z.number()).default(null), step: z.number().default(7200), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsIcSubnetTotalRequest$ { /** @deprecated use `GetApiV3MetricsIcSubnetTotalRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsIcSubnetTotalRequest$inboundSchema; /** @deprecated use `GetApiV3MetricsIcSubnetTotalRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsIcSubnetTotalRequest$outboundSchema; /** @deprecated use `GetApiV3MetricsIcSubnetTotalRequest$Outbound` instead. */ export type Outbound = GetApiV3MetricsIcSubnetTotalRequest$Outbound; } export function getApiV3MetricsIcSubnetTotalRequestToJSON( getApiV3MetricsIcSubnetTotalRequest: GetApiV3MetricsIcSubnetTotalRequest, ): string { return JSON.stringify( GetApiV3MetricsIcSubnetTotalRequest$outboundSchema.parse( getApiV3MetricsIcSubnetTotalRequest, ), ); } export function getApiV3MetricsIcSubnetTotalRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3MetricsIcSubnetTotalRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3MetricsIcSubnetTotalRequest' from JSON`, ); }