/* * 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 GetApiV3NeuronVotingPowersOwner = { Dfinity: "DFINITY", All: "ALL", } as const; export type GetApiV3NeuronVotingPowersOwner = ClosedEnum< typeof GetApiV3NeuronVotingPowersOwner >; /** * Kind of voting power */ export const GetApiV3NeuronVotingPowersKind = { DecidingVotingPower: "deciding_voting_power", PotentialVotingPower: "potential_voting_power", } as const; /** * Kind of voting power */ export type GetApiV3NeuronVotingPowersKind = ClosedEnum< typeof GetApiV3NeuronVotingPowersKind >; export type GetApiV3NeuronVotingPowersRequest = { /** * Start Timestamp */ start?: number | null | undefined; owner?: Array | undefined; /** * Kind of voting power */ kind?: GetApiV3NeuronVotingPowersKind | undefined; /** * End Timestamp */ end?: number | null | undefined; /** * Integer step value multiple of 600(10min) */ step?: number | undefined; }; /** @internal */ export const GetApiV3NeuronVotingPowersOwner$inboundSchema: z.ZodNativeEnum< typeof GetApiV3NeuronVotingPowersOwner > = z.nativeEnum(GetApiV3NeuronVotingPowersOwner); /** @internal */ export const GetApiV3NeuronVotingPowersOwner$outboundSchema: z.ZodNativeEnum< typeof GetApiV3NeuronVotingPowersOwner > = GetApiV3NeuronVotingPowersOwner$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronVotingPowersOwner$ { /** @deprecated use `GetApiV3NeuronVotingPowersOwner$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronVotingPowersOwner$inboundSchema; /** @deprecated use `GetApiV3NeuronVotingPowersOwner$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronVotingPowersOwner$outboundSchema; } /** @internal */ export const GetApiV3NeuronVotingPowersKind$inboundSchema: z.ZodNativeEnum< typeof GetApiV3NeuronVotingPowersKind > = z.nativeEnum(GetApiV3NeuronVotingPowersKind); /** @internal */ export const GetApiV3NeuronVotingPowersKind$outboundSchema: z.ZodNativeEnum< typeof GetApiV3NeuronVotingPowersKind > = GetApiV3NeuronVotingPowersKind$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronVotingPowersKind$ { /** @deprecated use `GetApiV3NeuronVotingPowersKind$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronVotingPowersKind$inboundSchema; /** @deprecated use `GetApiV3NeuronVotingPowersKind$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronVotingPowersKind$outboundSchema; } /** @internal */ export const GetApiV3NeuronVotingPowersRequest$inboundSchema: z.ZodType< GetApiV3NeuronVotingPowersRequest, z.ZodTypeDef, unknown > = z.object({ start: z.nullable(z.number().int()).default(null), owner: z.array(GetApiV3NeuronVotingPowersOwner$inboundSchema).optional(), kind: GetApiV3NeuronVotingPowersKind$inboundSchema.default( "deciding_voting_power", ), end: z.nullable(z.number().int()).default(null), step: z.number().int().default(86400), }); /** @internal */ export type GetApiV3NeuronVotingPowersRequest$Outbound = { start: number | null; owner?: Array | undefined; kind: string; end: number | null; step: number; }; /** @internal */ export const GetApiV3NeuronVotingPowersRequest$outboundSchema: z.ZodType< GetApiV3NeuronVotingPowersRequest$Outbound, z.ZodTypeDef, GetApiV3NeuronVotingPowersRequest > = z.object({ start: z.nullable(z.number().int()).default(null), owner: z.array(GetApiV3NeuronVotingPowersOwner$outboundSchema).optional(), kind: GetApiV3NeuronVotingPowersKind$outboundSchema.default( "deciding_voting_power", ), end: z.nullable(z.number().int()).default(null), step: z.number().int().default(86400), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronVotingPowersRequest$ { /** @deprecated use `GetApiV3NeuronVotingPowersRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronVotingPowersRequest$inboundSchema; /** @deprecated use `GetApiV3NeuronVotingPowersRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronVotingPowersRequest$outboundSchema; /** @deprecated use `GetApiV3NeuronVotingPowersRequest$Outbound` instead. */ export type Outbound = GetApiV3NeuronVotingPowersRequest$Outbound; } export function getApiV3NeuronVotingPowersRequestToJSON( getApiV3NeuronVotingPowersRequest: GetApiV3NeuronVotingPowersRequest, ): string { return JSON.stringify( GetApiV3NeuronVotingPowersRequest$outboundSchema.parse( getApiV3NeuronVotingPowersRequest, ), ); } export function getApiV3NeuronVotingPowersRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3NeuronVotingPowersRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3NeuronVotingPowersRequest' from JSON`, ); }