/* * 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"; /** * Metric Name */ export const GetApiV3StakingMetricsNameName = { GovernanceCommunityFundTotalMaturityE8sEquivalent: "governance_community_fund_total_maturity_e8s_equivalent", GovernanceCommunityFundTotalStakedE8s: "governance_community_fund_total_staked_e8s", GovernanceDissolvedNeuronsCount: "governance_dissolved_neurons_count", GovernanceDissolvedNeuronsE8s: "governance_dissolved_neurons_e8s", GovernanceDissolvingNeuronsCount: "governance_dissolving_neurons_count", GovernanceDissolvingNeuronsE8s: "governance_dissolving_neurons_e8s", GovernanceDissolvingNeuronsStakedMaturityE8sEquivalent: "governance_dissolving_neurons_staked_maturity_e8s_equivalent", GovernanceGarbageCollectableNeuronsCount: "governance_garbage_collectable_neurons_count", GovernanceLastRewardsEventE8s: "governance_last_rewards_event_e8s", GovernanceLatestGcTimestampSeconds: "governance_latest_gc_timestamp_seconds", GovernanceLatestRewardEventRoundsSinceLastDistribution: "governance_latest_reward_event_rounds_since_last_distribution", GovernanceLatestRewardEventTimestampSeconds: "governance_latest_reward_event_timestamp_seconds", GovernanceLatestRewardEventTotalAvailableE8s: "governance_latest_reward_event_total_available_e8s", GovernanceLatestRewardRoundTotalAvailableE8s: "governance_latest_reward_round_total_available_e8s", GovernanceLockedNeuronsTotal: "governance_locked_neurons_total", GovernanceNeuronsTotal: "governance_neurons_total", GovernanceNeuronsWithInvalidStakeCount: "governance_neurons_with_invalid_stake_count", GovernanceNeuronsWithLessThan6MonthsDissolveDelayCount: "governance_neurons_with_less_than_6_months_dissolve_delay_count", GovernanceNeuronsWithLessThan6MonthsDissolveDelayE8s: "governance_neurons_with_less_than_6_months_dissolve_delay_e8s", GovernanceNotDissolvingNeuronsCount: "governance_not_dissolving_neurons_count", GovernanceNotDissolvingNeuronsE8s: "governance_not_dissolving_neurons_e8s", GovernanceNotDissolvingNeuronsStakedMaturityE8sEquivalent: "governance_not_dissolving_neurons_staked_maturity_e8s_equivalent", GovernanceProposalsTotal: "governance_proposals_total", GovernanceReadyToBeSettledProposalsTotal: "governance_ready_to_be_settled_proposals_total", GovernanceSecondsSinceLatestRewardEvent: "governance_seconds_since_latest_reward_event", GovernanceStableMemorySizeBytes: "governance_stable_memory_size_bytes", GovernanceTotalLockedE8s: "governance_total_locked_e8s", GovernanceTotalMaturityE8sEquivalent: "governance_total_maturity_e8s_equivalent", GovernanceTotalMemorySizeBytes: "governance_total_memory_size_bytes", GovernanceTotalStakedE8s: "governance_total_staked_e8s", GovernanceTotalStakedMaturityE8sEquivalent: "governance_total_staked_maturity_e8s_equivalent", GovernanceTotalSupplyIcp: "governance_total_supply_icp", GovernanceVotingPowerTotal: "governance_voting_power_total", } as const; /** * Metric Name */ export type GetApiV3StakingMetricsNameName = ClosedEnum< typeof GetApiV3StakingMetricsNameName >; export type GetApiV3StakingMetricsNameRequest = { /** * End Timestamp */ end?: number | null | undefined; /** * Start Timestamp */ start?: number | null | undefined; /** * Metric Name */ name: GetApiV3StakingMetricsNameName; }; /** @internal */ export const GetApiV3StakingMetricsNameName$inboundSchema: z.ZodNativeEnum< typeof GetApiV3StakingMetricsNameName > = z.nativeEnum(GetApiV3StakingMetricsNameName); /** @internal */ export const GetApiV3StakingMetricsNameName$outboundSchema: z.ZodNativeEnum< typeof GetApiV3StakingMetricsNameName > = GetApiV3StakingMetricsNameName$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3StakingMetricsNameName$ { /** @deprecated use `GetApiV3StakingMetricsNameName$inboundSchema` instead. */ export const inboundSchema = GetApiV3StakingMetricsNameName$inboundSchema; /** @deprecated use `GetApiV3StakingMetricsNameName$outboundSchema` instead. */ export const outboundSchema = GetApiV3StakingMetricsNameName$outboundSchema; } /** @internal */ export const GetApiV3StakingMetricsNameRequest$inboundSchema: z.ZodType< GetApiV3StakingMetricsNameRequest, z.ZodTypeDef, unknown > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), name: GetApiV3StakingMetricsNameName$inboundSchema, }); /** @internal */ export type GetApiV3StakingMetricsNameRequest$Outbound = { end: number | null; start: number | null; name: string; }; /** @internal */ export const GetApiV3StakingMetricsNameRequest$outboundSchema: z.ZodType< GetApiV3StakingMetricsNameRequest$Outbound, z.ZodTypeDef, GetApiV3StakingMetricsNameRequest > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), name: GetApiV3StakingMetricsNameName$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3StakingMetricsNameRequest$ { /** @deprecated use `GetApiV3StakingMetricsNameRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3StakingMetricsNameRequest$inboundSchema; /** @deprecated use `GetApiV3StakingMetricsNameRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3StakingMetricsNameRequest$outboundSchema; /** @deprecated use `GetApiV3StakingMetricsNameRequest$Outbound` instead. */ export type Outbound = GetApiV3StakingMetricsNameRequest$Outbound; } export function getApiV3StakingMetricsNameRequestToJSON( getApiV3StakingMetricsNameRequest: GetApiV3StakingMetricsNameRequest, ): string { return JSON.stringify( GetApiV3StakingMetricsNameRequest$outboundSchema.parse( getApiV3StakingMetricsNameRequest, ), ); } export function getApiV3StakingMetricsNameRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3StakingMetricsNameRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3StakingMetricsNameRequest' from JSON`, ); }