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