Skip to content

Commit 0a069ce

Browse files
author
SDKAuto
committed
CodeGen from PR 17175 in Azure/azure-rest-api-specs
Merge dec52e351fb8a07d94fb38512aa66d4b8860e346 into 698ebc7
1 parent 6c50bbe commit 0a069ce

File tree

225 files changed

+17746
-9549
lines changed

Some content is hidden

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

225 files changed

+17746
-9549
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/[email protected].2"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "14aed8eee51e805ccf9a98c748ab31d798b2da2f",
7+
"commit": "ca17b2ba463d78aae5ec67d1bd73abc3978f0e1b",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"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/[email protected].2 --version=3.4.5",
9+
"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.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/applicationinsights/resource-manager/readme.md"
1111
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from typing import Any, Optional
2424

2525
from azure.core.credentials import TokenCredential
26-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
2726

2827
class _SDKClient(object):
2928
def __init__(self, *args, **kwargs):
@@ -92,12 +91,10 @@ def __init__(
9291
credential, # type: "TokenCredential"
9392
subscription_id, # type: str
9493
api_version=None, # type: Optional[str]
95-
base_url=None, # type: Optional[str]
94+
base_url="https://management.azure.com", # type: str
9695
profile=KnownProfiles.default, # type: KnownProfiles
9796
**kwargs # type: Any
9897
):
99-
if not base_url:
100-
base_url = 'https://management.azure.com'
10198
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
10299
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
103100
super(ApplicationInsightsManagementClient, self).__init__(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from typing import Any, Optional, TYPE_CHECKING
1313

14-
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1514
from azure.mgmt.core import AsyncARMPipelineClient
1615
from azure.profiles import KnownProfiles, ProfileDefinition
1716
from azure.profiles.multiapiclient import MultiApiClientMixin
@@ -21,6 +20,7 @@
2120

2221
if TYPE_CHECKING:
2322
# pylint: disable=unused-import,ungrouped-imports
23+
from azure.core.credentials import TokenCredential
2424
from azure.core.credentials_async import AsyncTokenCredential
2525

2626
class _SDKClient(object):
@@ -90,12 +90,10 @@ def __init__(
9090
credential: "AsyncTokenCredential",
9191
subscription_id: str,
9292
api_version: Optional[str] = None,
93-
base_url: Optional[str] = None,
93+
base_url: str = "https://management.azure.com",
9494
profile: KnownProfiles = KnownProfiles.default,
9595
**kwargs # type: Any
9696
) -> None:
97-
if not base_url:
98-
base_url = 'https://management.azure.com'
9997
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
10098
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
10199
super(ApplicationInsightsManagementClient, self).__init__(

sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1616

1717
from .._version import VERSION
1818

@@ -64,4 +64,4 @@ def _configure(
6464
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6565
self.authentication_policy = kwargs.get('authentication_policy')
6666
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['ApplicationInsightsManagementClient']
1414

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

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

Lines changed: 74 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -6,153 +6,139 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9+
from copy import deepcopy
910
from typing import TYPE_CHECKING
1011

1112
from azure.mgmt.core import ARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

15+
from . import models
16+
from ._configuration import ApplicationInsightsManagementClientConfiguration
17+
from .operations import APIKeysOperations, AnalyticsItemsOperations, AnnotationsOperations, ComponentAvailableFeaturesOperations, ComponentCurrentBillingFeaturesOperations, ComponentFeatureCapabilitiesOperations, ComponentQuotaStatusOperations, ComponentsOperations, ExportConfigurationsOperations, FavoritesOperations, MyWorkbooksOperations, Operations, ProactiveDetectionConfigurationsOperations, WebTestLocationsOperations, WebTestsOperations, WorkItemConfigurationsOperations, WorkbooksOperations
18+
1419
if TYPE_CHECKING:
1520
# pylint: disable=unused-import,ungrouped-imports
1621
from typing import Any, Optional
1722

1823
from azure.core.credentials import TokenCredential
19-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20-
21-
from ._configuration import ApplicationInsightsManagementClientConfiguration
22-
from .operations import Operations
23-
from .operations import AnnotationsOperations
24-
from .operations import APIKeysOperations
25-
from .operations import ExportConfigurationsOperations
26-
from .operations import ComponentCurrentBillingFeaturesOperations
27-
from .operations import ComponentQuotaStatusOperations
28-
from .operations import ComponentFeatureCapabilitiesOperations
29-
from .operations import ComponentAvailableFeaturesOperations
30-
from .operations import ProactiveDetectionConfigurationsOperations
31-
from .operations import ComponentsOperations
32-
from .operations import WorkItemConfigurationsOperations
33-
from .operations import FavoritesOperations
34-
from .operations import WebTestLocationsOperations
35-
from .operations import WebTestsOperations
36-
from .operations import AnalyticsItemsOperations
37-
from .operations import WorkbooksOperations
38-
from .operations import MyWorkbooksOperations
39-
from . import models
40-
24+
from azure.core.rest import HttpRequest, HttpResponse
4125

4226
class ApplicationInsightsManagementClient(object):
4327
"""Composite Swagger for Application Insights Management Client.
4428
4529
:ivar operations: Operations operations
4630
:vartype operations: azure.mgmt.applicationinsights.v2015_05_01.operations.Operations
4731
:ivar annotations: AnnotationsOperations operations
48-
:vartype annotations: azure.mgmt.applicationinsights.v2015_05_01.operations.AnnotationsOperations
32+
:vartype annotations:
33+
azure.mgmt.applicationinsights.v2015_05_01.operations.AnnotationsOperations
4934
:ivar api_keys: APIKeysOperations operations
5035
:vartype api_keys: azure.mgmt.applicationinsights.v2015_05_01.operations.APIKeysOperations
5136
:ivar export_configurations: ExportConfigurationsOperations operations
52-
:vartype export_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.ExportConfigurationsOperations
37+
:vartype export_configurations:
38+
azure.mgmt.applicationinsights.v2015_05_01.operations.ExportConfigurationsOperations
5339
:ivar component_current_billing_features: ComponentCurrentBillingFeaturesOperations operations
54-
:vartype component_current_billing_features: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentCurrentBillingFeaturesOperations
40+
:vartype component_current_billing_features:
41+
azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentCurrentBillingFeaturesOperations
5542
:ivar component_quota_status: ComponentQuotaStatusOperations operations
56-
:vartype component_quota_status: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentQuotaStatusOperations
43+
:vartype component_quota_status:
44+
azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentQuotaStatusOperations
5745
:ivar component_feature_capabilities: ComponentFeatureCapabilitiesOperations operations
58-
:vartype component_feature_capabilities: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentFeatureCapabilitiesOperations
46+
:vartype component_feature_capabilities:
47+
azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentFeatureCapabilitiesOperations
5948
:ivar component_available_features: ComponentAvailableFeaturesOperations operations
60-
:vartype component_available_features: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentAvailableFeaturesOperations
49+
:vartype component_available_features:
50+
azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentAvailableFeaturesOperations
6151
:ivar proactive_detection_configurations: ProactiveDetectionConfigurationsOperations operations
62-
:vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.ProactiveDetectionConfigurationsOperations
52+
:vartype proactive_detection_configurations:
53+
azure.mgmt.applicationinsights.v2015_05_01.operations.ProactiveDetectionConfigurationsOperations
6354
:ivar components: ComponentsOperations operations
6455
:vartype components: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentsOperations
6556
:ivar work_item_configurations: WorkItemConfigurationsOperations operations
66-
:vartype work_item_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkItemConfigurationsOperations
57+
:vartype work_item_configurations:
58+
azure.mgmt.applicationinsights.v2015_05_01.operations.WorkItemConfigurationsOperations
6759
:ivar favorites: FavoritesOperations operations
6860
:vartype favorites: azure.mgmt.applicationinsights.v2015_05_01.operations.FavoritesOperations
6961
:ivar web_test_locations: WebTestLocationsOperations operations
70-
:vartype web_test_locations: azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestLocationsOperations
62+
:vartype web_test_locations:
63+
azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestLocationsOperations
7164
:ivar web_tests: WebTestsOperations operations
7265
:vartype web_tests: azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestsOperations
7366
:ivar analytics_items: AnalyticsItemsOperations operations
74-
:vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations
67+
:vartype analytics_items:
68+
azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations
7569
:ivar workbooks: WorkbooksOperations operations
7670
:vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations
7771
:ivar my_workbooks: MyWorkbooksOperations operations
78-
:vartype my_workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations
72+
:vartype my_workbooks:
73+
azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations
7974
:param credential: Credential needed for the client to connect to Azure.
8075
:type credential: ~azure.core.credentials.TokenCredential
8176
:param subscription_id: The ID of the target subscription.
8277
:type subscription_id: str
83-
:param str base_url: Service URL
78+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
79+
:type base_url: str
8480
"""
8581

8682
def __init__(
8783
self,
8884
credential, # type: "TokenCredential"
8985
subscription_id, # type: str
90-
base_url=None, # type: Optional[str]
86+
base_url="https://management.azure.com", # type: str
9187
**kwargs # type: Any
9288
):
9389
# type: (...) -> None
94-
if not base_url:
95-
base_url = 'https://management.azure.com'
96-
self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs)
90+
self._config = ApplicationInsightsManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
9791
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
9892

9993
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
10094
self._serialize = Serializer(client_models)
101-
self._serialize.client_side_validation = False
10295
self._deserialize = Deserializer(client_models)
103-
104-
self.operations = Operations(
105-
self._client, self._config, self._serialize, self._deserialize)
106-
self.annotations = AnnotationsOperations(
107-
self._client, self._config, self._serialize, self._deserialize)
108-
self.api_keys = APIKeysOperations(
109-
self._client, self._config, self._serialize, self._deserialize)
110-
self.export_configurations = ExportConfigurationsOperations(
111-
self._client, self._config, self._serialize, self._deserialize)
112-
self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations(
113-
self._client, self._config, self._serialize, self._deserialize)
114-
self.component_quota_status = ComponentQuotaStatusOperations(
115-
self._client, self._config, self._serialize, self._deserialize)
116-
self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations(
117-
self._client, self._config, self._serialize, self._deserialize)
118-
self.component_available_features = ComponentAvailableFeaturesOperations(
119-
self._client, self._config, self._serialize, self._deserialize)
120-
self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations(
121-
self._client, self._config, self._serialize, self._deserialize)
122-
self.components = ComponentsOperations(
123-
self._client, self._config, self._serialize, self._deserialize)
124-
self.work_item_configurations = WorkItemConfigurationsOperations(
125-
self._client, self._config, self._serialize, self._deserialize)
126-
self.favorites = FavoritesOperations(
127-
self._client, self._config, self._serialize, self._deserialize)
128-
self.web_test_locations = WebTestLocationsOperations(
129-
self._client, self._config, self._serialize, self._deserialize)
130-
self.web_tests = WebTestsOperations(
131-
self._client, self._config, self._serialize, self._deserialize)
132-
self.analytics_items = AnalyticsItemsOperations(
133-
self._client, self._config, self._serialize, self._deserialize)
134-
self.workbooks = WorkbooksOperations(
135-
self._client, self._config, self._serialize, self._deserialize)
136-
self.my_workbooks = MyWorkbooksOperations(
137-
self._client, self._config, self._serialize, self._deserialize)
138-
139-
def _send_request(self, http_request, **kwargs):
140-
# type: (HttpRequest, Any) -> HttpResponse
96+
self._serialize.client_side_validation = False
97+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
98+
self.annotations = AnnotationsOperations(self._client, self._config, self._serialize, self._deserialize)
99+
self.api_keys = APIKeysOperations(self._client, self._config, self._serialize, self._deserialize)
100+
self.export_configurations = ExportConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
101+
self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations(self._client, self._config, self._serialize, self._deserialize)
102+
self.component_quota_status = ComponentQuotaStatusOperations(self._client, self._config, self._serialize, self._deserialize)
103+
self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize)
104+
self.component_available_features = ComponentAvailableFeaturesOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
106+
self.components = ComponentsOperations(self._client, self._config, self._serialize, self._deserialize)
107+
self.work_item_configurations = WorkItemConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
108+
self.favorites = FavoritesOperations(self._client, self._config, self._serialize, self._deserialize)
109+
self.web_test_locations = WebTestLocationsOperations(self._client, self._config, self._serialize, self._deserialize)
110+
self.web_tests = WebTestsOperations(self._client, self._config, self._serialize, self._deserialize)
111+
self.analytics_items = AnalyticsItemsOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.workbooks = WorkbooksOperations(self._client, self._config, self._serialize, self._deserialize)
113+
self.my_workbooks = MyWorkbooksOperations(self._client, self._config, self._serialize, self._deserialize)
114+
115+
116+
def _send_request(
117+
self,
118+
request, # type: HttpRequest
119+
**kwargs # type: Any
120+
):
121+
# type: (...) -> HttpResponse
141122
"""Runs the network request through the client's chained policies.
142123
143-
:param http_request: The network request you want to make. Required.
144-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
145-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
124+
>>> from azure.core.rest import HttpRequest
125+
>>> request = HttpRequest("GET", "https://www.example.org/")
126+
<HttpRequest [GET], url: 'https://www.example.org/'>
127+
>>> response = client._send_request(request)
128+
<HttpResponse: 200 OK>
129+
130+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
131+
132+
:param request: The network request you want to make. Required.
133+
:type request: ~azure.core.rest.HttpRequest
134+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
146135
:return: The response of your network call. Does not do error handling on your response.
147-
:rtype: ~azure.core.pipeline.transport.HttpResponse
136+
:rtype: ~azure.core.rest.HttpResponse
148137
"""
149-
path_format_arguments = {
150-
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
151-
}
152-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
153-
stream = kwargs.pop("stream", True)
154-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
155-
return pipeline_response.http_response
138+
139+
request_copy = deepcopy(request)
140+
request_copy.url = self._client.format_url(request_copy.url)
141+
return self._client.send_request(request_copy, **kwargs)
156142

157143
def close(self):
158144
# type: () -> None

0 commit comments

Comments
 (0)