Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-applicationinsights] [Mgmt] Remove global configuration "multiapi" #480

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/modelerfour@4.19.3"
],
"commit": "c09cdeb44b05311c0070ca047df3a48be3849bb4",
"commit": "6b99a68f01d4ff7da9fcf5d6d315652ebc1d3031",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/applicationinsights/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/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/applicationinsights/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/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/applicationinsights/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 ApplicationInsightsManagementClientConfiguration

Expand Down Expand Up @@ -44,6 +45,8 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
: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
:param base_url: Service URL
Expand All @@ -52,7 +55,7 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2021-10-14'
DEFAULT_API_VERSION = '2022-04-01'
_PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -66,33 +69,34 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
'component_feature_capabilities': '2015-05-01',
'component_linked_storage_accounts': '2020-03-01-preview',
'component_quota_status': '2015-05-01',
'components': '2015-05-01',
'components': '2020-02-02',
'ea_subscription_list_migration_date': '2017-10-01',
'ea_subscription_migrate_to_new_pricing_model': '2017-10-01',
'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01',
'export_configurations': '2015-05-01',
'favorites': '2015-05-01',
'live_token': '2021-10-14',
'my_workbooks': '2021-03-08',
'operations': '2015-05-01',
'proactive_detection_configurations': '2015-05-01',
'web_test_locations': '2015-05-01',
'web_tests': '2015-05-01',
'work_item_configurations': '2015-05-01',
'workbook_templates': '2020-11-20',
'workbooks': '2021-08-01',
}},
_PROFILE_TAG + " latest"
)

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
self._config = ApplicationInsightsManagementClientConfiguration(credential, **kwargs)
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(ApplicationInsightsManagementClient, self).__init__(
api_version=api_version,
Expand All @@ -112,13 +116,15 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-05-01-preview: :mod:`v2018_05_01_preview.models<azure.mgmt.applicationinsights.v2018_05_01_preview.models>`
* 2018-06-17-preview: :mod:`v2018_06_17_preview.models<azure.mgmt.applicationinsights.v2018_06_17_preview.models>`
* 2019-10-17-preview: :mod:`v2019_10_17_preview.models<azure.mgmt.applicationinsights.v2019_10_17_preview.models>`
* 2020-02-02: :mod:`v2020_02_02.models<azure.mgmt.applicationinsights.v2020_02_02.models>`
* 2020-02-02-preview: :mod:`v2020_02_02_preview.models<azure.mgmt.applicationinsights.v2020_02_02_preview.models>`
* 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.applicationinsights.v2020_03_01_preview.models>`
* 2020-06-02-preview: :mod:`v2020_06_02_preview.models<azure.mgmt.applicationinsights.v2020_06_02_preview.models>`
* 2020-11-20: :mod:`v2020_11_20.models<azure.mgmt.applicationinsights.v2020_11_20.models>`
* 2021-03-08: :mod:`v2021_03_08.models<azure.mgmt.applicationinsights.v2021_03_08.models>`
* 2021-08-01: :mod:`v2021_08_01.models<azure.mgmt.applicationinsights.v2021_08_01.models>`
* 2021-10-14: :mod:`v2021_10.models<azure.mgmt.applicationinsights.v2021_10.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.applicationinsights.v2022_04_01.models>`
"""
if api_version == '2015-05-01':
from .v2015_05_01 import models
Expand All @@ -135,6 +141,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-10-17-preview':
from .v2019_10_17_preview import models
return models
elif api_version == '2020-02-02':
from .v2020_02_02 import models
return models
elif api_version == '2020-02-02-preview':
from .v2020_02_02_preview import models
return models
Expand All @@ -156,6 +165,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-10-14':
from .v2021_10 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 Down Expand Up @@ -281,13 +293,16 @@ def components(self):

* 2015-05-01: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentsOperations>`
* 2018-05-01-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.operations.ComponentsOperations>`
* 2020-02-02: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02.operations.ComponentsOperations>`
* 2020-02-02-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02_preview.operations.ComponentsOperations>`
"""
api_version = self._get_api_version('components')
if api_version == '2015-05-01':
from .v2015_05_01.operations import ComponentsOperations as OperationClass
elif api_version == '2018-05-01-preview':
from .v2018_05_01_preview.operations import ComponentsOperations as OperationClass
elif api_version == '2020-02-02':
from .v2020_02_02.operations import ComponentsOperations as OperationClass
elif api_version == '2020-02-02-preview':
from .v2020_02_02_preview.operations import ComponentsOperations as OperationClass
else:
Expand Down Expand Up @@ -494,6 +509,7 @@ def workbooks(self):
* 2015-05-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations>`
* 2018-06-17-preview: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2018_06_17_preview.operations.WorkbooksOperations>`
* 2021-08-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2021_08_01.operations.WorkbooksOperations>`
* 2022-04-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2022_04_01.operations.WorkbooksOperations>`
"""
api_version = self._get_api_version('workbooks')
if api_version == '2015-05-01':
Expand All @@ -502,6 +518,8 @@ def workbooks(self):
from .v2018_06_17_preview.operations import WorkbooksOperations as OperationClass
elif api_version == '2021-08-01':
from .v2021_08_01.operations import WorkbooksOperations as OperationClass
elif api_version == '2022-04-01':
from .v2022_04_01.operations import WorkbooksOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'workbooks'".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 @@ -30,19 +30,25 @@ class ApplicationInsightsManagementClientConfiguration(Configuration):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs)

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-applicationinsights/{}'.format(VERSION))
self._configure(**kwargs)
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 ApplicationInsightsManagementClientConfiguration

Expand Down Expand Up @@ -43,6 +44,8 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
: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
:param base_url: Service URL
Expand All @@ -51,7 +54,7 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2021-10-14'
DEFAULT_API_VERSION = '2022-04-01'
_PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -65,33 +68,34 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
'component_feature_capabilities': '2015-05-01',
'component_linked_storage_accounts': '2020-03-01-preview',
'component_quota_status': '2015-05-01',
'components': '2015-05-01',
'components': '2020-02-02',
'ea_subscription_list_migration_date': '2017-10-01',
'ea_subscription_migrate_to_new_pricing_model': '2017-10-01',
'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01',
'export_configurations': '2015-05-01',
'favorites': '2015-05-01',
'live_token': '2021-10-14',
'my_workbooks': '2021-03-08',
'operations': '2015-05-01',
'proactive_detection_configurations': '2015-05-01',
'web_test_locations': '2015-05-01',
'web_tests': '2015-05-01',
'work_item_configurations': '2015-05-01',
'workbook_templates': '2020-11-20',
'workbooks': '2021-08-01',
}},
_PROFILE_TAG + " latest"
)

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
api_version: Optional[str] = None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles = KnownProfiles.default,
**kwargs # type: Any
) -> None:
self._config = ApplicationInsightsManagementClientConfiguration(credential, **kwargs)
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(ApplicationInsightsManagementClient, self).__init__(
api_version=api_version,
Expand All @@ -111,13 +115,15 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-05-01-preview: :mod:`v2018_05_01_preview.models<azure.mgmt.applicationinsights.v2018_05_01_preview.models>`
* 2018-06-17-preview: :mod:`v2018_06_17_preview.models<azure.mgmt.applicationinsights.v2018_06_17_preview.models>`
* 2019-10-17-preview: :mod:`v2019_10_17_preview.models<azure.mgmt.applicationinsights.v2019_10_17_preview.models>`
* 2020-02-02: :mod:`v2020_02_02.models<azure.mgmt.applicationinsights.v2020_02_02.models>`
* 2020-02-02-preview: :mod:`v2020_02_02_preview.models<azure.mgmt.applicationinsights.v2020_02_02_preview.models>`
* 2020-03-01-preview: :mod:`v2020_03_01_preview.models<azure.mgmt.applicationinsights.v2020_03_01_preview.models>`
* 2020-06-02-preview: :mod:`v2020_06_02_preview.models<azure.mgmt.applicationinsights.v2020_06_02_preview.models>`
* 2020-11-20: :mod:`v2020_11_20.models<azure.mgmt.applicationinsights.v2020_11_20.models>`
* 2021-03-08: :mod:`v2021_03_08.models<azure.mgmt.applicationinsights.v2021_03_08.models>`
* 2021-08-01: :mod:`v2021_08_01.models<azure.mgmt.applicationinsights.v2021_08_01.models>`
* 2021-10-14: :mod:`v2021_10.models<azure.mgmt.applicationinsights.v2021_10.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.applicationinsights.v2022_04_01.models>`
"""
if api_version == '2015-05-01':
from ..v2015_05_01 import models
Expand All @@ -134,6 +140,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-10-17-preview':
from ..v2019_10_17_preview import models
return models
elif api_version == '2020-02-02':
from ..v2020_02_02 import models
return models
elif api_version == '2020-02-02-preview':
from ..v2020_02_02_preview import models
return models
Expand All @@ -155,6 +164,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-10-14':
from ..v2021_10 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 Down Expand Up @@ -280,13 +292,16 @@ def components(self):

* 2015-05-01: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentsOperations>`
* 2018-05-01-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ComponentsOperations>`
* 2020-02-02: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02.aio.operations.ComponentsOperations>`
* 2020-02-02-preview: :class:`ComponentsOperations<azure.mgmt.applicationinsights.v2020_02_02_preview.aio.operations.ComponentsOperations>`
"""
api_version = self._get_api_version('components')
if api_version == '2015-05-01':
from ..v2015_05_01.aio.operations import ComponentsOperations as OperationClass
elif api_version == '2018-05-01-preview':
from ..v2018_05_01_preview.aio.operations import ComponentsOperations as OperationClass
elif api_version == '2020-02-02':
from ..v2020_02_02.aio.operations import ComponentsOperations as OperationClass
elif api_version == '2020-02-02-preview':
from ..v2020_02_02_preview.aio.operations import ComponentsOperations as OperationClass
else:
Expand Down Expand Up @@ -493,6 +508,7 @@ def workbooks(self):
* 2015-05-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkbooksOperations>`
* 2018-06-17-preview: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2018_06_17_preview.aio.operations.WorkbooksOperations>`
* 2021-08-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2021_08_01.aio.operations.WorkbooksOperations>`
* 2022-04-01: :class:`WorkbooksOperations<azure.mgmt.applicationinsights.v2022_04_01.aio.operations.WorkbooksOperations>`
"""
api_version = self._get_api_version('workbooks')
if api_version == '2015-05-01':
Expand All @@ -501,6 +517,8 @@ def workbooks(self):
from ..v2018_06_17_preview.aio.operations import WorkbooksOperations as OperationClass
elif api_version == '2021-08-01':
from ..v2021_08_01.aio.operations import WorkbooksOperations as OperationClass
elif api_version == '2022-04-01':
from ..v2022_04_01.aio.operations import WorkbooksOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'workbooks'".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 @@ -28,18 +28,24 @@ class ApplicationInsightsManagementClientConfiguration(Configuration):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs)

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-applicationinsights/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# --------------------------------------------------------------------------
from .v2015_05_01.models import *
from .v2017_10_01.models import *
from .v2020_02_02.models import *
from .v2020_03_01_preview.models import *
from .v2020_11_20.models import *
from .v2021_03_08.models import *
from .v2021_08_01.models import *
from .v2021_10.models import *
from .v2022_04_01.models import *
Loading