Skip to content

Commit

Permalink
[AutoRelease] t2-resourcegraph-2021-03-31-51385 (Azure#17692)
Browse files Browse the repository at this point in the history
* CodeGen from PR 13715 in Azure/azure-rest-api-specs
resourcegraph readme t2 config (Azure#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]>
  • Loading branch information
3 people authored Apr 8, 2021
1 parent 8bda918 commit d34872c
Show file tree
Hide file tree
Showing 19 changed files with 158 additions and 1,097 deletions.
13 changes: 13 additions & 0 deletions sdk/resources/azure-mgmt-resourcegraph/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Release History

## 8.0.0 (2021-03-31)

**Features**

- Model QueryRequest has a new parameter management_groups
- Model QueryRequestOptions has a new parameter allow_partial_scopes

**Breaking changes**

- Model QueryRequest no longer has parameter management_group_id
- Removed operation ResourceGraphClientOperationsMixin.resource_changes
- Removed operation ResourceGraphClientOperationsMixin.resource_change_details

## 7.0.0 (2020-12-15)

- GA Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
super(ResourceGraphClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2020-04-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"client": {
"name": "ResourceGraphClient",
"filename": "_resource_graph_client",
"description": "Azure Resource Graph API Reference.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
}
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
}
},
"constant": {
},
"call": "credential"
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
},
"operation_groups": {
"operations": "Operations"
},
"operation_mixins": {
"resources" : {
"sync": {
"signature": "def resources(\n self,\n query, # type: \"_models.QueryRequest\"\n **kwargs # type: Any\n):\n",
"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\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def resources(\n self,\n query: \"_models.QueryRequest\",\n **kwargs\n) -\u003e \"_models.QueryResponse\":\n",
"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\"\"\""
},
"call": "query"
}
},
"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\"]}}}",
"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\"]}}}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
VERSION = "8.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
super(ResourceGraphClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2020-04-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01-preview"
api_version = "2021-03-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -93,8 +93,9 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ async def resources(
query: "_models.QueryRequest",
**kwargs
) -> "_models.QueryResponse":
"""Queries the resources managed by Azure Resource Manager for all subscriptions specified in the
request.
"""Queries the resources managed by Azure Resource Manager for scopes specified in the request.
:param query: Request specifying query and its options.
:type query: ~azure.mgmt.resourcegraph.models.QueryRequest
Expand All @@ -40,7 +39,7 @@ async def resources(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01-preview"
api_version = "2021-03-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -75,113 +74,3 @@ async def resources(

return deserialized
resources.metadata = {'url': '/providers/Microsoft.ResourceGraph/resources'} # type: ignore

async def resource_changes(
self,
parameters: "_models.ResourceChangesRequestParameters",
**kwargs
) -> "_models.ResourceChangeList":
"""List changes to a resource for a given time interval.
:param parameters: the parameters for this request for changes.
:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParameters
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceChangeList, or the result of cls(response)
:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeList
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceChangeList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

# Construct URL
url = self.resource_changes.metadata['url'] # type: ignore

# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ResourceChangesRequestParameters')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ResourceChangeList', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized
resource_changes.metadata = {'url': '/providers/Microsoft.ResourceGraph/resourceChanges'} # type: ignore

async def resource_change_details(
self,
parameters: "_models.ResourceChangeDetailsRequestParameters",
**kwargs
) -> "_models.ResourceChangeData":
"""Get resource change details.
:param parameters: The parameters for this request for resource change details.
:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangeDetailsRequestParameters
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceChangeData, or the result of cls(response)
:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeData
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceChangeData"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

# Construct URL
url = self.resource_change_details.metadata['url'] # type: ignore

# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ResourceChangeDetailsRequestParameters')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ResourceChangeData', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized
resource_change_details.metadata = {'url': '/providers/Microsoft.ResourceGraph/resourceChangeDetails'} # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

try:
from ._models_py3 import Column
from ._models_py3 import DateTimeInterval
from ._models_py3 import Error
from ._models_py3 import ErrorDetails
from ._models_py3 import ErrorResponse
Expand All @@ -23,19 +22,9 @@
from ._models_py3 import QueryRequest
from ._models_py3 import QueryRequestOptions
from ._models_py3 import QueryResponse
from ._models_py3 import ResourceChangeData
from ._models_py3 import ResourceChangeDataAfterSnapshot
from ._models_py3 import ResourceChangeDataBeforeSnapshot
from ._models_py3 import ResourceChangeDetailsRequestParameters
from ._models_py3 import ResourceChangeList
from ._models_py3 import ResourceChangesRequestParameters
from ._models_py3 import ResourceChangesRequestParametersInterval
from ._models_py3 import ResourcePropertyChange
from ._models_py3 import ResourceSnapshotData
from ._models_py3 import Table
except (SyntaxError, ImportError):
from ._models import Column # type: ignore
from ._models import DateTimeInterval # type: ignore
from ._models import Error # type: ignore
from ._models import ErrorDetails # type: ignore
from ._models import ErrorResponse # type: ignore
Expand All @@ -50,30 +39,17 @@
from ._models import QueryRequest # type: ignore
from ._models import QueryRequestOptions # type: ignore
from ._models import QueryResponse # type: ignore
from ._models import ResourceChangeData # type: ignore
from ._models import ResourceChangeDataAfterSnapshot # type: ignore
from ._models import ResourceChangeDataBeforeSnapshot # type: ignore
from ._models import ResourceChangeDetailsRequestParameters # type: ignore
from ._models import ResourceChangeList # type: ignore
from ._models import ResourceChangesRequestParameters # type: ignore
from ._models import ResourceChangesRequestParametersInterval # type: ignore
from ._models import ResourcePropertyChange # type: ignore
from ._models import ResourceSnapshotData # type: ignore
from ._models import Table # type: ignore

from ._resource_graph_client_enums import (
ChangeCategory,
ChangeType,
ColumnDataType,
FacetSortOrder,
PropertyChangeType,
ResultFormat,
ResultTruncated,
)

__all__ = [
'Column',
'DateTimeInterval',
'Error',
'ErrorDetails',
'ErrorResponse',
Expand All @@ -88,21 +64,9 @@
'QueryRequest',
'QueryRequestOptions',
'QueryResponse',
'ResourceChangeData',
'ResourceChangeDataAfterSnapshot',
'ResourceChangeDataBeforeSnapshot',
'ResourceChangeDetailsRequestParameters',
'ResourceChangeList',
'ResourceChangesRequestParameters',
'ResourceChangesRequestParametersInterval',
'ResourcePropertyChange',
'ResourceSnapshotData',
'Table',
'ChangeCategory',
'ChangeType',
'ColumnDataType',
'FacetSortOrder',
'PropertyChangeType',
'ResultFormat',
'ResultTruncated',
]
Loading

0 comments on commit d34872c

Please sign in to comment.