/* * 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 GetApiV3NeuronsNeuronIdBallotsIncludeStatus = { Unknown: "UNKNOWN", Unspecified: "UNSPECIFIED", Open: "OPEN", Rejected: "REJECTED", Adopted: "ADOPTED", Executed: "EXECUTED", Failed: "FAILED", } as const; export type GetApiV3NeuronsNeuronIdBallotsIncludeStatus = ClosedEnum< typeof GetApiV3NeuronsNeuronIdBallotsIncludeStatus >; export const GetApiV3NeuronsNeuronIdBallotsFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3NeuronsNeuronIdBallotsFormat = ClosedEnum< typeof GetApiV3NeuronsNeuronIdBallotsFormat >; export const GetApiV3NeuronsNeuronIdBallotsIncludeVote = { Zero: 0, One: 1, Two: 2, } as const; export type GetApiV3NeuronsNeuronIdBallotsIncludeVote = ClosedEnum< typeof GetApiV3NeuronsNeuronIdBallotsIncludeVote >; export const GetApiV3NeuronsNeuronIdBallotsIncludeTopic = { 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", TopicSystemCanisterManagement: "TOPIC_SYSTEM_CANISTER_MANAGEMENT", TopicApplicationCanisterManagement: "TOPIC_APPLICATION_CANISTER_MANAGEMENT", Unknown: "", } as const; export type GetApiV3NeuronsNeuronIdBallotsIncludeTopic = ClosedEnum< typeof GetApiV3NeuronsNeuronIdBallotsIncludeTopic >; export type GetApiV3NeuronsNeuronIdBallotsRequest = { neuronId: number; /** * Proposal ID */ proposalId?: number | null | undefined; limit?: number | undefined; includeStatus?: | Array | undefined; offset?: number | undefined; /** * Available values : proposal_id, topic, status, vote */ sortBy?: any | undefined; format?: GetApiV3NeuronsNeuronIdBallotsFormat | undefined; includeVote?: Array | undefined; maxBallotIndex?: number | null | undefined; includeTopic?: Array | undefined; }; /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3NeuronsNeuronIdBallotsIncludeStatus); /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeStatus$outboundSchema: z.ZodNativeEnum = GetApiV3NeuronsNeuronIdBallotsIncludeStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronsNeuronIdBallotsIncludeStatus$ { /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeStatus$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeStatus$inboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeStatus$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeStatus$outboundSchema; } /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsFormat$inboundSchema: z.ZodNativeEnum = z.nativeEnum( GetApiV3NeuronsNeuronIdBallotsFormat, ); /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsFormat$outboundSchema: z.ZodNativeEnum = GetApiV3NeuronsNeuronIdBallotsFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronsNeuronIdBallotsFormat$ { /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronsNeuronIdBallotsFormat$inboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronsNeuronIdBallotsFormat$outboundSchema; } /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeVote$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3NeuronsNeuronIdBallotsIncludeVote); /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeVote$outboundSchema: z.ZodNativeEnum = GetApiV3NeuronsNeuronIdBallotsIncludeVote$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronsNeuronIdBallotsIncludeVote$ { /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeVote$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeVote$inboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeVote$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeVote$outboundSchema; } /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeTopic$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3NeuronsNeuronIdBallotsIncludeTopic); /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsIncludeTopic$outboundSchema: z.ZodNativeEnum = GetApiV3NeuronsNeuronIdBallotsIncludeTopic$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3NeuronsNeuronIdBallotsIncludeTopic$ { /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeTopic$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeTopic$inboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsIncludeTopic$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronsNeuronIdBallotsIncludeTopic$outboundSchema; } /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsRequest$inboundSchema: z.ZodType< GetApiV3NeuronsNeuronIdBallotsRequest, z.ZodTypeDef, unknown > = z.object({ neuron_id: z.number().int(), proposal_id: z.nullable(z.number().int()).default(null), limit: z.number().int().default(100), include_status: z.array( GetApiV3NeuronsNeuronIdBallotsIncludeStatus$inboundSchema, ).optional(), offset: z.number().int().default(0), sort_by: z.any(), format: GetApiV3NeuronsNeuronIdBallotsFormat$inboundSchema.default("json"), include_vote: z.array(GetApiV3NeuronsNeuronIdBallotsIncludeVote$inboundSchema) .optional(), max_ballot_index: z.nullable(z.number().int()).default(null), include_topic: z.array( GetApiV3NeuronsNeuronIdBallotsIncludeTopic$inboundSchema, ).optional(), }).transform((v) => { return remap$(v, { "neuron_id": "neuronId", "proposal_id": "proposalId", "include_status": "includeStatus", "sort_by": "sortBy", "include_vote": "includeVote", "max_ballot_index": "maxBallotIndex", "include_topic": "includeTopic", }); }); /** @internal */ export type GetApiV3NeuronsNeuronIdBallotsRequest$Outbound = { neuron_id: number; proposal_id: number | null; limit: number; include_status?: Array | undefined; offset: number; sort_by?: any; format: string; include_vote?: Array | undefined; max_ballot_index: number | null; include_topic?: Array | undefined; }; /** @internal */ export const GetApiV3NeuronsNeuronIdBallotsRequest$outboundSchema: z.ZodType< GetApiV3NeuronsNeuronIdBallotsRequest$Outbound, z.ZodTypeDef, GetApiV3NeuronsNeuronIdBallotsRequest > = z.object({ neuronId: z.number().int(), proposalId: z.nullable(z.number().int()).default(null), limit: z.number().int().default(100), includeStatus: z.array( GetApiV3NeuronsNeuronIdBallotsIncludeStatus$outboundSchema, ).optional(), offset: z.number().int().default(0), sortBy: z.any(), format: GetApiV3NeuronsNeuronIdBallotsFormat$outboundSchema.default("json"), includeVote: z.array(GetApiV3NeuronsNeuronIdBallotsIncludeVote$outboundSchema) .optional(), maxBallotIndex: z.nullable(z.number().int()).default(null), includeTopic: z.array( GetApiV3NeuronsNeuronIdBallotsIncludeTopic$outboundSchema, ).optional(), }).transform((v) => { return remap$(v, { neuronId: "neuron_id", proposalId: "proposal_id", includeStatus: "include_status", sortBy: "sort_by", includeVote: "include_vote", maxBallotIndex: "max_ballot_index", 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 GetApiV3NeuronsNeuronIdBallotsRequest$ { /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3NeuronsNeuronIdBallotsRequest$inboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3NeuronsNeuronIdBallotsRequest$outboundSchema; /** @deprecated use `GetApiV3NeuronsNeuronIdBallotsRequest$Outbound` instead. */ export type Outbound = GetApiV3NeuronsNeuronIdBallotsRequest$Outbound; } export function getApiV3NeuronsNeuronIdBallotsRequestToJSON( getApiV3NeuronsNeuronIdBallotsRequest: GetApiV3NeuronsNeuronIdBallotsRequest, ): string { return JSON.stringify( GetApiV3NeuronsNeuronIdBallotsRequest$outboundSchema.parse( getApiV3NeuronsNeuronIdBallotsRequest, ), ); } export function getApiV3NeuronsNeuronIdBallotsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3NeuronsNeuronIdBallotsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3NeuronsNeuronIdBallotsRequest' from JSON`, ); }