Skip to content

Commit 7a79a79

Browse files
author
SDKAuto
committed
CodeGen from PR 16160 in Azure/azure-rest-api-specs
Merge 15183d7e25ed653944554eb3cc3f850a4d41464b into 60fcb27
1 parent f8bbfa9 commit 7a79a79

14 files changed

+188
-97
lines changed

sdk/changeanalysis/azure-mgmt-changeanalysis/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "7e7a687df89380b1b02596a14ab18779703a782f",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/changeanalysis/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/[email protected] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/changeanalysis/resource-manager/readme.md"
11+
}

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_azure_change_analysis_management_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import AzureChangeAnalysisManagementClientConfiguration
2122
from .operations import Operations
@@ -65,6 +66,24 @@ def __init__(
6566
self.changes = ChangesOperations(
6667
self._client, self._config, self._serialize, self._deserialize)
6768

69+
def _send_request(self, http_request, **kwargs):
70+
# type: (HttpRequest, Any) -> HttpResponse
71+
"""Runs the network request through the client's chained policies.
72+
73+
:param http_request: The network request you want to make. Required.
74+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
75+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
76+
:return: The response of your network call. Does not do error handling on your response.
77+
:rtype: ~azure.core.pipeline.transport.HttpResponse
78+
"""
79+
path_format_arguments = {
80+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
81+
}
82+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
83+
stream = kwargs.pop("stream", True)
84+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
85+
return pipeline_response.http_response
86+
6887
def close(self):
6988
# type: () -> None
7089
self._client.close()

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_metadata.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": false,
12-
"client_side_validation": false
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureChangeAnalysisManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureChangeAnalysisManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,36 +30,76 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "The ID of the target subscription.",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
5399
},
54100
"operation_groups": {
55101
"operations": "Operations",
56102
"resource_changes": "ResourceChangesOperations",
57103
"changes": "ChangesOperations"
58-
},
59-
"operation_mixins": {
60-
},
61-
"sync_imports": "None",
62-
"async_imports": "None"
104+
}
63105
}

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/_azure_change_analysis_management_client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -62,6 +63,23 @@ def __init__(
6263
self.changes = ChangesOperations(
6364
self._client, self._config, self._serialize, self._deserialize)
6465

66+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
67+
"""Runs the network request through the client's chained policies.
68+
69+
:param http_request: The network request you want to make. Required.
70+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
71+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
72+
:return: The response of your network call. Does not do error handling on your response.
73+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
74+
"""
75+
path_format_arguments = {
76+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
77+
}
78+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
79+
stream = kwargs.pop("stream", True)
80+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
81+
return pipeline_response.http_response
82+
6583
async def close(self) -> None:
6684
await self._client.close()
6785

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_changes_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def list_changes_by_resource_group(
4848
start_time: datetime.datetime,
4949
end_time: datetime.datetime,
5050
skip_token: Optional[str] = None,
51-
**kwargs
51+
**kwargs: Any
5252
) -> AsyncIterable["_models.ChangeList"]:
5353
"""List the changes of a resource group within the specified time range. Customer data will always be masked.
5454
@@ -89,7 +89,7 @@ def prepare_request(next_link=None):
8989
url = self.list_changes_by_resource_group.metadata['url'] # type: ignore
9090
path_format_arguments = {
9191
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
92-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
92+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
9393
}
9494
url = self._client.format_url(url, **path_format_arguments)
9595
# Construct parameters
@@ -121,7 +121,7 @@ async def get_next(next_link=None):
121121
response = pipeline_response.http_response
122122

123123
if response.status_code not in [200]:
124-
error = self._deserialize(_models.ErrorResponse, response)
124+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
125125
map_error(status_code=response.status_code, response=response, error_map=error_map)
126126
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
127127

@@ -137,7 +137,7 @@ def list_changes_by_subscription(
137137
start_time: datetime.datetime,
138138
end_time: datetime.datetime,
139139
skip_token: Optional[str] = None,
140-
**kwargs
140+
**kwargs: Any
141141
) -> AsyncIterable["_models.ChangeList"]:
142142
"""List the changes of a subscription within the specified time range. Customer data will always be masked.
143143
@@ -207,7 +207,7 @@ async def get_next(next_link=None):
207207
response = pipeline_response.http_response
208208

209209
if response.status_code not in [200]:
210-
error = self._deserialize(_models.ErrorResponse, response)
210+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
211211
map_error(status_code=response.status_code, response=response, error_map=error_map)
212212
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
213213

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4444
def list(
4545
self,
4646
skip_token: Optional[str] = None,
47-
**kwargs
47+
**kwargs: Any
4848
) -> AsyncIterable["_models.ResourceProviderOperationList"]:
4949
"""Lists all the supported operations by the Microsoft.ChangeAnalysis resource provider along with their descriptions.
5050
@@ -104,7 +104,7 @@ async def get_next(next_link=None):
104104
response = pipeline_response.http_response
105105

106106
if response.status_code not in [200]:
107-
error = self._deserialize(_models.ErrorResponse, response)
107+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
108108
map_error(status_code=response.status_code, response=response, error_map=error_map)
109109
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
110110

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/aio/operations/_resource_changes_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def list(
4848
start_time: datetime.datetime,
4949
end_time: datetime.datetime,
5050
skip_token: Optional[str] = None,
51-
**kwargs
51+
**kwargs: Any
5252
) -> AsyncIterable["_models.ChangeList"]:
5353
"""List the changes of a resource within the specified time range. Customer data will be masked if the user doesn't have access.
5454
@@ -120,7 +120,7 @@ async def get_next(next_link=None):
120120
response = pipeline_response.http_response
121121

122122
if response.status_code not in [200]:
123-
error = self._deserialize(_models.ErrorResponse, response)
123+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
124124
map_error(status_code=response.status_code, response=response, error_map=error_map)
125125
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
126126

sdk/changeanalysis/azure-mgmt-changeanalysis/azure/mgmt/changeanalysis/models/_models.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,41 @@ def __init__(
4747
self.type = None
4848

4949

50-
class Change(Resource):
50+
class ProxyResource(Resource):
51+
"""The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location.
52+
53+
Variables are only populated by the server, and will be ignored when sending a request.
54+
55+
:ivar id: Fully qualified resource ID for the resource. Ex -
56+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
57+
:vartype id: str
58+
:ivar name: The name of the resource.
59+
:vartype name: str
60+
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
61+
"Microsoft.Storage/storageAccounts".
62+
:vartype type: str
63+
"""
64+
65+
_validation = {
66+
'id': {'readonly': True},
67+
'name': {'readonly': True},
68+
'type': {'readonly': True},
69+
}
70+
71+
_attribute_map = {
72+
'id': {'key': 'id', 'type': 'str'},
73+
'name': {'key': 'name', 'type': 'str'},
74+
'type': {'key': 'type', 'type': 'str'},
75+
}
76+
77+
def __init__(
78+
self,
79+
**kwargs
80+
):
81+
super(ProxyResource, self).__init__(**kwargs)
82+
83+
84+
class Change(ProxyResource):
5185
"""The detected change.
5286
5387
Variables are only populated by the server, and will be ignored when sending a request.
@@ -152,7 +186,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model):
152186
:ivar type: The additional info type.
153187
:vartype type: str
154188
:ivar info: The additional info.
155-
:vartype info: object
189+
:vartype info: any
156190
"""
157191

158192
_validation = {
@@ -292,40 +326,6 @@ def __init__(
292326
self.is_data_masked = kwargs.get('is_data_masked', None)
293327

294328

295-
class ProxyResource(Resource):
296-
"""The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location.
297-
298-
Variables are only populated by the server, and will be ignored when sending a request.
299-
300-
:ivar id: Fully qualified resource ID for the resource. Ex -
301-
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
302-
:vartype id: str
303-
:ivar name: The name of the resource.
304-
:vartype name: str
305-
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
306-
"Microsoft.Storage/storageAccounts".
307-
:vartype type: str
308-
"""
309-
310-
_validation = {
311-
'id': {'readonly': True},
312-
'name': {'readonly': True},
313-
'type': {'readonly': True},
314-
}
315-
316-
_attribute_map = {
317-
'id': {'key': 'id', 'type': 'str'},
318-
'name': {'key': 'name', 'type': 'str'},
319-
'type': {'key': 'type', 'type': 'str'},
320-
}
321-
322-
def __init__(
323-
self,
324-
**kwargs
325-
):
326-
super(ProxyResource, self).__init__(**kwargs)
327-
328-
329329
class ResourceProviderOperationDefinition(msrest.serialization.Model):
330330
"""The resource provider operation definition.
331331

0 commit comments

Comments
 (0)