Skip to content

Commit

Permalink
lint error and ref-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KarishmaGhiya committed Sep 30, 2021
1 parent 702a5ec commit 39b0865
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 51 deletions.
7 changes: 2 additions & 5 deletions sdk/monitor/monitor-query/review/monitor-query.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export interface LogsQueryOptions extends OperationOptions {
throwOnAnyFailure?: boolean;
}

// @public (undocumented)
// @public
export interface LogsQueryPartialResult {
incompleteTables: LogsTable[];
partialError: LogsErrorInfo;
Expand All @@ -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<string, unknown>;
status: LogsQueryResultStatus.Success;
Expand Down
62 changes: 16 additions & 46 deletions sdk/monitor/monitor-query/src/models/publicLogsModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,54 +86,51 @@ 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<string, unknown>;
/** Visualization data in JSON format. */
visualization?: Record<string, unknown>;
}

/** 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<string, unknown>;
/** Visualization data in JSON format. */
visualization?: Record<string, unknown>;
}

/** 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 {
/**
Expand Down Expand Up @@ -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<string, unknown>;
// /** Visualization data in JSON format. */
// visualization?: Record<string, unknown>;
// }[];
// }

/** 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 {
Expand Down

0 comments on commit 39b0865

Please sign in to comment.