Skip to content

Commit d34872c

Browse files
msyycSDKAutoYan Zhang (WICRESOFT NORTH AMERICA LTD)
authored
[AutoRelease] t2-resourcegraph-2021-03-31-51385 (#17692)
* CodeGen from PR 13715 in Azure/azure-rest-api-specs resourcegraph readme t2 config (#13715) * version,CHANGELOG * test * fix test * fix test again * skip test Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent 8bda918 commit d34872c

19 files changed

+158
-1097
lines changed

sdk/resources/azure-mgmt-resourcegraph/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 8.0.0 (2021-03-31)
4+
5+
**Features**
6+
7+
- Model QueryRequest has a new parameter management_groups
8+
- Model QueryRequestOptions has a new parameter allow_partial_scopes
9+
10+
**Breaking changes**
11+
12+
- Model QueryRequest no longer has parameter management_group_id
13+
- Removed operation ResourceGraphClientOperationsMixin.resource_changes
14+
- Removed operation ResourceGraphClientOperationsMixin.resource_change_details
15+
316
## 7.0.0 (2020-12-15)
417

518
- GA Release

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
super(ResourceGraphClientConfiguration, self).__init__(**kwargs)
4343

4444
self.credential = credential
45-
self.api_version = "2020-04-01-preview"
45+
self.api_version = "2021-03-01"
4646
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
4747
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
4848
self._configure(**kwargs)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"chosen_version": "2021-03-01",
3+
"total_api_version_list": ["2021-03-01"],
4+
"client": {
5+
"name": "ResourceGraphClient",
6+
"filename": "_resource_graph_client",
7+
"description": "Azure Resource Graph API Reference.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": false,
12+
"client_side_validation": false
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
}
22+
},
23+
"async": {
24+
"credential": {
25+
"signature": "credential, # type: \"AsyncTokenCredential\"",
26+
"description": "Credential needed for the client to connect to Azure.",
27+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
28+
"required": true
29+
}
30+
},
31+
"constant": {
32+
},
33+
"call": "credential"
34+
},
35+
"config": {
36+
"credential": true,
37+
"credential_scopes": ["https://management.azure.com/.default"],
38+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
39+
"credential_default_policy_type_has_async_version": true,
40+
"credential_key_header_name": null
41+
},
42+
"operation_groups": {
43+
"operations": "Operations"
44+
},
45+
"operation_mixins": {
46+
"resources" : {
47+
"sync": {
48+
"signature": "def resources(\n self,\n query, # type: \"_models.QueryRequest\"\n **kwargs # type: Any\n):\n",
49+
"doc": "\"\"\"Queries the resources managed by Azure Resource Manager for scopes specified in the request.\n\n:param query: Request specifying query and its options.\n:type query: ~azure.mgmt.resourcegraph.models.QueryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: QueryResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.resourcegraph.models.QueryResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
50+
},
51+
"async": {
52+
"coroutine": true,
53+
"signature": "async def resources(\n self,\n query: \"_models.QueryRequest\",\n **kwargs\n) -\u003e \"_models.QueryResponse\":\n",
54+
"doc": "\"\"\"Queries the resources managed by Azure Resource Manager for scopes specified in the request.\n\n:param query: Request specifying query and its options.\n:type query: ~azure.mgmt.resourcegraph.models.QueryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: QueryResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.resourcegraph.models.QueryResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
55+
},
56+
"call": "query"
57+
}
58+
},
59+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
60+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}"
61+
}

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_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 = "7.0.0"
9+
VERSION = "8.0.0"

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(
3939
super(ResourceGraphClientConfiguration, self).__init__(**kwargs)
4040

4141
self.credential = credential
42-
self.api_version = "2020-04-01-preview"
42+
self.api_version = "2021-03-01"
4343
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
4444
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
4545
self._configure(**kwargs)

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_operations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def list(
5757
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
5858
}
5959
error_map.update(kwargs.pop('error_map', {}))
60-
api_version = "2020-04-01-preview"
60+
api_version = "2021-03-01"
6161
accept = "application/json"
6262

6363
def prepare_request(next_link=None):
@@ -93,8 +93,9 @@ async def get_next(next_link=None):
9393
response = pipeline_response.http_response
9494

9595
if response.status_code not in [200]:
96+
error = self._deserialize(_models.ErrorResponse, response)
9697
map_error(status_code=response.status_code, response=response, error_map=error_map)
97-
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
98+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
9899

99100
return pipeline_response
100101

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_resource_graph_client_operations.py

Lines changed: 2 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ async def resources(
2525
query: "_models.QueryRequest",
2626
**kwargs
2727
) -> "_models.QueryResponse":
28-
"""Queries the resources managed by Azure Resource Manager for all subscriptions specified in the
29-
request.
28+
"""Queries the resources managed by Azure Resource Manager for scopes specified in the request.
3029
3130
:param query: Request specifying query and its options.
3231
:type query: ~azure.mgmt.resourcegraph.models.QueryRequest
@@ -40,7 +39,7 @@ async def resources(
4039
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
4140
}
4241
error_map.update(kwargs.pop('error_map', {}))
43-
api_version = "2020-04-01-preview"
42+
api_version = "2021-03-01"
4443
content_type = kwargs.pop("content_type", "application/json")
4544
accept = "application/json"
4645

@@ -75,113 +74,3 @@ async def resources(
7574

7675
return deserialized
7776
resources.metadata = {'url': '/providers/Microsoft.ResourceGraph/resources'} # type: ignore
78-
79-
async def resource_changes(
80-
self,
81-
parameters: "_models.ResourceChangesRequestParameters",
82-
**kwargs
83-
) -> "_models.ResourceChangeList":
84-
"""List changes to a resource for a given time interval.
85-
86-
:param parameters: the parameters for this request for changes.
87-
:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParameters
88-
:keyword callable cls: A custom type or function that will be passed the direct response
89-
:return: ResourceChangeList, or the result of cls(response)
90-
:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeList
91-
:raises: ~azure.core.exceptions.HttpResponseError
92-
"""
93-
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceChangeList"]
94-
error_map = {
95-
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
96-
}
97-
error_map.update(kwargs.pop('error_map', {}))
98-
api_version = "2020-04-01-preview"
99-
content_type = kwargs.pop("content_type", "application/json")
100-
accept = "application/json"
101-
102-
# Construct URL
103-
url = self.resource_changes.metadata['url'] # type: ignore
104-
105-
# Construct parameters
106-
query_parameters = {} # type: Dict[str, Any]
107-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
108-
109-
# Construct headers
110-
header_parameters = {} # type: Dict[str, Any]
111-
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
112-
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
113-
114-
body_content_kwargs = {} # type: Dict[str, Any]
115-
body_content = self._serialize.body(parameters, 'ResourceChangesRequestParameters')
116-
body_content_kwargs['content'] = body_content
117-
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
118-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
119-
response = pipeline_response.http_response
120-
121-
if response.status_code not in [200]:
122-
map_error(status_code=response.status_code, response=response, error_map=error_map)
123-
error = self._deserialize(_models.ErrorResponse, response)
124-
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
125-
126-
deserialized = self._deserialize('ResourceChangeList', pipeline_response)
127-
128-
if cls:
129-
return cls(pipeline_response, deserialized, {})
130-
131-
return deserialized
132-
resource_changes.metadata = {'url': '/providers/Microsoft.ResourceGraph/resourceChanges'} # type: ignore
133-
134-
async def resource_change_details(
135-
self,
136-
parameters: "_models.ResourceChangeDetailsRequestParameters",
137-
**kwargs
138-
) -> "_models.ResourceChangeData":
139-
"""Get resource change details.
140-
141-
:param parameters: The parameters for this request for resource change details.
142-
:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangeDetailsRequestParameters
143-
:keyword callable cls: A custom type or function that will be passed the direct response
144-
:return: ResourceChangeData, or the result of cls(response)
145-
:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeData
146-
:raises: ~azure.core.exceptions.HttpResponseError
147-
"""
148-
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceChangeData"]
149-
error_map = {
150-
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
151-
}
152-
error_map.update(kwargs.pop('error_map', {}))
153-
api_version = "2020-04-01-preview"
154-
content_type = kwargs.pop("content_type", "application/json")
155-
accept = "application/json"
156-
157-
# Construct URL
158-
url = self.resource_change_details.metadata['url'] # type: ignore
159-
160-
# Construct parameters
161-
query_parameters = {} # type: Dict[str, Any]
162-
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
163-
164-
# Construct headers
165-
header_parameters = {} # type: Dict[str, Any]
166-
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
167-
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
168-
169-
body_content_kwargs = {} # type: Dict[str, Any]
170-
body_content = self._serialize.body(parameters, 'ResourceChangeDetailsRequestParameters')
171-
body_content_kwargs['content'] = body_content
172-
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
173-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
174-
response = pipeline_response.http_response
175-
176-
if response.status_code not in [200]:
177-
map_error(status_code=response.status_code, response=response, error_map=error_map)
178-
error = self._deserialize(_models.ErrorResponse, response)
179-
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
180-
181-
deserialized = self._deserialize('ResourceChangeData', pipeline_response)
182-
183-
if cls:
184-
return cls(pipeline_response, deserialized, {})
185-
186-
return deserialized
187-
resource_change_details.metadata = {'url': '/providers/Microsoft.ResourceGraph/resourceChangeDetails'} # type: ignore

sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/__init__.py

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

99
try:
1010
from ._models_py3 import Column
11-
from ._models_py3 import DateTimeInterval
1211
from ._models_py3 import Error
1312
from ._models_py3 import ErrorDetails
1413
from ._models_py3 import ErrorResponse
@@ -23,19 +22,9 @@
2322
from ._models_py3 import QueryRequest
2423
from ._models_py3 import QueryRequestOptions
2524
from ._models_py3 import QueryResponse
26-
from ._models_py3 import ResourceChangeData
27-
from ._models_py3 import ResourceChangeDataAfterSnapshot
28-
from ._models_py3 import ResourceChangeDataBeforeSnapshot
29-
from ._models_py3 import ResourceChangeDetailsRequestParameters
30-
from ._models_py3 import ResourceChangeList
31-
from ._models_py3 import ResourceChangesRequestParameters
32-
from ._models_py3 import ResourceChangesRequestParametersInterval
33-
from ._models_py3 import ResourcePropertyChange
34-
from ._models_py3 import ResourceSnapshotData
3525
from ._models_py3 import Table
3626
except (SyntaxError, ImportError):
3727
from ._models import Column # type: ignore
38-
from ._models import DateTimeInterval # type: ignore
3928
from ._models import Error # type: ignore
4029
from ._models import ErrorDetails # type: ignore
4130
from ._models import ErrorResponse # type: ignore
@@ -50,30 +39,17 @@
5039
from ._models import QueryRequest # type: ignore
5140
from ._models import QueryRequestOptions # type: ignore
5241
from ._models import QueryResponse # type: ignore
53-
from ._models import ResourceChangeData # type: ignore
54-
from ._models import ResourceChangeDataAfterSnapshot # type: ignore
55-
from ._models import ResourceChangeDataBeforeSnapshot # type: ignore
56-
from ._models import ResourceChangeDetailsRequestParameters # type: ignore
57-
from ._models import ResourceChangeList # type: ignore
58-
from ._models import ResourceChangesRequestParameters # type: ignore
59-
from ._models import ResourceChangesRequestParametersInterval # type: ignore
60-
from ._models import ResourcePropertyChange # type: ignore
61-
from ._models import ResourceSnapshotData # type: ignore
6242
from ._models import Table # type: ignore
6343

6444
from ._resource_graph_client_enums import (
65-
ChangeCategory,
66-
ChangeType,
6745
ColumnDataType,
6846
FacetSortOrder,
69-
PropertyChangeType,
7047
ResultFormat,
7148
ResultTruncated,
7249
)
7350

7451
__all__ = [
7552
'Column',
76-
'DateTimeInterval',
7753
'Error',
7854
'ErrorDetails',
7955
'ErrorResponse',
@@ -88,21 +64,9 @@
8864
'QueryRequest',
8965
'QueryRequestOptions',
9066
'QueryResponse',
91-
'ResourceChangeData',
92-
'ResourceChangeDataAfterSnapshot',
93-
'ResourceChangeDataBeforeSnapshot',
94-
'ResourceChangeDetailsRequestParameters',
95-
'ResourceChangeList',
96-
'ResourceChangesRequestParameters',
97-
'ResourceChangesRequestParametersInterval',
98-
'ResourcePropertyChange',
99-
'ResourceSnapshotData',
10067
'Table',
101-
'ChangeCategory',
102-
'ChangeType',
10368
'ColumnDataType',
10469
'FacetSortOrder',
105-
'PropertyChangeType',
10670
'ResultFormat',
10771
'ResultTruncated',
10872
]

0 commit comments

Comments
 (0)