/* * 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 GetApiV3MetricsCycleBurnRateFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3MetricsCycleBurnRateFormat = ClosedEnum< typeof GetApiV3MetricsCycleBurnRateFormat >; export type GetApiV3MetricsCycleBurnRateRequest = { /** * Start Timestamp */ start?: number | null | undefined; /** * Subnet ID */ subnet?: string | null | undefined; /** * End Timestamp */ end?: number | null | undefined; format?: GetApiV3MetricsCycleBurnRateFormat | undefined; /** * Step value */ step?: number | undefined; }; /** @internal */ export const GetApiV3MetricsCycleBurnRateFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV3MetricsCycleBurnRateFormat > = z.nativeEnum(GetApiV3MetricsCycleBurnRateFormat); /** @internal */ export const GetApiV3MetricsCycleBurnRateFormat$outboundSchema: z.ZodNativeEnum< typeof GetApiV3MetricsCycleBurnRateFormat > = GetApiV3MetricsCycleBurnRateFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsCycleBurnRateFormat$ { /** @deprecated use `GetApiV3MetricsCycleBurnRateFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsCycleBurnRateFormat$inboundSchema; /** @deprecated use `GetApiV3MetricsCycleBurnRateFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsCycleBurnRateFormat$outboundSchema; } /** @internal */ export const GetApiV3MetricsCycleBurnRateRequest$inboundSchema: z.ZodType< GetApiV3MetricsCycleBurnRateRequest, z.ZodTypeDef, unknown > = z.object({ start: z.nullable(z.number()).default(null), subnet: z.nullable(z.string()).default(null), end: z.nullable(z.number()).default(null), format: GetApiV3MetricsCycleBurnRateFormat$inboundSchema.default("json"), step: z.number().int().default(7200), }); /** @internal */ export type GetApiV3MetricsCycleBurnRateRequest$Outbound = { start: number | null; subnet: string | null; end: number | null; format: string; step: number; }; /** @internal */ export const GetApiV3MetricsCycleBurnRateRequest$outboundSchema: z.ZodType< GetApiV3MetricsCycleBurnRateRequest$Outbound, z.ZodTypeDef, GetApiV3MetricsCycleBurnRateRequest > = z.object({ start: z.nullable(z.number()).default(null), subnet: z.nullable(z.string()).default(null), end: z.nullable(z.number()).default(null), format: GetApiV3MetricsCycleBurnRateFormat$outboundSchema.default("json"), step: z.number().int().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 GetApiV3MetricsCycleBurnRateRequest$ { /** @deprecated use `GetApiV3MetricsCycleBurnRateRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsCycleBurnRateRequest$inboundSchema; /** @deprecated use `GetApiV3MetricsCycleBurnRateRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsCycleBurnRateRequest$outboundSchema; /** @deprecated use `GetApiV3MetricsCycleBurnRateRequest$Outbound` instead. */ export type Outbound = GetApiV3MetricsCycleBurnRateRequest$Outbound; } export function getApiV3MetricsCycleBurnRateRequestToJSON( getApiV3MetricsCycleBurnRateRequest: GetApiV3MetricsCycleBurnRateRequest, ): string { return JSON.stringify( GetApiV3MetricsCycleBurnRateRequest$outboundSchema.parse( getApiV3MetricsCycleBurnRateRequest, ), ); } export function getApiV3MetricsCycleBurnRateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3MetricsCycleBurnRateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3MetricsCycleBurnRateRequest' from JSON`, ); }