/* * 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 GetApiV1SearchRequest = { query?: string | undefined; type?: string | undefined; indexerIds?: Array | undefined; categories?: Array | undefined; limit?: number | undefined; offset?: number | undefined; }; /** @internal */ export const GetApiV1SearchRequest$inboundSchema: z.ZodType< GetApiV1SearchRequest, z.ZodTypeDef, unknown > = z.object({ query: z.string().optional(), type: z.string().optional(), indexerIds: z.array(z.number().int()).optional(), categories: z.array(z.number().int()).optional(), limit: z.number().int().optional(), offset: z.number().int().optional(), }); /** @internal */ export type GetApiV1SearchRequest$Outbound = { query?: string | undefined; type?: string | undefined; indexerIds?: Array | undefined; categories?: Array | undefined; limit?: number | undefined; offset?: number | undefined; }; /** @internal */ export const GetApiV1SearchRequest$outboundSchema: z.ZodType< GetApiV1SearchRequest$Outbound, z.ZodTypeDef, GetApiV1SearchRequest > = z.object({ query: z.string().optional(), type: z.string().optional(), indexerIds: z.array(z.number().int()).optional(), categories: z.array(z.number().int()).optional(), limit: z.number().int().optional(), offset: 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 GetApiV1SearchRequest$ { /** @deprecated use `GetApiV1SearchRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV1SearchRequest$inboundSchema; /** @deprecated use `GetApiV1SearchRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV1SearchRequest$outboundSchema; /** @deprecated use `GetApiV1SearchRequest$Outbound` instead. */ export type Outbound = GetApiV1SearchRequest$Outbound; } export function getApiV1SearchRequestToJSON( getApiV1SearchRequest: GetApiV1SearchRequest, ): string { return JSON.stringify( GetApiV1SearchRequest$outboundSchema.parse(getApiV1SearchRequest), ); } export function getApiV1SearchRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV1SearchRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV1SearchRequest' from JSON`, ); }