Skip to content

Commit ebfeecc

Browse files
author
SDKAuto
committed
CodeGen from PR 33988 in Azure/azure-rest-api-specs
Merge f5e13c30c10989d1081f6f1ec22fee85bd444bef into 5b798125a6aa7d5152fe0e3dd595d8a76dcfa568
1 parent acc0d4a commit ebfeecc

File tree

174 files changed

+1968
-1820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+1968
-1820
lines changed

sdk/applicationinsights/azure-mgmt-applicationinsights/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Application Insights Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "38009e911dfeee23d7c6830aa384c8945c6665d2",
2+
"commit": "e18a444f27b006d9f2afa23af78e3191f74e1579",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.27.4",
6+
"@autorest/python@6.33.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/applicationinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/applicationinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.33.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/applicationinsights/resource-manager/readme.md"
1111
}

sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from typing import Any, Optional, TYPE_CHECKING
12+
from typing import Any, Optional, TYPE_CHECKING, cast
1313
from typing_extensions import Self
1414

1515
from azure.core.pipeline import policies
16+
from azure.core.settings import settings
1617
from azure.mgmt.core import ARMPipelineClient
1718
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
19+
from azure.mgmt.core.tools import get_arm_endpoints
1820
from azure.profiles import KnownProfiles, ProfileDefinition
1921
from azure.profiles.multiapiclient import MultiApiClientMixin
2022

@@ -27,7 +29,7 @@
2729

2830
class _SDKClient(object):
2931
def __init__(self, *args, **kwargs):
30-
"""This is a fake class to support current implemetation of MultiApiClientMixin."
32+
"""This is a fake class to support current implementation of MultiApiClientMixin."
3133
Will be removed in final version of multiapi azure-core based client
3234
"""
3335
pass
@@ -92,13 +94,18 @@ def __init__(
9294
credential: "TokenCredential",
9395
subscription_id: str,
9496
api_version: Optional[str]=None,
95-
base_url: str = "https://management.azure.com",
97+
base_url: Optional[str] = None,
9698
profile: KnownProfiles=KnownProfiles.default,
9799
**kwargs: Any
98100
):
99101
if api_version:
100102
kwargs.setdefault('api_version', api_version)
101-
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
103+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
104+
_endpoints = get_arm_endpoints(_cloud)
105+
if not base_url:
106+
base_url = _endpoints["resource_manager"]
107+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
108+
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, credential_scopes=credential_scopes, **kwargs)
102109
_policies = kwargs.pop("policies", None)
103110
if _policies is None:
104111
_policies = [
@@ -117,7 +124,7 @@ def __init__(
117124
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
118125
self._config.http_logging_policy,
119126
]
120-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
127+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
121128
super(ApplicationInsightsManagementClient, self).__init__(
122129
api_version=api_version,
123130
profile=profile

0 commit comments

Comments
 (0)