Skip to content

Commit

Permalink
CodeGen from PR 12736 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 43bde072637ae6b3d57a417d11463e45b4925ebf into 57e4143
  • Loading branch information
SDKAuto committed Jan 29, 2021
1 parent 94c2735 commit 822ac61
Show file tree
Hide file tree
Showing 268 changed files with 2,425 additions and 1,078 deletions.
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from ._version import VERSION


class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.
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.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -40,7 +40,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs):
"""
pass

class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
class MonitorClient(MultiApiClientMixin, _SDKClient):
"""Monitor Management Client.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
Expand All @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
Expand All @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -92,9 +92,9 @@ def __init__(
):
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(MonitorManagementClient, self).__init__(
super(MonitorClient, self).__init__(
api_version=api_version,
profile=profile
)
Expand Down Expand Up @@ -304,10 +304,13 @@ def baseline(self):
def baselines(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2018_09_01.operations.BaselinesOperations>`
* 2019-03-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2019_03_01.operations.BaselinesOperations>`
"""
api_version = self._get_api_version('baselines')
if api_version == '2019-03-01':
if api_version == '2018-09-01':
from .v2018_09_01.operations import BaselinesOperations as OperationClass
elif api_version == '2019-03-01':
from .v2019_03_01.operations import BaselinesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baselines'".format(api_version))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from .._version import VERSION


class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.
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.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -39,7 +39,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs):
"""
pass

class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
class MonitorClient(MultiApiClientMixin, _SDKClient):
"""Monitor Management Client.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
Expand All @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
Expand All @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -92,9 +92,9 @@ def __init__(
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(MonitorManagementClient, self).__init__(
super(MonitorClient, self).__init__(
api_version=api_version,
profile=profile
)
Expand Down Expand Up @@ -304,10 +304,13 @@ def baseline(self):
def baselines(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.BaselinesOperations>`
* 2019-03-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2019_03_01.aio.operations.BaselinesOperations>`
"""
api_version = self._get_api_version('baselines')
if api_version == '2019-03-01':
if api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import BaselinesOperations as OperationClass
elif api_version == '2019-03-01':
from ..v2019_03_01.aio.operations import BaselinesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baselines'".format(api_version))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

VERSION = "unknown"

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.
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.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -43,7 +43,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"chosen_version": "2015-04-01",
"total_api_version_list": ["2015-04-01"],
"client": {
"name": "MonitorManagementClient",
"filename": "_monitor_management_client",
"name": "MonitorClient",
"filename": "_monitor_client",
"description": "Monitor Management Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false
"client_side_validation": true
},
"global_parameters": {
"sync": {
Expand All @@ -21,7 +21,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -35,7 +35,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from azure.core.credentials import TokenCredential

from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration
from .operations import ActivityLogsOperations
from .operations import AutoscaleSettingsOperations
from .operations import EventCategoriesOperations
Expand All @@ -26,7 +26,7 @@
from . import models


class MonitorManagementClient(object):
class MonitorClient(object):
"""Monitor Management Client.
:ivar activity_logs: ActivityLogsOperations operations
Expand All @@ -41,7 +41,7 @@ class MonitorManagementClient(object):
:vartype tenant_activity_logs: $(python-base-namespace).v2015_04_01.operations.TenantActivityLogsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""
Expand All @@ -56,12 +56,11 @@ def __init__(
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

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 All @@ -80,7 +79,7 @@ def close(self):
self._client.close()

def __enter__(self):
# type: () -> MonitorManagementClient
# type: () -> MonitorClient
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

VERSION = "unknown"

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.
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.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -40,7 +40,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Loading

0 comments on commit 822ac61

Please sign in to comment.