/* * 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 GetApiV3GovernanceMetricsNameName = { 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 GetApiV3GovernanceMetricsNameName = ClosedEnum< typeof GetApiV3GovernanceMetricsNameName >; export type GetApiV3GovernanceMetricsNameRequest = { /** * End Timestamp */ end?: number | null | undefined; /** * Start Timestamp */ start?: number | null | undefined; /** * Metric Name */ name: GetApiV3GovernanceMetricsNameName; }; /** @internal */ export const GetApiV3GovernanceMetricsNameName$inboundSchema: z.ZodNativeEnum< typeof GetApiV3GovernanceMetricsNameName > = z.nativeEnum(GetApiV3GovernanceMetricsNameName); /** @internal */ export const GetApiV3GovernanceMetricsNameName$outboundSchema: z.ZodNativeEnum< typeof GetApiV3GovernanceMetricsNameName > = GetApiV3GovernanceMetricsNameName$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3GovernanceMetricsNameName$ { /** @deprecated use `GetApiV3GovernanceMetricsNameName$inboundSchema` instead. */ export const inboundSchema = GetApiV3GovernanceMetricsNameName$inboundSchema; /** @deprecated use `GetApiV3GovernanceMetricsNameName$outboundSchema` instead. */ export const outboundSchema = GetApiV3GovernanceMetricsNameName$outboundSchema; } /** @internal */ export const GetApiV3GovernanceMetricsNameRequest$inboundSchema: z.ZodType< GetApiV3GovernanceMetricsNameRequest, z.ZodTypeDef, unknown > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), name: GetApiV3GovernanceMetricsNameName$inboundSchema, }); /** @internal */ export type GetApiV3GovernanceMetricsNameRequest$Outbound = { end: number | null; start: number | null; name: string; }; /** @internal */ export const GetApiV3GovernanceMetricsNameRequest$outboundSchema: z.ZodType< GetApiV3GovernanceMetricsNameRequest$Outbound, z.ZodTypeDef, GetApiV3GovernanceMetricsNameRequest > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), name: GetApiV3GovernanceMetricsNameName$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3GovernanceMetricsNameRequest$ { /** @deprecated use `GetApiV3GovernanceMetricsNameRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3GovernanceMetricsNameRequest$inboundSchema; /** @deprecated use `GetApiV3GovernanceMetricsNameRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3GovernanceMetricsNameRequest$outboundSchema; /** @deprecated use `GetApiV3GovernanceMetricsNameRequest$Outbound` instead. */ export type Outbound = GetApiV3GovernanceMetricsNameRequest$Outbound; } export function getApiV3GovernanceMetricsNameRequestToJSON( getApiV3GovernanceMetricsNameRequest: GetApiV3GovernanceMetricsNameRequest, ): string { return JSON.stringify( GetApiV3GovernanceMetricsNameRequest$outboundSchema.parse( getApiV3GovernanceMetricsNameRequest, ), ); } export function getApiV3GovernanceMetricsNameRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3GovernanceMetricsNameRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3GovernanceMetricsNameRequest' from JSON`, ); }