/* * 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"; import * as models from "../index.js"; export type GetApiV1HistoryIndexerRequest = { indexerId?: number | undefined; eventType?: models.HistoryEventType | undefined; limit?: number | undefined; }; /** @internal */ export const GetApiV1HistoryIndexerRequest$inboundSchema: z.ZodType< GetApiV1HistoryIndexerRequest, z.ZodTypeDef, unknown > = z.object({ indexerId: z.number().int().optional(), eventType: models.HistoryEventType$inboundSchema.optional(), limit: z.number().int().optional(), }); /** @internal */ export type GetApiV1HistoryIndexerRequest$Outbound = { indexerId?: number | undefined; eventType?: string | undefined; limit?: number | undefined; }; /** @internal */ export const GetApiV1HistoryIndexerRequest$outboundSchema: z.ZodType< GetApiV1HistoryIndexerRequest$Outbound, z.ZodTypeDef, GetApiV1HistoryIndexerRequest > = z.object({ indexerId: z.number().int().optional(), eventType: models.HistoryEventType$outboundSchema.optional(), limit: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV1HistoryIndexerRequest$ { /** @deprecated use `GetApiV1HistoryIndexerRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV1HistoryIndexerRequest$inboundSchema; /** @deprecated use `GetApiV1HistoryIndexerRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV1HistoryIndexerRequest$outboundSchema; /** @deprecated use `GetApiV1HistoryIndexerRequest$Outbound` instead. */ export type Outbound = GetApiV1HistoryIndexerRequest$Outbound; } export function getApiV1HistoryIndexerRequestToJSON( getApiV1HistoryIndexerRequest: GetApiV1HistoryIndexerRequest, ): string { return JSON.stringify( GetApiV1HistoryIndexerRequest$outboundSchema.parse( getApiV1HistoryIndexerRequest, ), ); } export function getApiV1HistoryIndexerRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV1HistoryIndexerRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV1HistoryIndexerRequest' from JSON`, ); }