import { ResolvedErrorReason } from "./reason.mjs"; //#region src/error/detail.d.ts declare const DetailType: { readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo'; readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo'; readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo'; readonly QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure'; readonly PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure'; readonly BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest'; readonly REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo'; readonly RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo'; readonly HELP: 'type.googleapis.com/google.rpc.Help'; readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage'; }; type DetailType = (typeof DetailType)[keyof typeof DetailType]; interface ErrorInfo { '@type': typeof DetailType.ERROR_INFO; reason: ResolvedErrorReason; domain?: string; metadata?: Record; } interface RetryInfo { '@type': typeof DetailType.RETRY_INFO; retryDelay: number; } interface DebugInfo { '@type': typeof DetailType.DEBUG_INFO; stackEntries: string[]; detail: string; } interface QuotaFailure { '@type': typeof DetailType.QUOTA_FAILURE; violations: { subject: string; description: string; apiService: string; quoteId: string; quoteValue: number; quotaMetric: string; quotaDimensions: Record; futureQuotaValue: number; }[]; } interface PreconditionFailure { '@type': typeof DetailType.PRECONDITION_FAILURE; violations: { type: string; subject: string; description: string; }[]; } interface BadRequest { '@type': typeof DetailType.BAD_REQUEST; fieldViolations: { field: string; description: string; reason: string; localizedMessage: Omit; }[]; } interface RequestInfo { '@type': typeof DetailType.REQUEST_INFO; requestId: string; servingData: string; } interface ResourceInfo { '@type': typeof DetailType.RESOURCE_INFO; resourceType: string; resourceName: string; owner: string; description: string; } interface Help { '@type': typeof DetailType.HELP; links: { url: string; description: string; }[]; } interface LocalizedMessage { '@type': typeof DetailType.LOCALIZED_MESSAGE; locale: string; message: string; } type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage; /** * Example usage: * const details = Details.new() * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' }) * .errorInfo({ reason: 'ACCOUNT_LOCKED' }); * */ declare class Details { readonly list: Detail[]; private constructor(); static new(): Details; errorInfo(detail: Omit): this; retryInfo(detail: Omit): this; debugInfo(detail: Omit): this; quotaFailure(detail: Omit): this; preconditionFailure(detail: Omit): this; badRequest(detail: Omit): this; requestInfo(detail: Omit): this; resourceInfo(detail: Omit): this; help(detail: Omit): this; localizedMessage(detail: Omit): this; } //#endregion export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo }; //# sourceMappingURL=detail.d.mts.map