/* * 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 GetApiV1HistoryRequest = { page?: number | undefined; pageSize?: number | undefined; sortKey?: string | undefined; sortDirection?: models.SortDirection | undefined; eventType?: Array | undefined; successful?: boolean | undefined; downloadId?: string | undefined; indexerIds?: Array | undefined; }; /** @internal */ export const GetApiV1HistoryRequest$inboundSchema: z.ZodType< GetApiV1HistoryRequest, z.ZodTypeDef, unknown > = z.object({ page: z.number().int().default(1), pageSize: z.number().int().default(10), sortKey: z.string().optional(), sortDirection: models.SortDirection$inboundSchema.optional(), eventType: z.array(z.number().int()).optional(), successful: z.boolean().optional(), downloadId: z.string().optional(), indexerIds: z.array(z.number().int()).optional(), }); /** @internal */ export type GetApiV1HistoryRequest$Outbound = { page: number; pageSize: number; sortKey?: string | undefined; sortDirection?: string | undefined; eventType?: Array | undefined; successful?: boolean | undefined; downloadId?: string | undefined; indexerIds?: Array | undefined; }; /** @internal */ export const GetApiV1HistoryRequest$outboundSchema: z.ZodType< GetApiV1HistoryRequest$Outbound, z.ZodTypeDef, GetApiV1HistoryRequest > = z.object({ page: z.number().int().default(1), pageSize: z.number().int().default(10), sortKey: z.string().optional(), sortDirection: models.SortDirection$outboundSchema.optional(), eventType: z.array(z.number().int()).optional(), successful: z.boolean().optional(), downloadId: z.string().optional(), indexerIds: z.array(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 GetApiV1HistoryRequest$ { /** @deprecated use `GetApiV1HistoryRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV1HistoryRequest$inboundSchema; /** @deprecated use `GetApiV1HistoryRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV1HistoryRequest$outboundSchema; /** @deprecated use `GetApiV1HistoryRequest$Outbound` instead. */ export type Outbound = GetApiV1HistoryRequest$Outbound; } export function getApiV1HistoryRequestToJSON( getApiV1HistoryRequest: GetApiV1HistoryRequest, ): string { return JSON.stringify( GetApiV1HistoryRequest$outboundSchema.parse(getApiV1HistoryRequest), ); } export function getApiV1HistoryRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV1HistoryRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV1HistoryRequest' from JSON`, ); }