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