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] Update readme.python.md #8771

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.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
"@autorest/python@5.12.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "14aed8eee51e805ccf9a98c748ab31d798b2da2f",
"commit": "e2e596c9f041a0ed8f9d23e4f84b8f506a9345ea",
"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/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"autorest_command": "autorest specification/applicationinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.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 @@ -23,7 +23,6 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -45,8 +44,6 @@ 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 @@ -55,7 +52,7 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2021-08-01'
DEFAULT_API_VERSION = '2021-10-14'
_PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -75,30 +72,27 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01',
'export_configurations': '2015-05-01',
'favorites': '2015-05-01',
'live_token': '2020-06-02-preview',
'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=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
base_url = 'https://management.azure.com'
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = ApplicationInsightsManagementClientConfiguration(credential, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(ApplicationInsightsManagementClient, self).__init__(
api_version=api_version,
Expand All @@ -124,6 +118,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 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>`
"""
if api_version == '2015-05-01':
from .v2015_05_01 import models
Expand Down Expand Up @@ -158,6 +153,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-08-01':
from .v2021_08_01 import models
return models
elif api_version == '2021-10-14':
from .v2021_10 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -366,10 +364,13 @@ def live_token(self):
"""Instance depends on the API version:

* 2020-06-02-preview: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2020_06_02_preview.operations.LiveTokenOperations>`
* 2021-10-14: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2021_10.operations.LiveTokenOperations>`
"""
api_version = self._get_api_version('live_token')
if api_version == '2020-06-02-preview':
from .v2020_06_02_preview.operations import LiveTokenOperations as OperationClass
elif api_version == '2021-10-14':
from .v2021_10.operations import LiveTokenOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'live_token'".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 @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand All @@ -30,25 +30,19 @@ 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 All @@ -68,4 +62,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
Expand All @@ -21,6 +20,7 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
from azure.core.credentials_async import AsyncTokenCredential

class _SDKClient(object):
Expand All @@ -43,8 +43,6 @@ 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 @@ -53,7 +51,7 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2021-08-01'
DEFAULT_API_VERSION = '2021-10-14'
_PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -73,30 +71,27 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient):
'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01',
'export_configurations': '2015-05-01',
'favorites': '2015-05-01',
'live_token': '2020-06-02-preview',
'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: Optional[str] = None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles = KnownProfiles.default,
**kwargs # type: Any
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = ApplicationInsightsManagementClientConfiguration(credential, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(ApplicationInsightsManagementClient, self).__init__(
api_version=api_version,
Expand All @@ -122,6 +117,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 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>`
"""
if api_version == '2015-05-01':
from ..v2015_05_01 import models
Expand Down Expand Up @@ -156,6 +152,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-08-01':
from ..v2021_08_01 import models
return models
elif api_version == '2021-10-14':
from ..v2021_10 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -364,10 +363,13 @@ def live_token(self):
"""Instance depends on the API version:

* 2020-06-02-preview: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.LiveTokenOperations>`
* 2021-10-14: :class:`LiveTokenOperations<azure.mgmt.applicationinsights.v2021_10.aio.operations.LiveTokenOperations>`
"""
api_version = self._get_api_version('live_token')
if api_version == '2020-06-02-preview':
from ..v2020_06_02_preview.aio.operations import LiveTokenOperations as OperationClass
elif api_version == '2021-10-14':
from ..v2021_10.aio.operations import LiveTokenOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'live_token'".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 @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy

from .._version import VERSION

Expand All @@ -28,24 +28,18 @@ 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 All @@ -64,4 +58,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .v2015_05_01.models import *
from .v2017_10_01.models import *
from .v2020_03_01_preview.models import *
from .v2020_06_02_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 *
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['ApplicationInsightsManagementClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Loading