/* * 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 GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus = { Unknown: "UNKNOWN", Unspecified: "UNSPECIFIED", Open: "OPEN", Rejected: "REJECTED", Adopted: "ADOPTED", Executed: "EXECUTED", Failed: "FAILED", } as const; export type GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus = ClosedEnum< typeof GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus >; export const GetApiV3KnownNeuronsNeuronIdBallotsFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3KnownNeuronsNeuronIdBallotsFormat = ClosedEnum< typeof GetApiV3KnownNeuronsNeuronIdBallotsFormat >; export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote = { Zero: 0, One: 1, Two: 2, } as const; export type GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote = ClosedEnum< typeof GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote >; export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic = { 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 GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic = ClosedEnum< typeof GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic >; export type GetApiV3KnownNeuronsNeuronIdBallotsRequest = { 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?: GetApiV3KnownNeuronsNeuronIdBallotsFormat | undefined; includeVote?: | Array | undefined; maxBallotIndex?: number | null | undefined; includeTopic?: | Array | undefined; }; /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus); /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$outboundSchema: z.ZodNativeEnum = GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$ { /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$inboundSchema` instead. */ export const inboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$inboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$outboundSchema` instead. */ export const outboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$outboundSchema; } /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsFormat$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3KnownNeuronsNeuronIdBallotsFormat); /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsFormat$outboundSchema: z.ZodNativeEnum = GetApiV3KnownNeuronsNeuronIdBallotsFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3KnownNeuronsNeuronIdBallotsFormat$ { /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsFormat$inboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsFormat$outboundSchema; } /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote); /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$outboundSchema: z.ZodNativeEnum = GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$ { /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$inboundSchema` instead. */ export const inboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$inboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$outboundSchema` instead. */ export const outboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$outboundSchema; } /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic); /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$outboundSchema: z.ZodNativeEnum = GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$ { /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$inboundSchema` instead. */ export const inboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$inboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$outboundSchema` instead. */ export const outboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$outboundSchema; } /** @internal */ export const GetApiV3KnownNeuronsNeuronIdBallotsRequest$inboundSchema: z.ZodType = 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( GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$inboundSchema, ).optional(), offset: z.number().int().default(0), sort_by: z.any(), format: GetApiV3KnownNeuronsNeuronIdBallotsFormat$inboundSchema.default( "json", ), include_vote: z.array( GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$inboundSchema, ).optional(), max_ballot_index: z.nullable(z.number().int()).default(null), include_topic: z.array( GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$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 GetApiV3KnownNeuronsNeuronIdBallotsRequest$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 GetApiV3KnownNeuronsNeuronIdBallotsRequest$outboundSchema: z.ZodType< GetApiV3KnownNeuronsNeuronIdBallotsRequest$Outbound, z.ZodTypeDef, GetApiV3KnownNeuronsNeuronIdBallotsRequest > = z.object({ neuronId: z.number().int(), proposalId: z.nullable(z.number().int()).default(null), limit: z.number().int().default(100), includeStatus: z.array( GetApiV3KnownNeuronsNeuronIdBallotsIncludeStatus$outboundSchema, ).optional(), offset: z.number().int().default(0), sortBy: z.any(), format: GetApiV3KnownNeuronsNeuronIdBallotsFormat$outboundSchema.default( "json", ), includeVote: z.array( GetApiV3KnownNeuronsNeuronIdBallotsIncludeVote$outboundSchema, ).optional(), maxBallotIndex: z.nullable(z.number().int()).default(null), includeTopic: z.array( GetApiV3KnownNeuronsNeuronIdBallotsIncludeTopic$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 GetApiV3KnownNeuronsNeuronIdBallotsRequest$ { /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsRequest$inboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3KnownNeuronsNeuronIdBallotsRequest$outboundSchema; /** @deprecated use `GetApiV3KnownNeuronsNeuronIdBallotsRequest$Outbound` instead. */ export type Outbound = GetApiV3KnownNeuronsNeuronIdBallotsRequest$Outbound; } export function getApiV3KnownNeuronsNeuronIdBallotsRequestToJSON( getApiV3KnownNeuronsNeuronIdBallotsRequest: GetApiV3KnownNeuronsNeuronIdBallotsRequest, ): string { return JSON.stringify( GetApiV3KnownNeuronsNeuronIdBallotsRequest$outboundSchema.parse( getApiV3KnownNeuronsNeuronIdBallotsRequest, ), ); } export function getApiV3KnownNeuronsNeuronIdBallotsRequestFromJSON( jsonString: string, ): SafeParseResult< GetApiV3KnownNeuronsNeuronIdBallotsRequest, SDKValidationError > { return safeParse( jsonString, (x) => GetApiV3KnownNeuronsNeuronIdBallotsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetApiV3KnownNeuronsNeuronIdBallotsRequest' from JSON`, ); }