Skip to content

Commit

Permalink
CodeGen from PR 19273 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b91ffac4f3b4981092c1d868dfffd85590e476b8 into 2e59fa3ef47822961f3bde711183859729fc9970
  • Loading branch information
SDKAuto committed Jun 2, 2022
1 parent 62ffa83 commit b98aa81
Show file tree
Hide file tree
Showing 308 changed files with 12,264 additions and 6,758 deletions.
6 changes: 3 additions & 3 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/python@5.12.0",
"@autorest/python@5.13.0",
"@autorest/[email protected]"
],
"commit": "8174b2fc60e288a9d7fcdff5f9414e43a6ad5989",
"commit": "072dca0080f39db3099eb21cf610456e62c16fb2",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected] --version=3.7.2",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/monitor/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration

Expand Down Expand Up @@ -55,7 +56,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2021-09-01'
DEFAULT_API_VERSION = '2022-04-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -65,7 +66,6 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baseline': '2018-09-01',
'baselines': '2019-03-01',
'data_collection_endpoints': '2021-04-01',
'data_collection_rule_associations': '2021-04-01',
Expand All @@ -79,7 +79,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'management_group_diagnostic_settings': '2021-05-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_baseline': '2017-11-01-preview',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
Expand Down Expand Up @@ -149,6 +149,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.monitor.v2021_09_01.models>`
* 2021-09-01-preview: :mod:`v2022_02_01_preview.models<azure.mgmt.monitor.v2022_02_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.monitor.v2022_04_01.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -228,6 +229,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-09-01-preview':
from .v2022_02_01_preview import models
return models
elif api_version == '2022-04-01':
from .v2022_04_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -240,6 +244,7 @@ def action_groups(self):
* 2019-03-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_03_01.operations.ActionGroupsOperations>`
* 2019-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_06_01.operations.ActionGroupsOperations>`
* 2021-09-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2021_09_01.operations.ActionGroupsOperations>`
* 2022-04-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_04_01.operations.ActionGroupsOperations>`
"""
api_version = self._get_api_version('action_groups')
if api_version == '2017-04-01':
Expand All @@ -254,6 +259,8 @@ def action_groups(self):
from .v2019_06_01.operations import ActionGroupsOperations as OperationClass
elif api_version == '2021-09-01':
from .v2021_09_01.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-04-01':
from .v2022_04_01.operations import ActionGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'action_groups'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -338,19 +345,6 @@ def autoscale_settings(self):
raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baseline(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselineOperations<azure.mgmt.monitor.v2018_09_01.operations.BaselineOperations>`
"""
api_version = self._get_api_version('baseline')
if api_version == '2018-09-01':
from .v2018_09_01.operations import BaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baselines(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -549,13 +543,10 @@ def metric_baseline(self):
"""Instance depends on the API version:
* 2017-11-01-preview: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2017_11_01_preview.operations.MetricBaselineOperations>`
* 2018-09-01: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2018_09_01.operations.MetricBaselineOperations>`
"""
api_version = self._get_api_version('metric_baseline')
if api_version == '2017-11-01-preview':
from .v2017_11_01_preview.operations import MetricBaselineOperations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import MetricBaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

from typing import Any, Optional, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.mgmt.core import AsyncARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration

Expand Down Expand Up @@ -54,7 +55,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2021-09-01'
DEFAULT_API_VERSION = '2022-04-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -64,7 +65,6 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baseline': '2018-09-01',
'baselines': '2019-03-01',
'data_collection_endpoints': '2021-04-01',
'data_collection_rule_associations': '2021-04-01',
Expand All @@ -78,7 +78,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'management_group_diagnostic_settings': '2021-05-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_baseline': '2017-11-01-preview',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
Expand Down Expand Up @@ -148,6 +148,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.monitor.v2021_09_01.models>`
* 2021-09-01-preview: :mod:`v2022_02_01_preview.models<azure.mgmt.monitor.v2022_02_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.monitor.v2022_04_01.models>`
"""
if api_version == '2015-04-01':
from ..v2015_04_01 import models
Expand Down Expand Up @@ -227,6 +228,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-09-01-preview':
from ..v2022_02_01_preview import models
return models
elif api_version == '2022-04-01':
from ..v2022_04_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -239,6 +243,7 @@ def action_groups(self):
* 2019-03-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_03_01.aio.operations.ActionGroupsOperations>`
* 2019-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_06_01.aio.operations.ActionGroupsOperations>`
* 2021-09-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2021_09_01.aio.operations.ActionGroupsOperations>`
* 2022-04-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_04_01.aio.operations.ActionGroupsOperations>`
"""
api_version = self._get_api_version('action_groups')
if api_version == '2017-04-01':
Expand All @@ -253,6 +258,8 @@ def action_groups(self):
from ..v2019_06_01.aio.operations import ActionGroupsOperations as OperationClass
elif api_version == '2021-09-01':
from ..v2021_09_01.aio.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-04-01':
from ..v2022_04_01.aio.operations import ActionGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'action_groups'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -337,19 +344,6 @@ def autoscale_settings(self):
raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baseline(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselineOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.BaselineOperations>`
"""
api_version = self._get_api_version('baseline')
if api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import BaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baselines(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -548,13 +542,10 @@ def metric_baseline(self):
"""Instance depends on the API version:
* 2017-11-01-preview: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2017_11_01_preview.aio.operations.MetricBaselineOperations>`
* 2018-09-01: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.MetricBaselineOperations>`
"""
api_version = self._get_api_version('metric_baseline')
if api_version == '2017-11-01-preview':
from ..v2017_11_01_preview.aio.operations import MetricBaselineOperations as OperationClass
elif api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import MetricBaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
from .v2015_07_01.models import *
from .v2016_03_01.models import *
from .v2016_09_01.models import *
from .v2017_11_01_preview.models import *
from .v2017_12_01_preview.models import *
from .v2018_01_01.models import *
from .v2018_03_01.models import *
from .v2018_04_16.models import *
from .v2018_06_01_preview.models import *
from .v2018_09_01.models import *
from .v2018_11_27_preview.models import *
from .v2019_03_01.models import *
from .v2019_10_17.models import *
from .v2020_10_01.models import *
from .v2021_04_01.models import *
from .v2021_05_01_preview.models import *
from .v2021_09_01.models import *
from .v2022_04_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from azure.core.credentials import TokenCredential


class MonitorManagementClientConfiguration(Configuration):
class MonitorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for MonitorManagementClient.
Note that all parameters used to create this instance are saved as instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

from . import models
from ._configuration import MonitorManagementClientConfiguration
Expand Down Expand Up @@ -43,7 +44,7 @@ class MonitorManagementClient:
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
"""

Expand Down Expand Up @@ -71,7 +72,7 @@ def __init__(

def _send_request(
self,
request, # type: HttpRequest
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "3.1.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from azure.core.credentials_async import AsyncTokenCredential


class MonitorManagementClientConfiguration(Configuration):
class MonitorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for MonitorManagementClient.
Note that all parameters used to create this instance are saved as instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, Optional, TYPE_CHECKING
from typing import Any, Awaitable, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

from .. import models
from ._configuration import MonitorManagementClientConfiguration
Expand Down Expand Up @@ -44,7 +45,7 @@ class MonitorManagementClient:
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
"""

Expand Down
Loading

0 comments on commit b98aa81

Please sign in to comment.