diff --git a/sdk/resources/azure-mgmt-resourcegraph/_meta.json b/sdk/resources/azure-mgmt-resourcegraph/_meta.json index 7f6c0233e380..ad0f4c992d61 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/_meta.json +++ b/sdk/resources/azure-mgmt-resourcegraph/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "a144e3b668c2712808ddf0025005cc13becad93a", + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "33d5b4f7ba9c79d64d954c7a4a6276a2d22c338b", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/resourcegraph/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.6.6 --version=3.3.0", + "autorest_command": "autorest specification/resourcegraph/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/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/resourcegraph/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py index b007839cb9db..de6e28209172 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py @@ -42,6 +42,7 @@ def __init__( super(ResourceGraphClientConfiguration, self).__init__(**kwargs) self.credential = credential + self.api_version = "2021-06-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json index d0d13f7972d3..2721d4f1c87b 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "", - "total_api_version_list": ["2020-04-01-preview", "2020-09-01-preview", "2021-03-01"], + "chosen_version": "2021-06-01-preview", + "total_api_version_list": ["2021-06-01-preview"], "client": { "name": "ResourceGraphClient", "filename": "_resource_graph_client", @@ -89,33 +89,9 @@ "operations": "Operations" }, "operation_mixins": { - "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\", \"List\", \"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\", \"List\", \"Optional\", \"TypeVar\"]}}}", + "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\"]}}}", "operations": { - "resource_changes" : { - "sync": { - "signature": "def resource_changes(\n self,\n parameters, # type: \"_models.ResourceChangesRequestParameters\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"List changes to a resource for a given time interval.\n\n:param parameters: the parameters for this request for changes.\n:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceChangeList, or the result of cls(response)\n:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeList\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def resource_changes(\n self,\n parameters: \"_models.ResourceChangesRequestParameters\",\n **kwargs\n) -\u003e \"_models.ResourceChangeList\":\n", - "doc": "\"\"\"List changes to a resource for a given time interval.\n\n:param parameters: the parameters for this request for changes.\n:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceChangeList, or the result of cls(response)\n:rtype: ~azure.mgmt.resourcegraph.models.ResourceChangeList\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "parameters" - }, - "resource_change_details" : { - "sync": { - "signature": "def resource_change_details(\n self,\n parameters, # type: \"_models.ResourceChangeDetailsRequestParameters\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Get resource change details.\n\n:param parameters: The parameters for this request for resource change details.\n:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangeDetailsRequestParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: list of ResourceChangeData, or the result of cls(response)\n:rtype: list[~azure.mgmt.resourcegraph.models.ResourceChangeData]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def resource_change_details(\n self,\n parameters: \"_models.ResourceChangeDetailsRequestParameters\",\n **kwargs\n) -\u003e List[\"_models.ResourceChangeData\"]:\n", - "doc": "\"\"\"Get resource change details.\n\n:param parameters: The parameters for this request for resource change details.\n:type parameters: ~azure.mgmt.resourcegraph.models.ResourceChangeDetailsRequestParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: list of ResourceChangeData, or the result of cls(response)\n:rtype: list[~azure.mgmt.resourcegraph.models.ResourceChangeData]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "parameters" - }, "resources" : { "sync": { "signature": "def resources(\n self,\n query, # type: \"_models.QueryRequest\"\n **kwargs # type: Any\n):\n", @@ -123,7 +99,7 @@ }, "async": { "coroutine": true, - "signature": "async def resources(\n self,\n query: \"_models.QueryRequest\",\n **kwargs\n) -\u003e \"_models.QueryResponse\":\n", + "signature": "async def resources(\n self,\n query: \"_models.QueryRequest\",\n **kwargs: Any\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" @@ -131,12 +107,12 @@ "resources_history" : { "sync": { "signature": "def resources_history(\n self,\n request, # type: \"_models.ResourcesHistoryRequest\"\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"List all snapshots of a resource for a given time interval.\n\n:param request:\n:type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: object, or the result of cls(response)\n:rtype: object\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"List all snapshots of a resource for a given time interval.\n\n:param request: Request specifying the query and its options.\n:type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: any, or the result of cls(response)\n:rtype: any\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def resources_history(\n self,\n request: \"_models.ResourcesHistoryRequest\",\n **kwargs\n) -\u003e object:\n", - "doc": "\"\"\"List all snapshots of a resource for a given time interval.\n\n:param request:\n:type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: object, or the result of cls(response)\n:rtype: object\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "signature": "async def resources_history(\n self,\n request: \"_models.ResourcesHistoryRequest\",\n **kwargs: Any\n) -\u003e Any:\n", + "doc": "\"\"\"List all snapshots of a resource for a given time interval.\n\n:param request: Request specifying the query and its options.\n:type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: any, or the result of cls(response)\n:rtype: any\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "request" } diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_version.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_version.py index aa6530bfe9d9..c47f66669f1b 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_version.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.1.0b1" +VERSION = "1.0.0" diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/_configuration.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/_configuration.py index 62fe1a2d0829..9cfd076d65f3 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/_configuration.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/_configuration.py @@ -39,6 +39,7 @@ def __init__( super(ResourceGraphClientConfiguration, self).__init__(**kwargs) self.credential = credential + self.api_version = "2021-06-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_operations.py index eb1abdc9219a..fc91a4909a15 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available REST API operations. @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-06-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_resource_graph_client_operations.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_resource_graph_client_operations.py index 4a5f9c37108f..d5b70b9f5f34 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_resource_graph_client_operations.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/aio/operations/_resource_graph_client_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -20,120 +20,10 @@ class ResourceGraphClientOperationsMixin: - 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-09-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.failsafe_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 - ) -> List["_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: list of ResourceChangeData, or the result of cls(response) - :rtype: list[~azure.mgmt.resourcegraph.models.ResourceChangeData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ResourceChangeData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-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.failsafe_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 - async def resources( self, query: "_models.QueryRequest", - **kwargs + **kwargs: Any ) -> "_models.QueryResponse": """Queries the resources managed by Azure Resource Manager for scopes specified in the request. @@ -149,7 +39,7 @@ async def resources( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-06-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -188,23 +78,23 @@ async def resources( async def resources_history( self, request: "_models.ResourcesHistoryRequest", - **kwargs - ) -> object: + **kwargs: Any + ) -> Any: """List all snapshots of a resource for a given time interval. - :param request: + :param request: Request specifying the query and its options. :type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object + :return: any, or the result of cls(response) + :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[object] + cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01-preview" + api_version = "2021-06-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/__init__.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/__init__.py index feaa061b61d8..61f4bd0ab34f 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/__init__.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/__init__.py @@ -23,15 +23,6 @@ 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 ResourcesHistoryRequest from ._models_py3 import ResourcesHistoryRequestOptions from ._models_py3 import Table @@ -52,26 +43,14 @@ 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 ResourcesHistoryRequest # type: ignore from ._models import ResourcesHistoryRequestOptions # type: ignore from ._models import Table # type: ignore from ._resource_graph_client_enums import ( - ChangeCategory, - ChangeType, + AuthorizationScopeFilter, ColumnDataType, FacetSortOrder, - PropertyChangeType, - ResourcesHistoryRequestOptionsResultFormat, ResultFormat, ResultTruncated, ) @@ -93,24 +72,12 @@ 'QueryRequest', 'QueryRequestOptions', 'QueryResponse', - 'ResourceChangeData', - 'ResourceChangeDataAfterSnapshot', - 'ResourceChangeDataBeforeSnapshot', - 'ResourceChangeDetailsRequestParameters', - 'ResourceChangeList', - 'ResourceChangesRequestParameters', - 'ResourceChangesRequestParametersInterval', - 'ResourcePropertyChange', - 'ResourceSnapshotData', 'ResourcesHistoryRequest', 'ResourcesHistoryRequestOptions', 'Table', - 'ChangeCategory', - 'ChangeType', + 'AuthorizationScopeFilter', 'ColumnDataType', 'FacetSortOrder', - 'PropertyChangeType', - 'ResourcesHistoryRequestOptionsResultFormat', 'ResultFormat', 'ResultTruncated', ] diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models.py index cb5487b123f2..bbb2eae031e0 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models.py @@ -18,7 +18,7 @@ class Column(msrest.serialization.Model): :param name: Required. Column name. :type name: str :param type: Required. Column data type. Possible values include: "string", "integer", - "number", "boolean", "object". + "number", "boolean", "object", "datetime". :type type: str or ~azure.mgmt.resourcegraph.models.ColumnDataType """ @@ -116,7 +116,7 @@ class ErrorDetails(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param code: Required. Error code identifying the specific error. :type code: str :param message: Required. A human readable error message. @@ -322,7 +322,7 @@ class FacetResult(Facet): :type count: int :param data: Required. A JObject array or Table containing the desired facets. Only present if the facet is valid. - :type data: object + :type data: any """ _validation = { @@ -485,12 +485,18 @@ class QueryRequestOptions(msrest.serialization.Model): page offset when ``$skipToken`` property is present. :type skip: int :param result_format: Defines in which format query result returned. Possible values include: - "table", "objectArray". Default value: "objectArray". + "table", "objectArray". :type result_format: str or ~azure.mgmt.resourcegraph.models.ResultFormat :param allow_partial_scopes: Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits. :type allow_partial_scopes: bool + :param authorization_scope_filter: Defines what level of authorization resources should be + returned based on the which subscriptions and management groups are passed as scopes. Possible + values include: "AtScopeAndBelow", "AtScopeAndAbove", "AtScopeExact", "AtScopeAboveAndBelow". + Default value: "AtScopeAndBelow". + :type authorization_scope_filter: str or + ~azure.mgmt.resourcegraph.models.AuthorizationScopeFilter """ _validation = { @@ -504,6 +510,7 @@ class QueryRequestOptions(msrest.serialization.Model): 'skip': {'key': '$skip', 'type': 'int'}, 'result_format': {'key': 'resultFormat', 'type': 'str'}, 'allow_partial_scopes': {'key': 'allowPartialScopes', 'type': 'bool'}, + 'authorization_scope_filter': {'key': 'authorizationScopeFilter', 'type': 'str'}, } def __init__( @@ -514,8 +521,9 @@ def __init__( self.skip_token = kwargs.get('skip_token', None) self.top = kwargs.get('top', None) self.skip = kwargs.get('skip', None) - self.result_format = kwargs.get('result_format', "objectArray") + self.result_format = kwargs.get('result_format', None) self.allow_partial_scopes = kwargs.get('allow_partial_scopes', False) + self.authorization_scope_filter = kwargs.get('authorization_scope_filter', "AtScopeAndBelow") class QueryResponse(msrest.serialization.Model): @@ -535,7 +543,7 @@ class QueryResponse(msrest.serialization.Model): with the same query and scopes used in the current request) to retrieve the next page of data. :type skip_token: str :param data: Required. Query output in JObject array or Table format. - :type data: object + :type data: any :param facets: Query facets. :type facets: list[~azure.mgmt.resourcegraph.models.Facet] """ @@ -569,369 +577,25 @@ def __init__( self.facets = kwargs.get('facets', None) -class ResourceChangeData(msrest.serialization.Model): - """Data on a specific change, represented by a pair of before and after resource snapshots. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource for a change. - :type resource_id: str - :param change_id: Required. The change ID. Valid and unique within the specified resource only. - :type change_id: str - :param before_snapshot: Required. The snapshot before the change. - :type before_snapshot: ~azure.mgmt.resourcegraph.models.ResourceChangeDataBeforeSnapshot - :param after_snapshot: Required. The snapshot after the change. - :type after_snapshot: ~azure.mgmt.resourcegraph.models.ResourceChangeDataAfterSnapshot - :param change_type: The change type for snapshot. PropertyChanges will be provided in case of - Update change type. Possible values include: "Create", "Update", "Delete". - :type change_type: str or ~azure.mgmt.resourcegraph.models.ChangeType - :param property_changes: An array of resource property change. - :type property_changes: list[~azure.mgmt.resourcegraph.models.ResourcePropertyChange] - """ - - _validation = { - 'change_id': {'required': True}, - 'before_snapshot': {'required': True}, - 'after_snapshot': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'change_id': {'key': 'changeId', 'type': 'str'}, - 'before_snapshot': {'key': 'beforeSnapshot', 'type': 'ResourceChangeDataBeforeSnapshot'}, - 'after_snapshot': {'key': 'afterSnapshot', 'type': 'ResourceChangeDataAfterSnapshot'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'property_changes': {'key': 'propertyChanges', 'type': '[ResourcePropertyChange]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeData, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.change_id = kwargs['change_id'] - self.before_snapshot = kwargs['before_snapshot'] - self.after_snapshot = kwargs['after_snapshot'] - self.change_type = kwargs.get('change_type', None) - self.property_changes = kwargs.get('property_changes', None) - - -class ResourceSnapshotData(msrest.serialization.Model): - """Data on a specific resource snapshot. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSnapshotData, self).__init__(**kwargs) - self.snapshot_id = kwargs.get('snapshot_id', None) - self.timestamp = kwargs['timestamp'] - self.content = kwargs.get('content', None) - - -class ResourceChangeDataAfterSnapshot(ResourceSnapshotData): - """The snapshot after the change. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeDataAfterSnapshot, self).__init__(**kwargs) - - -class ResourceChangeDataBeforeSnapshot(ResourceSnapshotData): - """The snapshot before the change. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeDataBeforeSnapshot, self).__init__(**kwargs) - - -class ResourceChangeDetailsRequestParameters(msrest.serialization.Model): - """The parameters for a specific change details request. - - All required parameters must be populated in order to send to Azure. - - :param resource_ids: Required. Specifies the list of resources for a change details request. - :type resource_ids: list[str] - :param change_ids: Required. Specifies the list of change IDs for a change details request. - :type change_ids: list[str] - """ - - _validation = { - 'resource_ids': {'required': True}, - 'change_ids': {'required': True}, - } - - _attribute_map = { - 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, - 'change_ids': {'key': 'changeIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeDetailsRequestParameters, self).__init__(**kwargs) - self.resource_ids = kwargs['resource_ids'] - self.change_ids = kwargs['change_ids'] - - -class ResourceChangeList(msrest.serialization.Model): - """A list of changes associated with a resource over a specific time interval. - - :param changes: The pageable value returned by the operation, i.e. a list of changes to the - resource. - - - * The list is ordered from the most recent changes to the least recent changes. - * This list will be empty if there were no changes during the requested interval. - * The ``Before`` snapshot timestamp value of the oldest change can be outside of the specified - time interval. - :type changes: list[~azure.mgmt.resourcegraph.models.ResourceChangeData] - :param skip_token: Skip token that encodes the skip information while executing the current - request. - :type skip_token: object - """ - - _attribute_map = { - 'changes': {'key': 'changes', 'type': '[ResourceChangeData]'}, - 'skip_token': {'key': '$skipToken', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeList, self).__init__(**kwargs) - self.changes = kwargs.get('changes', None) - self.skip_token = kwargs.get('skip_token', None) - - -class ResourceChangesRequestParameters(msrest.serialization.Model): - """The parameters for a specific changes request. - - All required parameters must be populated in order to send to Azure. - - :param resource_ids: Specifies the list of resources for a changes request. - :type resource_ids: list[str] - :param subscription_id: The subscription id of resources to query the changes from. - :type subscription_id: str - :param interval: Required. Specifies the date and time interval for a changes request. - :type interval: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParametersInterval - :param skip_token: Acts as the continuation token for paged responses. - :type skip_token: str - :param top: The maximum number of changes the client can accept in a paged response. - :type top: int - :param table: The table name to query resources from. - :type table: str - :param fetch_property_changes: The flag if set to true will fetch property changes. - :type fetch_property_changes: bool - :param fetch_snapshots: The flag if set to true will fetch change snapshots. - :type fetch_snapshots: bool - """ - - _validation = { - 'interval': {'required': True}, - 'top': {'maximum': 1000, 'minimum': 1}, - } - - _attribute_map = { - 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'ResourceChangesRequestParametersInterval'}, - 'skip_token': {'key': '$skipToken', 'type': 'str'}, - 'top': {'key': '$top', 'type': 'int'}, - 'table': {'key': 'table', 'type': 'str'}, - 'fetch_property_changes': {'key': 'fetchPropertyChanges', 'type': 'bool'}, - 'fetch_snapshots': {'key': 'fetchSnapshots', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangesRequestParameters, self).__init__(**kwargs) - self.resource_ids = kwargs.get('resource_ids', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.interval = kwargs['interval'] - self.skip_token = kwargs.get('skip_token', None) - self.top = kwargs.get('top', None) - self.table = kwargs.get('table', None) - self.fetch_property_changes = kwargs.get('fetch_property_changes', None) - self.fetch_snapshots = kwargs.get('fetch_snapshots', None) - - -class ResourceChangesRequestParametersInterval(DateTimeInterval): - """Specifies the date and time interval for a changes request. - - All required parameters must be populated in order to send to Azure. - - :param start: Required. A datetime indicating the inclusive/closed start of the time interval, - i.e. ``[``\ **\ ``start``\ **\ ``, end)``. Specifying a ``start`` that occurs chronologically - after ``end`` will result in an error. - :type start: ~datetime.datetime - :param end: Required. A datetime indicating the exclusive/open end of the time interval, i.e. - ``[start,``\ **\ ``end``\ **\ ``)``. Specifying an ``end`` that occurs chronologically before - ``start`` will result in an error. - :type end: ~datetime.datetime - """ - - _validation = { - 'start': {'required': True}, - 'end': {'required': True}, - } - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangesRequestParametersInterval, self).__init__(**kwargs) - - -class ResourcePropertyChange(msrest.serialization.Model): - """The resource property change. - - All required parameters must be populated in order to send to Azure. - - :param property_name: Required. The property name. - :type property_name: str - :param before_value: The property value in before snapshot. - :type before_value: str - :param after_value: The property value in after snapshot. - :type after_value: str - :param change_category: Required. The change category. Possible values include: "User", - "System". - :type change_category: str or ~azure.mgmt.resourcegraph.models.ChangeCategory - :param property_change_type: Required. The property change Type. Possible values include: - "Insert", "Update", "Remove". - :type property_change_type: str or ~azure.mgmt.resourcegraph.models.PropertyChangeType - """ - - _validation = { - 'property_name': {'required': True}, - 'change_category': {'required': True}, - 'property_change_type': {'required': True}, - } - - _attribute_map = { - 'property_name': {'key': 'propertyName', 'type': 'str'}, - 'before_value': {'key': 'beforeValue', 'type': 'str'}, - 'after_value': {'key': 'afterValue', 'type': 'str'}, - 'change_category': {'key': 'changeCategory', 'type': 'str'}, - 'property_change_type': {'key': 'propertyChangeType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourcePropertyChange, self).__init__(**kwargs) - self.property_name = kwargs['property_name'] - self.before_value = kwargs.get('before_value', None) - self.after_value = kwargs.get('after_value', None) - self.change_category = kwargs['change_category'] - self.property_change_type = kwargs['property_change_type'] - - class ResourcesHistoryRequest(msrest.serialization.Model): - """ResourcesHistoryRequest. + """Describes a history request to be executed. - :param subscriptions: + :param subscriptions: Azure subscriptions against which to execute the query. :type subscriptions: list[str] - :param query: + :param query: The resources query. :type query: str - :param options: + :param options: The history request evaluation options. :type options: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequestOptions - :param management_group_id: - :type management_group_id: str + :param management_groups: Azure management groups against which to execute the query. Example: + [ 'mg1', 'mg2' ]. + :type management_groups: list[str] """ _attribute_map = { 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, 'query': {'key': 'query', 'type': 'str'}, 'options': {'key': 'options', 'type': 'ResourcesHistoryRequestOptions'}, - 'management_group_id': {'key': 'managementGroupId', 'type': 'str'}, + 'management_groups': {'key': 'managementGroups', 'type': '[str]'}, } def __init__( @@ -942,26 +606,33 @@ def __init__( self.subscriptions = kwargs.get('subscriptions', None) self.query = kwargs.get('query', None) self.options = kwargs.get('options', None) - self.management_group_id = kwargs.get('management_group_id', None) + self.management_groups = kwargs.get('management_groups', None) class ResourcesHistoryRequestOptions(msrest.serialization.Model): - """ResourcesHistoryRequestOptions. + """The options for history request evaluation. - :param interval: An interval in time specifying the date and time for the inclusive start and - exclusive end, i.e. ``[start, end)``. + :param interval: The time interval used to fetch history. :type interval: ~azure.mgmt.resourcegraph.models.DateTimeInterval - :param top: + :param top: The maximum number of rows that the query should return. Overrides the page size + when ``$skipToken`` property is present. :type top: int - :param skip: + :param skip: The number of rows to skip from the beginning of the results. Overrides the next + page offset when ``$skipToken`` property is present. :type skip: int - :param skip_token: + :param skip_token: Continuation token for pagination, capturing the next page size and offset, + as well as the context of the query. :type skip_token: str - :param result_format: Possible values include: "table", "objectArray". - :type result_format: str or - ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequestOptionsResultFormat + :param result_format: Defines in which format query result returned. Possible values include: + "table", "objectArray". + :type result_format: str or ~azure.mgmt.resourcegraph.models.ResultFormat """ + _validation = { + 'top': {'maximum': 1000, 'minimum': 1}, + 'skip': {'minimum': 0}, + } + _attribute_map = { 'interval': {'key': 'interval', 'type': 'DateTimeInterval'}, 'top': {'key': '$top', 'type': 'int'}, @@ -990,7 +661,7 @@ class Table(msrest.serialization.Model): :param columns: Required. Query result column descriptors. :type columns: list[~azure.mgmt.resourcegraph.models.Column] :param rows: Required. Query result rows. - :type rows: list[list[object]] + :type rows: list[list[any]] """ _validation = { diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models_py3.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models_py3.py index 7d12bd774827..6ae6f407b4d7 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -23,7 +23,7 @@ class Column(msrest.serialization.Model): :param name: Required. Column name. :type name: str :param type: Required. Column data type. Possible values include: "string", "integer", - "number", "boolean", "object". + "number", "boolean", "object", "datetime". :type type: str or ~azure.mgmt.resourcegraph.models.ColumnDataType """ @@ -131,7 +131,7 @@ class ErrorDetails(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param code: Required. Error code identifying the specific error. :type code: str :param message: Required. A human readable error message. @@ -154,7 +154,7 @@ def __init__( *, code: str, message: str, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, **kwargs ): super(ErrorDetails, self).__init__(**kwargs) @@ -356,7 +356,7 @@ class FacetResult(Facet): :type count: int :param data: Required. A JObject array or Table containing the desired facets. Only present if the facet is valid. - :type data: object + :type data: any """ _validation = { @@ -381,7 +381,7 @@ def __init__( expression: str, total_records: int, count: int, - data: object, + data: Any, **kwargs ): super(FacetResult, self).__init__(expression=expression, **kwargs) @@ -541,12 +541,18 @@ class QueryRequestOptions(msrest.serialization.Model): page offset when ``$skipToken`` property is present. :type skip: int :param result_format: Defines in which format query result returned. Possible values include: - "table", "objectArray". Default value: "objectArray". + "table", "objectArray". :type result_format: str or ~azure.mgmt.resourcegraph.models.ResultFormat :param allow_partial_scopes: Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits. :type allow_partial_scopes: bool + :param authorization_scope_filter: Defines what level of authorization resources should be + returned based on the which subscriptions and management groups are passed as scopes. Possible + values include: "AtScopeAndBelow", "AtScopeAndAbove", "AtScopeExact", "AtScopeAboveAndBelow". + Default value: "AtScopeAndBelow". + :type authorization_scope_filter: str or + ~azure.mgmt.resourcegraph.models.AuthorizationScopeFilter """ _validation = { @@ -560,6 +566,7 @@ class QueryRequestOptions(msrest.serialization.Model): 'skip': {'key': '$skip', 'type': 'int'}, 'result_format': {'key': 'resultFormat', 'type': 'str'}, 'allow_partial_scopes': {'key': 'allowPartialScopes', 'type': 'bool'}, + 'authorization_scope_filter': {'key': 'authorizationScopeFilter', 'type': 'str'}, } def __init__( @@ -568,8 +575,9 @@ def __init__( skip_token: Optional[str] = None, top: Optional[int] = None, skip: Optional[int] = None, - result_format: Optional[Union[str, "ResultFormat"]] = "objectArray", + result_format: Optional[Union[str, "ResultFormat"]] = None, allow_partial_scopes: Optional[bool] = False, + authorization_scope_filter: Optional[Union[str, "AuthorizationScopeFilter"]] = "AtScopeAndBelow", **kwargs ): super(QueryRequestOptions, self).__init__(**kwargs) @@ -578,6 +586,7 @@ def __init__( self.skip = skip self.result_format = result_format self.allow_partial_scopes = allow_partial_scopes + self.authorization_scope_filter = authorization_scope_filter class QueryResponse(msrest.serialization.Model): @@ -597,7 +606,7 @@ class QueryResponse(msrest.serialization.Model): with the same query and scopes used in the current request) to retrieve the next page of data. :type skip_token: str :param data: Required. Query output in JObject array or Table format. - :type data: object + :type data: any :param facets: Query facets. :type facets: list[~azure.mgmt.resourcegraph.models.Facet] """ @@ -624,7 +633,7 @@ def __init__( total_records: int, count: int, result_truncated: Union[str, "ResultTruncated"], - data: object, + data: Any, skip_token: Optional[str] = None, facets: Optional[List["Facet"]] = None, **kwargs @@ -638,412 +647,25 @@ def __init__( self.facets = facets -class ResourceChangeData(msrest.serialization.Model): - """Data on a specific change, represented by a pair of before and after resource snapshots. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource for a change. - :type resource_id: str - :param change_id: Required. The change ID. Valid and unique within the specified resource only. - :type change_id: str - :param before_snapshot: Required. The snapshot before the change. - :type before_snapshot: ~azure.mgmt.resourcegraph.models.ResourceChangeDataBeforeSnapshot - :param after_snapshot: Required. The snapshot after the change. - :type after_snapshot: ~azure.mgmt.resourcegraph.models.ResourceChangeDataAfterSnapshot - :param change_type: The change type for snapshot. PropertyChanges will be provided in case of - Update change type. Possible values include: "Create", "Update", "Delete". - :type change_type: str or ~azure.mgmt.resourcegraph.models.ChangeType - :param property_changes: An array of resource property change. - :type property_changes: list[~azure.mgmt.resourcegraph.models.ResourcePropertyChange] - """ - - _validation = { - 'change_id': {'required': True}, - 'before_snapshot': {'required': True}, - 'after_snapshot': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'change_id': {'key': 'changeId', 'type': 'str'}, - 'before_snapshot': {'key': 'beforeSnapshot', 'type': 'ResourceChangeDataBeforeSnapshot'}, - 'after_snapshot': {'key': 'afterSnapshot', 'type': 'ResourceChangeDataAfterSnapshot'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'property_changes': {'key': 'propertyChanges', 'type': '[ResourcePropertyChange]'}, - } - - def __init__( - self, - *, - change_id: str, - before_snapshot: "ResourceChangeDataBeforeSnapshot", - after_snapshot: "ResourceChangeDataAfterSnapshot", - resource_id: Optional[str] = None, - change_type: Optional[Union[str, "ChangeType"]] = None, - property_changes: Optional[List["ResourcePropertyChange"]] = None, - **kwargs - ): - super(ResourceChangeData, self).__init__(**kwargs) - self.resource_id = resource_id - self.change_id = change_id - self.before_snapshot = before_snapshot - self.after_snapshot = after_snapshot - self.change_type = change_type - self.property_changes = property_changes - - -class ResourceSnapshotData(msrest.serialization.Model): - """Data on a specific resource snapshot. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - snapshot_id: Optional[str] = None, - content: Optional[object] = None, - **kwargs - ): - super(ResourceSnapshotData, self).__init__(**kwargs) - self.snapshot_id = snapshot_id - self.timestamp = timestamp - self.content = content - - -class ResourceChangeDataAfterSnapshot(ResourceSnapshotData): - """The snapshot after the change. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - snapshot_id: Optional[str] = None, - content: Optional[object] = None, - **kwargs - ): - super(ResourceChangeDataAfterSnapshot, self).__init__(snapshot_id=snapshot_id, timestamp=timestamp, content=content, **kwargs) - - -class ResourceChangeDataBeforeSnapshot(ResourceSnapshotData): - """The snapshot before the change. - - All required parameters must be populated in order to send to Azure. - - :param snapshot_id: The ID of the snapshot. - :type snapshot_id: str - :param timestamp: Required. The time when the snapshot was created. - The snapshot timestamp provides an approximation as to when a modification to a resource was - detected. There can be a difference between the actual modification time and the detection - time. This is due to differences in how operations that modify a resource are processed, - versus how operation that record resource snapshots are processed. - :type timestamp: ~datetime.datetime - :param content: The resource snapshot content (in resourceChangeDetails response only). - :type content: object - """ - - _validation = { - 'timestamp': {'required': True}, - } - - _attribute_map = { - 'snapshot_id': {'key': 'snapshotId', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - snapshot_id: Optional[str] = None, - content: Optional[object] = None, - **kwargs - ): - super(ResourceChangeDataBeforeSnapshot, self).__init__(snapshot_id=snapshot_id, timestamp=timestamp, content=content, **kwargs) - - -class ResourceChangeDetailsRequestParameters(msrest.serialization.Model): - """The parameters for a specific change details request. - - All required parameters must be populated in order to send to Azure. - - :param resource_ids: Required. Specifies the list of resources for a change details request. - :type resource_ids: list[str] - :param change_ids: Required. Specifies the list of change IDs for a change details request. - :type change_ids: list[str] - """ - - _validation = { - 'resource_ids': {'required': True}, - 'change_ids': {'required': True}, - } - - _attribute_map = { - 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, - 'change_ids': {'key': 'changeIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - resource_ids: List[str], - change_ids: List[str], - **kwargs - ): - super(ResourceChangeDetailsRequestParameters, self).__init__(**kwargs) - self.resource_ids = resource_ids - self.change_ids = change_ids - - -class ResourceChangeList(msrest.serialization.Model): - """A list of changes associated with a resource over a specific time interval. - - :param changes: The pageable value returned by the operation, i.e. a list of changes to the - resource. - - - * The list is ordered from the most recent changes to the least recent changes. - * This list will be empty if there were no changes during the requested interval. - * The ``Before`` snapshot timestamp value of the oldest change can be outside of the specified - time interval. - :type changes: list[~azure.mgmt.resourcegraph.models.ResourceChangeData] - :param skip_token: Skip token that encodes the skip information while executing the current - request. - :type skip_token: object - """ - - _attribute_map = { - 'changes': {'key': 'changes', 'type': '[ResourceChangeData]'}, - 'skip_token': {'key': '$skipToken', 'type': 'object'}, - } - - def __init__( - self, - *, - changes: Optional[List["ResourceChangeData"]] = None, - skip_token: Optional[object] = None, - **kwargs - ): - super(ResourceChangeList, self).__init__(**kwargs) - self.changes = changes - self.skip_token = skip_token - - -class ResourceChangesRequestParameters(msrest.serialization.Model): - """The parameters for a specific changes request. - - All required parameters must be populated in order to send to Azure. - - :param resource_ids: Specifies the list of resources for a changes request. - :type resource_ids: list[str] - :param subscription_id: The subscription id of resources to query the changes from. - :type subscription_id: str - :param interval: Required. Specifies the date and time interval for a changes request. - :type interval: ~azure.mgmt.resourcegraph.models.ResourceChangesRequestParametersInterval - :param skip_token: Acts as the continuation token for paged responses. - :type skip_token: str - :param top: The maximum number of changes the client can accept in a paged response. - :type top: int - :param table: The table name to query resources from. - :type table: str - :param fetch_property_changes: The flag if set to true will fetch property changes. - :type fetch_property_changes: bool - :param fetch_snapshots: The flag if set to true will fetch change snapshots. - :type fetch_snapshots: bool - """ - - _validation = { - 'interval': {'required': True}, - 'top': {'maximum': 1000, 'minimum': 1}, - } - - _attribute_map = { - 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'ResourceChangesRequestParametersInterval'}, - 'skip_token': {'key': '$skipToken', 'type': 'str'}, - 'top': {'key': '$top', 'type': 'int'}, - 'table': {'key': 'table', 'type': 'str'}, - 'fetch_property_changes': {'key': 'fetchPropertyChanges', 'type': 'bool'}, - 'fetch_snapshots': {'key': 'fetchSnapshots', 'type': 'bool'}, - } - - def __init__( - self, - *, - interval: "ResourceChangesRequestParametersInterval", - resource_ids: Optional[List[str]] = None, - subscription_id: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - table: Optional[str] = None, - fetch_property_changes: Optional[bool] = None, - fetch_snapshots: Optional[bool] = None, - **kwargs - ): - super(ResourceChangesRequestParameters, self).__init__(**kwargs) - self.resource_ids = resource_ids - self.subscription_id = subscription_id - self.interval = interval - self.skip_token = skip_token - self.top = top - self.table = table - self.fetch_property_changes = fetch_property_changes - self.fetch_snapshots = fetch_snapshots - - -class ResourceChangesRequestParametersInterval(DateTimeInterval): - """Specifies the date and time interval for a changes request. - - All required parameters must be populated in order to send to Azure. - - :param start: Required. A datetime indicating the inclusive/closed start of the time interval, - i.e. ``[``\ **\ ``start``\ **\ ``, end)``. Specifying a ``start`` that occurs chronologically - after ``end`` will result in an error. - :type start: ~datetime.datetime - :param end: Required. A datetime indicating the exclusive/open end of the time interval, i.e. - ``[start,``\ **\ ``end``\ **\ ``)``. Specifying an ``end`` that occurs chronologically before - ``start`` will result in an error. - :type end: ~datetime.datetime - """ - - _validation = { - 'start': {'required': True}, - 'end': {'required': True}, - } - - _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - start: datetime.datetime, - end: datetime.datetime, - **kwargs - ): - super(ResourceChangesRequestParametersInterval, self).__init__(start=start, end=end, **kwargs) - - -class ResourcePropertyChange(msrest.serialization.Model): - """The resource property change. - - All required parameters must be populated in order to send to Azure. - - :param property_name: Required. The property name. - :type property_name: str - :param before_value: The property value in before snapshot. - :type before_value: str - :param after_value: The property value in after snapshot. - :type after_value: str - :param change_category: Required. The change category. Possible values include: "User", - "System". - :type change_category: str or ~azure.mgmt.resourcegraph.models.ChangeCategory - :param property_change_type: Required. The property change Type. Possible values include: - "Insert", "Update", "Remove". - :type property_change_type: str or ~azure.mgmt.resourcegraph.models.PropertyChangeType - """ - - _validation = { - 'property_name': {'required': True}, - 'change_category': {'required': True}, - 'property_change_type': {'required': True}, - } - - _attribute_map = { - 'property_name': {'key': 'propertyName', 'type': 'str'}, - 'before_value': {'key': 'beforeValue', 'type': 'str'}, - 'after_value': {'key': 'afterValue', 'type': 'str'}, - 'change_category': {'key': 'changeCategory', 'type': 'str'}, - 'property_change_type': {'key': 'propertyChangeType', 'type': 'str'}, - } - - def __init__( - self, - *, - property_name: str, - change_category: Union[str, "ChangeCategory"], - property_change_type: Union[str, "PropertyChangeType"], - before_value: Optional[str] = None, - after_value: Optional[str] = None, - **kwargs - ): - super(ResourcePropertyChange, self).__init__(**kwargs) - self.property_name = property_name - self.before_value = before_value - self.after_value = after_value - self.change_category = change_category - self.property_change_type = property_change_type - - class ResourcesHistoryRequest(msrest.serialization.Model): - """ResourcesHistoryRequest. + """Describes a history request to be executed. - :param subscriptions: + :param subscriptions: Azure subscriptions against which to execute the query. :type subscriptions: list[str] - :param query: + :param query: The resources query. :type query: str - :param options: + :param options: The history request evaluation options. :type options: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequestOptions - :param management_group_id: - :type management_group_id: str + :param management_groups: Azure management groups against which to execute the query. Example: + [ 'mg1', 'mg2' ]. + :type management_groups: list[str] """ _attribute_map = { 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, 'query': {'key': 'query', 'type': 'str'}, 'options': {'key': 'options', 'type': 'ResourcesHistoryRequestOptions'}, - 'management_group_id': {'key': 'managementGroupId', 'type': 'str'}, + 'management_groups': {'key': 'managementGroups', 'type': '[str]'}, } def __init__( @@ -1052,33 +674,40 @@ def __init__( subscriptions: Optional[List[str]] = None, query: Optional[str] = None, options: Optional["ResourcesHistoryRequestOptions"] = None, - management_group_id: Optional[str] = None, + management_groups: Optional[List[str]] = None, **kwargs ): super(ResourcesHistoryRequest, self).__init__(**kwargs) self.subscriptions = subscriptions self.query = query self.options = options - self.management_group_id = management_group_id + self.management_groups = management_groups class ResourcesHistoryRequestOptions(msrest.serialization.Model): - """ResourcesHistoryRequestOptions. + """The options for history request evaluation. - :param interval: An interval in time specifying the date and time for the inclusive start and - exclusive end, i.e. ``[start, end)``. + :param interval: The time interval used to fetch history. :type interval: ~azure.mgmt.resourcegraph.models.DateTimeInterval - :param top: + :param top: The maximum number of rows that the query should return. Overrides the page size + when ``$skipToken`` property is present. :type top: int - :param skip: + :param skip: The number of rows to skip from the beginning of the results. Overrides the next + page offset when ``$skipToken`` property is present. :type skip: int - :param skip_token: + :param skip_token: Continuation token for pagination, capturing the next page size and offset, + as well as the context of the query. :type skip_token: str - :param result_format: Possible values include: "table", "objectArray". - :type result_format: str or - ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequestOptionsResultFormat + :param result_format: Defines in which format query result returned. Possible values include: + "table", "objectArray". + :type result_format: str or ~azure.mgmt.resourcegraph.models.ResultFormat """ + _validation = { + 'top': {'maximum': 1000, 'minimum': 1}, + 'skip': {'minimum': 0}, + } + _attribute_map = { 'interval': {'key': 'interval', 'type': 'DateTimeInterval'}, 'top': {'key': '$top', 'type': 'int'}, @@ -1094,7 +723,7 @@ def __init__( top: Optional[int] = None, skip: Optional[int] = None, skip_token: Optional[str] = None, - result_format: Optional[Union[str, "ResourcesHistoryRequestOptionsResultFormat"]] = None, + result_format: Optional[Union[str, "ResultFormat"]] = None, **kwargs ): super(ResourcesHistoryRequestOptions, self).__init__(**kwargs) @@ -1113,7 +742,7 @@ class Table(msrest.serialization.Model): :param columns: Required. Query result column descriptors. :type columns: list[~azure.mgmt.resourcegraph.models.Column] :param rows: Required. Query result rows. - :type rows: list[list[object]] + :type rows: list[list[any]] """ _validation = { @@ -1130,7 +759,7 @@ def __init__( self, *, columns: List["Column"], - rows: List[List[object]], + rows: List[List[Any]], **kwargs ): super(Table, self).__init__(**kwargs) diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_resource_graph_client_enums.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_resource_graph_client_enums.py index e221084b3baa..4b16ff14daab 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_resource_graph_client_enums.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/models/_resource_graph_client_enums.py @@ -26,20 +26,15 @@ def __getattr__(cls, name): raise AttributeError(name) -class ChangeCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The change category. +class AuthorizationScopeFilter(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines what level of authorization resources should be returned based on the which + subscriptions and management groups are passed as scopes. """ - USER = "User" - SYSTEM = "System" - -class ChangeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The change type for snapshot. PropertyChanges will be provided in case of Update change type - """ - - CREATE = "Create" - UPDATE = "Update" - DELETE = "Delete" + AT_SCOPE_AND_BELOW = "AtScopeAndBelow" + AT_SCOPE_AND_ABOVE = "AtScopeAndAbove" + AT_SCOPE_EXACT = "AtScopeExact" + AT_SCOPE_ABOVE_AND_BELOW = "AtScopeAboveAndBelow" class ColumnDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Data type of a column in a table. @@ -50,6 +45,7 @@ class ColumnDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NUMBER = "number" BOOLEAN = "boolean" OBJECT = "object" + DATETIME = "datetime" class FacetSortOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sorting order by the selected column (count by default). @@ -58,19 +54,6 @@ class FacetSortOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ASC = "asc" DESC = "desc" -class PropertyChangeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The property change Type - """ - - INSERT = "Insert" - UPDATE = "Update" - REMOVE = "Remove" - -class ResourcesHistoryRequestOptionsResultFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - TABLE = "table" - OBJECT_ARRAY = "objectArray" - class ResultFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Defines in which format query result returned. """ diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_operations.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_operations.py index 96b0bd7d4d63..2f3ed8a0891b 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-06-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_resource_graph_client_operations.py b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_resource_graph_client_operations.py index 4cc35520fa0d..76b9c3bea71e 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_resource_graph_client_operations.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/operations/_resource_graph_client_operations.py @@ -17,125 +17,13 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ResourceGraphClientOperationsMixin(object): - def resource_changes( - self, - parameters, # type: "_models.ResourceChangesRequestParameters" - **kwargs # type: Any - ): - # type: (...) -> "_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-09-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 = 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.failsafe_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 - - def resource_change_details( - self, - parameters, # type: "_models.ResourceChangeDetailsRequestParameters" - **kwargs # type: Any - ): - # type: (...) -> List["_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: list of ResourceChangeData, or the result of cls(response) - :rtype: list[~azure.mgmt.resourcegraph.models.ResourceChangeData] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ResourceChangeData"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-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 = 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.failsafe_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 - def resources( self, query, # type: "_models.QueryRequest" @@ -156,7 +44,7 @@ def resources( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-06-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -197,22 +85,22 @@ def resources_history( request, # type: "_models.ResourcesHistoryRequest" **kwargs # type: Any ): - # type: (...) -> object + # type: (...) -> Any """List all snapshots of a resource for a given time interval. - :param request: + :param request: Request specifying the query and its options. :type request: ~azure.mgmt.resourcegraph.models.ResourcesHistoryRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object + :return: any, or the result of cls(response) + :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[object] + cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-04-01-preview" + api_version = "2021-06-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json"