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