/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8eb114ca7c88 */ 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 { AuthStatus, AuthStatus$inboundSchema } from "./authstatus.js"; /** * A datasource instance that could not return results for this request because the user has not completed or has expired per-user OAuth. * * @remarks */ export type UnauthorizedDatasourceInstance = { /** * The instance identifier (e.g. "github", "github_enterprise_0", "slack_0"). Matches the instance names used in datasource configuration. * * @remarks */ datasourceInstance?: string | undefined; /** * Human-readable name of the datasource instance for display. */ displayName?: string | undefined; /** * The per-user authorization status for a datasource. */ authStatus?: AuthStatus | undefined; /** * Relative path to initiate or resume OAuth for the current user and instance, including a one-time authentication token as a query parameter. Clients should prepend their configured Glean backend base URL. * * @remarks */ authUrlRelativePath?: string | undefined; }; /** @internal */ export const UnauthorizedDatasourceInstance$inboundSchema: z.ZodType< UnauthorizedDatasourceInstance, z.ZodTypeDef, unknown > = z.object({ datasourceInstance: z.string().optional(), displayName: z.string().optional(), authStatus: AuthStatus$inboundSchema.optional(), authUrlRelativePath: z.string().optional(), }); export function unauthorizedDatasourceInstanceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UnauthorizedDatasourceInstance$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnauthorizedDatasourceInstance' from JSON`, ); }