/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2247b931fb35 */ 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"; import { ErrorMessage, ErrorMessage$inboundSchema } from "./errormessage.js"; import { InvalidOperatorValueError, InvalidOperatorValueError$inboundSchema, } from "./invalidoperatorvalueerror.js"; export type GleanDataError = { /** * Indicates the gmail results could not be fetched due to bad token. */ badGmailToken?: boolean | undefined; /** * Indicates the outlook results could not be fetched due to bad token. */ badOutlookToken?: boolean | undefined; /** * Indicates results could not be fetched due to invalid operators in the query. */ invalidOperators?: Array | undefined; errorMessages?: Array | undefined; /** * Indicates the federated search results could not be fetched due to rate limiting. */ federatedSearchRateLimitError?: boolean | undefined; }; /** @internal */ export const GleanDataError$inboundSchema: z.ZodType< GleanDataError, z.ZodTypeDef, unknown > = z.object({ badGmailToken: z.boolean().optional(), badOutlookToken: z.boolean().optional(), invalidOperators: z.array(InvalidOperatorValueError$inboundSchema).optional(), errorMessages: z.array(ErrorMessage$inboundSchema).optional(), federatedSearchRateLimitError: z.boolean().optional(), }); export function gleanDataErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GleanDataError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GleanDataError' from JSON`, ); }