/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c492b83d160b */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ResultTab = { /** * The unique ID of the tab. Can be passed in a search request to get results for that tab. */ id?: string | undefined; /** * The number of results in this tab for the current query. */ count?: number | undefined; /** * The datasource associated with the tab, if any. */ datasource?: string | undefined; /** * The datasource instance associated with the tab, if any. */ datasourceInstance?: string | undefined; }; /** @internal */ export const ResultTab$inboundSchema: z.ZodType< ResultTab, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), count: z.number().int().optional(), datasource: z.string().optional(), datasourceInstance: z.string().optional(), }); /** @internal */ export type ResultTab$Outbound = { id?: string | undefined; count?: number | undefined; datasource?: string | undefined; datasourceInstance?: string | undefined; }; /** @internal */ export const ResultTab$outboundSchema: z.ZodType< ResultTab$Outbound, z.ZodTypeDef, ResultTab > = z.object({ id: z.string().optional(), count: z.number().int().optional(), datasource: z.string().optional(), datasourceInstance: z.string().optional(), }); export function resultTabToJSON(resultTab: ResultTab): string { return JSON.stringify(ResultTab$outboundSchema.parse(resultTab)); } export function resultTabFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResultTab$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultTab' from JSON`, ); }