Skip to content

Commit

Permalink
Regenerate monitor code (#19375)
Browse files Browse the repository at this point in the history
* Regenrate code

* statistics

* Update sdk/monitor/azure-monitor-query/tests/test_logs_client.py

* ci fix

* Apply suggestions from code review

* lint

* Update sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py

* ci
  • Loading branch information
Rakshith Bhyravabhotla authored Jun 23, 2021
1 parent b8f7a18 commit 676b80e
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 304 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
LogsBatchResultError,
LogsQueryRequest,
LogsBatchResults,
LogsErrorDetails,
MetricNamespace,
MetricDefinition,
MetricsMetadataValue,
Expand All @@ -35,7 +34,6 @@
"LogsQueryResultColumn",
"LogsQueryResultTable",
"LogsQueryRequest",
"LogsErrorDetails",
"MetricsQueryClient",
"MetricNamespace",
"MetricDefinition",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
try:
from ._models_py3 import BatchRequest
from ._models_py3 import BatchResponse
from ._models_py3 import BatchResponseError
from ._models_py3 import BatchResponseErrorInnerError
from ._models_py3 import Column
from ._models_py3 import ErrorDetail
from ._models_py3 import ErrorDetails
from ._models_py3 import ErrorInfo
from ._models_py3 import ErrorResponse
from ._models_py3 import ErrorResponseAutoGenerated
from ._models_py3 import LocalizableString
from ._models_py3 import LogQueryRequest
from ._models_py3 import LogQueryResponse
from ._models_py3 import LogQueryResult
from ._models_py3 import MetadataApplication
from ._models_py3 import MetadataApplicationRelated
from ._models_py3 import MetadataCategory
Expand Down Expand Up @@ -59,17 +57,15 @@
except (SyntaxError, ImportError):
from ._models import BatchRequest # type: ignore
from ._models import BatchResponse # type: ignore
from ._models import BatchResponseError # type: ignore
from ._models import BatchResponseErrorInnerError # type: ignore
from ._models import Column # type: ignore
from ._models import ErrorDetail # type: ignore
from ._models import ErrorDetails # type: ignore
from ._models import ErrorInfo # type: ignore
from ._models import ErrorResponse # type: ignore
from ._models import ErrorResponseAutoGenerated # type: ignore
from ._models import LocalizableString # type: ignore
from ._models import LogQueryRequest # type: ignore
from ._models import LogQueryResponse # type: ignore
from ._models import LogQueryResult # type: ignore
from ._models import MetadataApplication # type: ignore
from ._models import MetadataApplicationRelated # type: ignore
from ._models import MetadataCategory # type: ignore
Expand Down Expand Up @@ -109,6 +105,7 @@

from ._monitor_query_client_enums import (
AggregationType,
ColumnDataType,
MetadataColumnDataType,
ResultType,
Unit,
Expand All @@ -117,17 +114,15 @@
__all__ = [
'BatchRequest',
'BatchResponse',
'BatchResponseError',
'BatchResponseErrorInnerError',
'Column',
'ErrorDetail',
'ErrorDetails',
'ErrorInfo',
'ErrorResponse',
'ErrorResponseAutoGenerated',
'LocalizableString',
'LogQueryRequest',
'LogQueryResponse',
'LogQueryResult',
'MetadataApplication',
'MetadataApplicationRelated',
'MetadataCategory',
Expand Down Expand Up @@ -165,6 +160,7 @@
'Table',
'TimeSeriesElement',
'AggregationType',
'ColumnDataType',
'MetadataColumnDataType',
'ResultType',
'Unit',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ class BatchResponse(msrest.serialization.Model):
:param responses: An array of responses corresponding to each individual request in a batch.
:type responses: list[~monitor_query_client.models.LogQueryResponse]
:param error: Error response for a batch request.
:type error: ~monitor_query_client.models.BatchResponseError
"""

_attribute_map = {
'responses': {'key': 'responses', 'type': '[LogQueryResponse]'},
'error': {'key': 'error', 'type': 'BatchResponseError'},
}

def __init__(
Expand All @@ -49,72 +46,25 @@ def __init__(
):
super(BatchResponse, self).__init__(**kwargs)
self.responses = kwargs.get('responses', None)
self.error = kwargs.get('error', None)


class BatchResponseError(msrest.serialization.Model):
"""Error response for a batch request.
:param message: The error message describing the cause of the error.
:type message: str
:param code: The error code.
:type code: str
:param inner_error:
:type inner_error: ~monitor_query_client.models.BatchResponseErrorInnerError
"""

_attribute_map = {
'message': {'key': 'message', 'type': 'str'},
'code': {'key': 'code', 'type': 'str'},
'inner_error': {'key': 'innerError', 'type': 'BatchResponseErrorInnerError'},
}

def __init__(
self,
**kwargs
):
super(BatchResponseError, self).__init__(**kwargs)
self.message = kwargs.get('message', None)
self.code = kwargs.get('code', None)
self.inner_error = kwargs.get('inner_error', None)


class BatchResponseErrorInnerError(msrest.serialization.Model):
"""BatchResponseErrorInnerError.
:param code:
:type code: str
:param message:
:type message: str
:param details:
:type details: list[~monitor_query_client.models.ErrorDetails]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDetails]'},
}

def __init__(
self,
**kwargs
):
super(BatchResponseErrorInnerError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.details = kwargs.get('details', None)


class Column(msrest.serialization.Model):
"""A column in a table.
:param name: The name of this column.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of this column.
:type name: str
:param type: The data type of this column.
:type type: str
:param type: Required. The data type of this column. Possible values include: "bool",
"datetime", "dynamic", "int", "long", "real", "string".
:type type: str or ~monitor_query_client.models.ColumnDataType
"""

_validation = {
'name': {'required': True},
'type': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
Expand All @@ -125,8 +75,8 @@ def __init__(
**kwargs
):
super(Column, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', None)
self.name = kwargs['name']
self.type = kwargs['type']


class ErrorDetail(msrest.serialization.Model):
Expand Down Expand Up @@ -176,33 +126,6 @@ def __init__(
self.additional_properties = kwargs.get('additional_properties', None)


class ErrorDetails(msrest.serialization.Model):
"""ErrorDetails.
:param code:
:type code: str
:param message:
:type message: str
:param target:
:type target: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
}

def __init__(
self,
**kwargs
):
super(ErrorDetails, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.target = kwargs.get('target', None)


class ErrorInfo(msrest.serialization.Model):
"""The code and message for an error.
Expand Down Expand Up @@ -378,14 +301,18 @@ class LogQueryResponse(msrest.serialization.Model):
:type id: str
:param status:
:type status: int
:param body: Contains the tables, columns & rows resulting from a query.
:type body: ~monitor_query_client.models.QueryResults
:param body: Contains the tables, columns & rows resulting from the query or the error details
if the query failed.
:type body: ~monitor_query_client.models.LogQueryResult
:param headers: Dictionary of :code:`<string>`.
:type headers: dict[str, str]
"""

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'status': {'key': 'status', 'type': 'int'},
'body': {'key': 'body', 'type': 'QueryResults'},
'body': {'key': 'body', 'type': 'LogQueryResult'},
'headers': {'key': 'headers', 'type': '{str}'},
}

def __init__(
Expand All @@ -396,6 +323,38 @@ def __init__(
self.id = kwargs.get('id', None)
self.status = kwargs.get('status', None)
self.body = kwargs.get('body', None)
self.headers = kwargs.get('headers', None)


class LogQueryResult(msrest.serialization.Model):
"""Contains the tables, columns & rows resulting from the query or the error details if the query failed.
:param tables: The list of tables, columns and rows.
:type tables: list[~monitor_query_client.models.Table]
:param error: The code and message for an error.
:type error: ~monitor_query_client.models.ErrorInfo
:param statistics: Any object.
:type statistics: object
:param render: Any object.
:type render: object
"""

_attribute_map = {
'tables': {'key': 'tables', 'type': '[Table]'},
'error': {'key': 'error', 'type': 'ErrorInfo'},
'statistics': {'key': 'statistics', 'type': 'object'},
'render': {'key': 'render', 'type': 'object'},
}

def __init__(
self,
**kwargs
):
super(LogQueryResult, self).__init__(**kwargs)
self.tables = kwargs.get('tables', None)
self.error = kwargs.get('error', None)
self.statistics = kwargs.get('statistics', None)
self.render = kwargs.get('render', None)


class MetadataApplication(msrest.serialization.Model):
Expand Down Expand Up @@ -1630,12 +1589,6 @@ class QueryBody(msrest.serialization.Model):
:type timespan: str
:param workspaces: A list of workspaces that are included in the query.
:type workspaces: list[str]
:param qualified_names: A list of qualified workspace names that are included in the query.
:type qualified_names: list[str]
:param workspace_ids: A list of workspace IDs that are included in the query.
:type workspace_ids: list[str]
:param azure_resource_ids: A list of Azure resource IDs that are included in the query.
:type azure_resource_ids: list[str]
"""

_validation = {
Expand All @@ -1646,9 +1599,6 @@ class QueryBody(msrest.serialization.Model):
'query': {'key': 'query', 'type': 'str'},
'timespan': {'key': 'timespan', 'type': 'str'},
'workspaces': {'key': 'workspaces', 'type': '[str]'},
'qualified_names': {'key': 'qualifiedNames', 'type': '[str]'},
'workspace_ids': {'key': 'workspaceIds', 'type': '[str]'},
'azure_resource_ids': {'key': 'azureResourceIds', 'type': '[str]'},
}

def __init__(
Expand All @@ -1659,32 +1609,39 @@ def __init__(
self.query = kwargs['query']
self.timespan = kwargs.get('timespan', None)
self.workspaces = kwargs.get('workspaces', None)
self.qualified_names = kwargs.get('qualified_names', None)
self.workspace_ids = kwargs.get('workspace_ids', None)
self.azure_resource_ids = kwargs.get('azure_resource_ids', None)


class QueryResults(msrest.serialization.Model):
"""Contains the tables, columns & rows resulting from a query.
:param tables: The list of tables, columns and rows.
All required parameters must be populated in order to send to Azure.
:param tables: Required. The list of tables, columns and rows.
:type tables: list[~monitor_query_client.models.Table]
:param errors:
:type errors: ~monitor_query_client.models.ErrorDetails
:param statistics: Any object.
:type statistics: object
:param render: Any object.
:type render: object
"""

_validation = {
'tables': {'required': True},
}

_attribute_map = {
'tables': {'key': 'tables', 'type': '[Table]'},
'errors': {'key': 'errors', 'type': 'ErrorDetails'},
'statistics': {'key': 'statistics', 'type': 'object'},
'render': {'key': 'render', 'type': 'object'},
}

def __init__(
self,
**kwargs
):
super(QueryResults, self).__init__(**kwargs)
self.tables = kwargs.get('tables', None)
self.errors = kwargs.get('errors', None)
self.tables = kwargs['tables']
self.statistics = kwargs.get('statistics', None)
self.render = kwargs.get('render', None)


class Response(msrest.serialization.Model):
Expand Down
Loading

0 comments on commit 676b80e

Please sign in to comment.