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