/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 74a60200aa7d */ import * as z from "zod/v3"; import { Document, Document$Outbound, Document$outboundSchema, } from "./document.js"; import { SearchRequestInputDetails, SearchRequestInputDetails$Outbound, SearchRequestInputDetails$outboundSchema, } from "./searchrequestinputdetails.js"; import { SearchRequestOptions, SearchRequestOptions$Outbound, SearchRequestOptions$outboundSchema, } from "./searchrequestoptions.js"; import { SessionInfo, SessionInfo$Outbound, SessionInfo$outboundSchema, } from "./sessioninfo.js"; export type SearchRequest = { /** * The ISO 8601 timestamp associated with the client request. */ timestamp?: Date | undefined; /** * A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. */ trackingToken?: string | undefined; sessionInfo?: SessionInfo | undefined; sourceDocument?: Document | undefined; /** * Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. */ pageSize?: number | undefined; /** * Hint to the server about how many characters long a snippet may be. Server may return less or more. */ maxSnippetSize?: number | undefined; /** * The search terms. */ query: string; /** * Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. */ cursor?: string | undefined; /** * The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. */ resultTabIds?: Array | undefined; inputDetails?: SearchRequestInputDetails | undefined; requestOptions?: SearchRequestOptions | undefined; /** * Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. */ timeoutMillis?: number | undefined; /** * Whether or not to disable spellcheck. */ disableSpellcheck?: boolean | undefined; }; /** @internal */ export type SearchRequest$Outbound = { timestamp?: string | undefined; trackingToken?: string | undefined; sessionInfo?: SessionInfo$Outbound | undefined; sourceDocument?: Document$Outbound | undefined; pageSize?: number | undefined; maxSnippetSize?: number | undefined; query: string; cursor?: string | undefined; resultTabIds?: Array | undefined; inputDetails?: SearchRequestInputDetails$Outbound | undefined; requestOptions?: SearchRequestOptions$Outbound | undefined; timeoutMillis?: number | undefined; disableSpellcheck?: boolean | undefined; }; /** @internal */ export const SearchRequest$outboundSchema: z.ZodType< SearchRequest$Outbound, z.ZodTypeDef, SearchRequest > = z.object({ timestamp: z.date().transform(v => v.toISOString()).optional(), trackingToken: z.string().optional(), sessionInfo: SessionInfo$outboundSchema.optional(), sourceDocument: Document$outboundSchema.optional(), pageSize: z.number().int().optional(), maxSnippetSize: z.number().int().optional(), query: z.string(), cursor: z.string().optional(), resultTabIds: z.array(z.string()).optional(), inputDetails: SearchRequestInputDetails$outboundSchema.optional(), requestOptions: SearchRequestOptions$outboundSchema.optional(), timeoutMillis: z.number().int().optional(), disableSpellcheck: z.boolean().optional(), }); export function searchRequestToJSON(searchRequest: SearchRequest): string { return JSON.stringify(SearchRequest$outboundSchema.parse(searchRequest)); }