From 39b0865f1bf9ed10bc2d280a1bed4f316eb412ee Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Thu, 30 Sep 2021 00:46:12 -0700 Subject: [PATCH] lint error and ref-docs --- .../monitor-query/review/monitor-query.api.md | 7 +-- .../src/models/publicLogsModels.ts | 62 +++++-------------- 2 files changed, 18 insertions(+), 51 deletions(-) diff --git a/sdk/monitor/monitor-query/review/monitor-query.api.md b/sdk/monitor/monitor-query/review/monitor-query.api.md index 48cb2902d065..acd99daf2df1 100644 --- a/sdk/monitor/monitor-query/review/monitor-query.api.md +++ b/sdk/monitor/monitor-query/review/monitor-query.api.md @@ -98,7 +98,7 @@ export interface LogsQueryOptions extends OperationOptions { throwOnAnyFailure?: boolean; } -// @public (undocumented) +// @public export interface LogsQueryPartialResult { incompleteTables: LogsTable[]; partialError: LogsErrorInfo; @@ -112,15 +112,12 @@ export type LogsQueryResult = LogsQuerySuccessfulResult | LogsQueryPartialResult // @public export enum LogsQueryResultStatus { - // (undocumented) Failure = "Failure", - // (undocumented) PartialFailure = "PartialFailure", - // (undocumented) Success = "Success" } -// @public (undocumented) +// @public export interface LogsQuerySuccessfulResult { statistics?: Record; status: LogsQueryResultStatus.Success; diff --git a/sdk/monitor/monitor-query/src/models/publicLogsModels.ts b/sdk/monitor/monitor-query/src/models/publicLogsModels.ts index 0f1154088f2d..cb60eb79d624 100644 --- a/sdk/monitor/monitor-query/src/models/publicLogsModels.ts +++ b/sdk/monitor/monitor-query/src/models/publicLogsModels.ts @@ -86,21 +86,22 @@ export class AggregateBatchError extends Error { export type LogsQueryResult = LogsQuerySuccessfulResult | LogsQueryPartialResult; /** Indicates if a query succeeded or failed or partially failed. - * Represented by "Partial" | "Success" | "Failed". - * For partially failed queries, users can find data in "tables" attribute - * and error information in "error" attribute */ + * Represented by PartialFailure" | "Success" | "Failure". + */ export enum LogsQueryResultStatus { + /** Represents Partial Failure scenario where partial data and errors of type {@link LogsQueryPartialResult} is returned for query */ PartialFailure = "PartialFailure", + /** Represents Failure scenario where only error of type {@link LogsQueryError} is returned for query */ Failure = "Failure", + /** Represents Success scenario where all data of type {@link LogsQuerySuccessfulResult} is returned for query */ Success = "Success" } + +/** Result type for Success Scenario for logs query workspace and query batch operations. */ export interface LogsQuerySuccessfulResult { /** Populated results from the query. */ tables: LogsTable[]; - /** Indicates if a query succeeded or failed or partially failed. - * Represented by "Partial" | "Success" | "Failed". - * For partially failed queries, users can find data in "tables" attribute - * and error information in "error" attribute */ + /** Indicates that the query succeeded */ status: LogsQueryResultStatus.Success; /** Statistics represented in JSON format. */ statistics?: Record; @@ -108,15 +109,13 @@ export interface LogsQuerySuccessfulResult { visualization?: Record; } +/** Result type for Partial Failure Scenario for logs queryWorkspace and queryBatch operations. */ export interface LogsQueryPartialResult { /** Populated results from the query. */ incompleteTables: LogsTable[]; /** error information for partial errors or failed queries */ partialError: LogsErrorInfo; - /** Indicates if a query succeeded or failed or partially failed. - * Represented by "Partial" | "Success" | "Failed". - * For partially failed queries, users can find data in "tables" attribute - * and error information in "error" attribute */ + /** Indicates that the query partially failed.*/ status: LogsQueryResultStatus.PartialFailure; /** Statistics represented in JSON format. */ statistics?: Record; @@ -124,16 +123,14 @@ export interface LogsQueryPartialResult { visualization?: Record; } -/** The code and message for an error. */ +/** Result type for Failure Scenario representing error for logs queryWorkspace and queryBatch operations. */ export interface LogsQueryError extends Error { /** A machine readable error code. */ code: string; - /** Indicates if a query succeeded or failed or partially failed. - * Represented by "Partial" | "Success" | "Failed". - * For partially failed queries, users can find data in "tables" attribute - * and error information in "error" attribute */ + /** Indicates that the query failed */ status: LogsQueryResultStatus.Failure; } + /** Configurable HTTP request settings and `throwOnAnyFailure` setting for the Logs query batch operation. */ export interface LogsQueryBatchOptions extends OperationOptions { /** @@ -180,39 +177,12 @@ export interface QueryBatch { includeVisualization?: boolean; } -/** Results for a batch query. */ -// export interface LogsQueryBatchResult { -// /** An array of responses corresponding to each individual request in a batch. */ -// results: { -// /** Populated results from the query */ -// tables?: LogsTable[]; -// /** error information for partial errors or failed queries */ -// error?: LogsErrorInfo; -// /** Indicates if a query succeeded or failed or partially failed. -// * Represented by "Partial" | "Success" | "Failed". -// * For partially failed queries, users can find data in "tables" attribute -// * and error information in "error" attribute */ -// status?: LogsQueryResultStatus; -// /** Statistics represented in JSON format. */ -// statistics?: Record; -// /** Visualization data in JSON format. */ -// visualization?: Record; -// }[]; -// } - -/** Results for a batch query. */ +/** Results for a batch query. Each result in the array is either of type + * {@link LogsQueryError} or {@link LogsQueryPartialResult} or {@link LogsQuerySuccessfulResult} + */ export type LogsQueryBatchResult = Array< LogsQueryPartialResult | LogsQuerySuccessfulResult | LogsQueryError >; -// export interface LogsQueryBatchResult { -// /** An array of responses corresponding to each individual request in a batch. */ -// results: LogsQuerySuccessfulResult[] | LogsQueryPartialResult[] | LogsQueryError[]; -// } -/** Indicates if a query succeeded or failed or partially failed. - * Represented by "Partial" | "Success" | "Failed". - * For partially failed queries, users can find data in "tables" attribute - * and error information in "error" attribute */ -//export type LogsQueryResultStatus = "PartialFailure" | "Success" | "Failure"; /** Contains the columns and rows for one table in a query response. */ export interface LogsTable {