/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetApiV1IndexerstatsRequest = { startDate?: Date | undefined; endDate?: Date | undefined; indexers?: string | undefined; protocols?: string | undefined; tags?: string | undefined; }; /** @internal */ export const GetApiV1IndexerstatsRequest$inboundSchema: z.ZodType< GetApiV1IndexerstatsRequest, z.ZodTypeDef, unknown > = z.object({ startDate: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), endDate: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), indexers: z.string().optional(), protocols: z.string().optional(), tags: z.string().optional(), }); /** @internal */ export type GetApiV1IndexerstatsRequest$Outbound = { startDate?: string | undefined; endDate?: string | undefined; indexers?: string | undefined; protocols?: string | undefined; tags?: string | undefined; }; /** @internal */ export const GetApiV1IndexerstatsRequest$outboundSchema: z.ZodType< GetApiV1IndexerstatsRequest$Outbound, z.ZodTypeDef, GetApiV1IndexerstatsRequest > = z.object({ startDate: z.date().transform(v => v.toISOString()).optional(), endDate: z.date().transform(v => v.toISOString()).optional(), indexers: z.string().optional(), protocols: z.string().optional(), tags: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV1IndexerstatsRequest$ { /** @deprecated use `GetApiV1IndexerstatsRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV1IndexerstatsRequest$inboundSchema; /** @deprecated use `GetApiV1IndexerstatsRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV1IndexerstatsRequest$outboundSchema; /** @deprecated use `GetApiV1IndexerstatsRequest$Outbound` instead. */ export type Outbound = GetApiV1IndexerstatsRequest$Outbound; } export function getApiV1IndexerstatsRequestToJSON( getApiV1IndexerstatsRequest: GetApiV1IndexerstatsRequest, ): string { return JSON.stringify( GetApiV1IndexerstatsRequest$outboundSchema.parse( getApiV1IndexerstatsRequest, ), ); } export function getApiV1IndexerstatsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV1IndexerstatsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV1IndexerstatsRequest' from JSON`, ); }