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