/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; 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 GetApiV3NnsParticipationRateIncludeTopic = { TopicUnspecified: "TOPIC_UNSPECIFIED", TopicNeuronManagement: "TOPIC_NEURON_MANAGEMENT", TopicExchangeRate: "TOPIC_EXCHANGE_RATE", TopicNetworkEconomics: "TOPIC_NETWORK_ECONOMICS", TopicGovernance: "TOPIC_GOVERNANCE", TopicNodeAdmin: "TOPIC_NODE_ADMIN", TopicParticipantManagement: "TOPIC_PARTICIPANT_MANAGEMENT", TopicSubnetManagement: "TOPIC_SUBNET_MANAGEMENT", TopicNetworkCanisterManagement: "TOPIC_NETWORK_CANISTER_MANAGEMENT", TopicKyc: "TOPIC_KYC", TopicNodeProviderRewards: "TOPIC_NODE_PROVIDER_REWARDS", TopicSnsDecentralizationSale: "TOPIC_SNS_DECENTRALIZATION_SALE", TopicIcOsVersionDeployment: "TOPIC_IC_OS_VERSION_DEPLOYMENT", TopicIcOsVersionElection: "TOPIC_IC_OS_VERSION_ELECTION", TopicSnsAndCommunityFund: "TOPIC_SNS_AND_COMMUNITY_FUND", TopicApiBoundaryNodeManagement: "TOPIC_API_BOUNDARY_NODE_MANAGEMENT", TopicSubnetRental: "TOPIC_SUBNET_RENTAL", TopicProtocolCanisterManagement: "TOPIC_PROTOCOL_CANISTER_MANAGEMENT", TopicServiceNervousSystemManagement: "TOPIC_SERVICE_NERVOUS_SYSTEM_MANAGEMENT", } as const; export type GetApiV3NnsParticipationRateIncludeTopic = ClosedEnum< typeof GetApiV3NnsParticipationRateIncludeTopic >; export type GetApiV3NnsParticipationRateRequest = { /** * End Timestamp */ end?: number | null | undefined; /** * Start Timestamp */ start?: number | null | undefined; /** * Float Step value */ step?: number | null | undefined; includeTopic?: GetApiV3NnsParticipationRateIncludeTopic | null | undefined; }; /** @internal */ export const GetApiV3NnsParticipationRateIncludeTopic$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3NnsParticipationRateIncludeTopic); /** @internal */ export const GetApiV3NnsParticipationRateIncludeTopic$outboundSchema: z.ZodNativeEnum = GetApiV3NnsParticipationRateIncludeTopic$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NnsParticipationRateIncludeTopic$ { /** @deprecated use `GetApiV3NnsParticipationRateIncludeTopic$inboundSchema` instead. */ export const inboundSchema = GetApiV3NnsParticipationRateIncludeTopic$inboundSchema; /** @deprecated use `GetApiV3NnsParticipationRateIncludeTopic$outboundSchema` instead. */ export const outboundSchema = GetApiV3NnsParticipationRateIncludeTopic$outboundSchema; } /** @internal */ export const GetApiV3NnsParticipationRateRequest$inboundSchema: z.ZodType< GetApiV3NnsParticipationRateRequest, z.ZodTypeDef, unknown > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), step: z.nullable(z.number()).default(null), include_topic: z.nullable( GetApiV3NnsParticipationRateIncludeTopic$inboundSchema, ).default(null), }).transform((v) => { return remap$(v, { "include_topic": "includeTopic", }); }); /** @internal */ export type GetApiV3NnsParticipationRateRequest$Outbound = { end: number | null; start: number | null; step: number | null; include_topic: string | null; }; /** @internal */ export const GetApiV3NnsParticipationRateRequest$outboundSchema: z.ZodType< GetApiV3NnsParticipationRateRequest$Outbound, z.ZodTypeDef, GetApiV3NnsParticipationRateRequest > = z.object({ end: z.nullable(z.number()).default(null), start: z.nullable(z.number()).default(null), step: z.nullable(z.number()).default(null), includeTopic: z.nullable( GetApiV3NnsParticipationRateIncludeTopic$outboundSchema, ).default(null), }).transform((v) => { return remap$(v, { includeTopic: "include_topic", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NnsParticipationRateRequest$ { /** @deprecated use `GetApiV3NnsParticipationRateRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3NnsParticipationRateRequest$inboundSchema; /** @deprecated use `GetApiV3NnsParticipationRateRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3NnsParticipationRateRequest$outboundSchema; /** @deprecated use `GetApiV3NnsParticipationRateRequest$Outbound` instead. */ export type Outbound = GetApiV3NnsParticipationRateRequest$Outbound; } export function getApiV3NnsParticipationRateRequestToJSON( getApiV3NnsParticipationRateRequest: GetApiV3NnsParticipationRateRequest, ): string { return JSON.stringify( GetApiV3NnsParticipationRateRequest$outboundSchema.parse( getApiV3NnsParticipationRateRequest, ), ); } export function getApiV3NnsParticipationRateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3NnsParticipationRateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3NnsParticipationRateRequest' from JSON`, ); }