Skip to content

Commit

Permalink
CodeGen from PR 12232 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.Insights to add version stable/2019-03-01 (Azure#12232)

* Fixed swagger validations for api version 2019

* reverted error response change and suppress

* removed redundant error details

* renamed suppression rule

* fixed suppression
  • Loading branch information
SDKAuto committed Jan 5, 2021
1 parent a6e0a61 commit 20db098
Show file tree
Hide file tree
Showing 219 changed files with 8,599 additions and 1,337 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
163 changes: 100 additions & 63 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
163 changes: 100 additions & 63 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self.subscription_id = subscription_id
self.api_version = "2015-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false
"has_lro_operations": false,
"client_side_validation": true
},
"global_parameters": {
"sync_method": {
"sync": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"async": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"docstring_type": "str",
"required": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.activity_logs = ActivityLogsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
self.subscription_id = subscription_id
self.api_version = "2015-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.activity_logs = ActivityLogsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class ActivityLogsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -46,7 +46,7 @@ def list(
filter: str,
select: Optional[str] = None,
**kwargs
) -> AsyncIterable["models.EventDataCollection"]:
) -> AsyncIterable["_models.EventDataCollection"]:
"""Provides the list of records from the activity logs.
:param filter: Reduces the set of data collected.:code:`<br>`This argument is required and it
Expand Down Expand Up @@ -77,7 +77,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -125,7 +125,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class AutoscaleSettingsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -45,7 +45,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["models.AutoscaleSettingResourceCollection"]:
) -> AsyncIterable["_models.AutoscaleSettingResourceCollection"]:
"""Lists the autoscale settings for a resource group.
:param resource_group_name: The name of the resource group.
Expand All @@ -55,7 +55,7 @@ def list_by_resource_group(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -101,7 +101,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -116,9 +116,9 @@ async def create_or_update(
self,
resource_group_name: str,
autoscale_setting_name: str,
parameters: "models.AutoscaleSettingResource",
parameters: "_models.AutoscaleSettingResource",
**kwargs
) -> "models.AutoscaleSettingResource":
) -> "_models.AutoscaleSettingResource":
"""Creates or updates an autoscale setting.
:param resource_group_name: The name of the resource group.
Expand All @@ -132,7 +132,7 @@ async def create_or_update(
:rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -168,7 +168,7 @@ async def create_or_update(

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -231,7 +231,7 @@ async def delete(

if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand All @@ -244,7 +244,7 @@ async def get(
resource_group_name: str,
autoscale_setting_name: str,
**kwargs
) -> "models.AutoscaleSettingResource":
) -> "_models.AutoscaleSettingResource":
"""Gets an autoscale setting.
:param resource_group_name: The name of the resource group.
Expand All @@ -256,7 +256,7 @@ async def get(
:rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -287,7 +287,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response)
Expand All @@ -302,9 +302,9 @@ async def update(
self,
resource_group_name: str,
autoscale_setting_name: str,
autoscale_setting_resource: "models.AutoscaleSettingResourcePatch",
autoscale_setting_resource: "_models.AutoscaleSettingResourcePatch",
**kwargs
) -> "models.AutoscaleSettingResource":
) -> "_models.AutoscaleSettingResource":
"""Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate
method.
Expand All @@ -319,7 +319,7 @@ async def update(
:rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -355,7 +355,7 @@ async def update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response)
Expand All @@ -369,15 +369,15 @@ async def update(
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["models.AutoscaleSettingResourceCollection"]:
) -> AsyncIterable["_models.AutoscaleSettingResourceCollection"]:
"""Lists the autoscale settings for a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either AutoscaleSettingResourceCollection or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -422,7 +422,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class EventCategoriesOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list(
self,
**kwargs
) -> AsyncIterable["models.EventCategoryCollection"]:
) -> AsyncIterable["_models.EventCategoryCollection"]:
"""Get the list of available event categories supported in the Activity Logs
Service.:code:`<br>`The current list includes the following: Administrative, Security,
ServiceHealth, Alert, Recommendation, Policy.
Expand All @@ -54,7 +54,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventCategoryCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.EventCategoryCollection"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.EventCategoryCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -95,7 +95,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -32,7 +32,7 @@ class Operations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -43,15 +43,15 @@ def __init__(self, client, config, serializer, deserializer) -> None:
async def list(
self,
**kwargs
) -> "models.OperationListResult":
) -> "_models.OperationListResult":
"""Lists all of the available operations from Microsoft.Insights provider.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: OperationListResult, or the result of cls(response)
:rtype: ~$(python-base-namespace).v2015_04_01.models.OperationListResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down
Loading

0 comments on commit 20db098

Please sign in to comment.