/* * 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 GetApiV3MetricsGovernanceVotingPowerTotalFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3MetricsGovernanceVotingPowerTotalFormat = ClosedEnum< typeof GetApiV3MetricsGovernanceVotingPowerTotalFormat >; export type GetApiV3MetricsGovernanceVotingPowerTotalRequest = { /** * End Timestamp */ end?: number | null | undefined; format?: GetApiV3MetricsGovernanceVotingPowerTotalFormat | undefined; /** * Start Timestamp */ start?: number | null | undefined; /** * Float Step value */ step?: number | undefined; }; /** @internal */ export const GetApiV3MetricsGovernanceVotingPowerTotalFormat$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3MetricsGovernanceVotingPowerTotalFormat); /** @internal */ export const GetApiV3MetricsGovernanceVotingPowerTotalFormat$outboundSchema: z.ZodNativeEnum = GetApiV3MetricsGovernanceVotingPowerTotalFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsGovernanceVotingPowerTotalFormat$ { /** @deprecated use `GetApiV3MetricsGovernanceVotingPowerTotalFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsGovernanceVotingPowerTotalFormat$inboundSchema; /** @deprecated use `GetApiV3MetricsGovernanceVotingPowerTotalFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsGovernanceVotingPowerTotalFormat$outboundSchema; } /** @internal */ export const GetApiV3MetricsGovernanceVotingPowerTotalRequest$inboundSchema: z.ZodType< GetApiV3MetricsGovernanceVotingPowerTotalRequest, z.ZodTypeDef, unknown > = z.object({ end: z.nullable(z.number()).default(null), format: GetApiV3MetricsGovernanceVotingPowerTotalFormat$inboundSchema .default("json"), start: z.nullable(z.number()).default(null), step: z.number().default(7200), }); /** @internal */ export type GetApiV3MetricsGovernanceVotingPowerTotalRequest$Outbound = { end: number | null; format: string; start: number | null; step: number; }; /** @internal */ export const GetApiV3MetricsGovernanceVotingPowerTotalRequest$outboundSchema: z.ZodType< GetApiV3MetricsGovernanceVotingPowerTotalRequest$Outbound, z.ZodTypeDef, GetApiV3MetricsGovernanceVotingPowerTotalRequest > = z.object({ end: z.nullable(z.number()).default(null), format: GetApiV3MetricsGovernanceVotingPowerTotalFormat$outboundSchema .default("json"), start: z.nullable(z.number()).default(null), step: z.number().default(7200), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsGovernanceVotingPowerTotalRequest$ { /** @deprecated use `GetApiV3MetricsGovernanceVotingPowerTotalRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsGovernanceVotingPowerTotalRequest$inboundSchema; /** @deprecated use `GetApiV3MetricsGovernanceVotingPowerTotalRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsGovernanceVotingPowerTotalRequest$outboundSchema; /** @deprecated use `GetApiV3MetricsGovernanceVotingPowerTotalRequest$Outbound` instead. */ export type Outbound = GetApiV3MetricsGovernanceVotingPowerTotalRequest$Outbound; } export function getApiV3MetricsGovernanceVotingPowerTotalRequestToJSON( getApiV3MetricsGovernanceVotingPowerTotalRequest: GetApiV3MetricsGovernanceVotingPowerTotalRequest, ): string { return JSON.stringify( GetApiV3MetricsGovernanceVotingPowerTotalRequest$outboundSchema.parse( getApiV3MetricsGovernanceVotingPowerTotalRequest, ), ); } export function getApiV3MetricsGovernanceVotingPowerTotalRequestFromJSON( jsonString: string, ): SafeParseResult< GetApiV3MetricsGovernanceVotingPowerTotalRequest, SDKValidationError > { return safeParse( jsonString, (x) => GetApiV3MetricsGovernanceVotingPowerTotalRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetApiV3MetricsGovernanceVotingPowerTotalRequest' from JSON`, ); }