Skip to content

Commit

Permalink
CodeGen from PR 20759 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
config (Azure#20759)
  • Loading branch information
SDKAuto committed Sep 19, 2022
1 parent 56f5beb commit aca3c28
Show file tree
Hide file tree
Showing 664 changed files with 46,674 additions and 32,910 deletions.
10 changes: 5 additions & 5 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",
"autorest": "3.8.4",
"use": [
"@autorest/python@5.16.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.1.6",
"@autorest/modelerfour@4.23.5"
],
"commit": "0a4e1e98112a37f70e46a26ec1598d41d8c4b363",
"commit": "e88987b8a1850d2c372bf049d50f077ed25761a8",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"readme": "specification/monitor/resource-manager/readme.md"
}
4 changes: 4 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
patch_sdk()
except ImportError:
pass

from ._version import VERSION

__version__ = VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class MonitorManagementClientConfiguration(Configuration):
Expand All @@ -28,16 +26,16 @@ class MonitorManagementClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
**kwargs # type: Any
):
# type: (...) -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer
from typing import Any, Optional, TYPE_CHECKING

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

from ._configuration import MonitorManagementClientConfiguration
from ._serialization import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

class _SDKClient(object):
Expand All @@ -43,9 +40,9 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
Expand All @@ -56,16 +53,16 @@ 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 = '2022-06-01'
DEFAULT_API_VERSION = '2022-10-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'action_groups': '2022-06-01',
'activity_log_alerts': '2020-10-01',
'activity_logs': '2015-04-01',
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baselines': '2019-03-01',
'data_collection_endpoints': '2021-04-01',
'data_collection_rule_associations': '2021-04-01',
Expand All @@ -83,7 +80,6 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
'operations': '2015-07-01',
'predictive_metric': '2021-05-01-preview',
'private_endpoint_connections': '2019-10-17-preview',
'private_link_resources': '2019-10-17-preview',
'private_link_scope_operation_status': '2019-10-17-preview',
Expand All @@ -100,10 +96,10 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
api_version=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
base_url: str = "https://management.azure.com",
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
Expand Down Expand Up @@ -149,6 +145,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 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>`
* 2022-06-01: :mod:`v2022_06_01.models<azure.mgmt.monitor.v2022_06_01.models>`
* 2022-10-01: :mod:`v2022_10_01.models<azure.mgmt.monitor.v2022_10_01.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -231,6 +228,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2022-06-01':
from .v2022_06_01 import models
return models
elif api_version == '2022-10-01':
from .v2022_10_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -337,12 +337,15 @@ def autoscale_settings(self):
* 2015-04-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2015_04_01.operations.AutoscaleSettingsOperations>`
* 2021-05-01-preview: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.AutoscaleSettingsOperations>`
* 2022-10-01: :class:`AutoscaleSettingsOperations<azure.mgmt.monitor.v2022_10_01.operations.AutoscaleSettingsOperations>`
"""
api_version = self._get_api_version('autoscale_settings')
if api_version == '2015-04-01':
from .v2015_04_01.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import AutoscaleSettingsOperations as OperationClass
elif api_version == '2022-10-01':
from .v2022_10_01.operations import AutoscaleSettingsOperations as OperationClass
else:
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)))
Expand Down Expand Up @@ -618,10 +621,13 @@ def predictive_metric(self):
"""Instance depends on the API version:
* 2021-05-01-preview: :class:`PredictiveMetricOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.PredictiveMetricOperations>`
* 2022-10-01: :class:`PredictiveMetricOperations<azure.mgmt.monitor.v2022_10_01.operations.PredictiveMetricOperations>`
"""
api_version = self._get_api_version('predictive_metric')
if api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import PredictiveMetricOperations as OperationClass
elif api_version == '2022-10-01':
from .v2022_10_01.operations import PredictiveMetricOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'predictive_metric'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Loading

0 comments on commit aca3c28

Please sign in to comment.