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 f788c38de74c..34697611acb4 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_configuration.py @@ -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) diff --git a/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json new file mode 100644 index 000000000000..68efab70de1c --- /dev/null +++ b/sdk/resources/azure-mgmt-resourcegraph/azure/mgmt/resourcegraph/_metadata.json @@ -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\"]}}}" +} \ No newline at end of file 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 364f3c906cf9..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 = "7.0.0" +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 bc0ef95c6dbd..3f4f3e7ff3e2 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,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) 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 faea85ebccde..d824ff3399e7 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 @@ -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): @@ -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 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 69bcf8d0eb7d..a692acd61573 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 @@ -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 @@ -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" @@ -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 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 72599668d98f..12e730111816 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 @@ -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 @@ -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 @@ -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', @@ -88,21 +64,9 @@ 'QueryRequest', 'QueryRequestOptions', 'QueryResponse', - 'ResourceChangeData', - 'ResourceChangeDataAfterSnapshot', - 'ResourceChangeDataBeforeSnapshot', - 'ResourceChangeDetailsRequestParameters', - 'ResourceChangeList', - 'ResourceChangesRequestParameters', - 'ResourceChangesRequestParametersInterval', - 'ResourcePropertyChange', - 'ResourceSnapshotData', 'Table', - 'ChangeCategory', - 'ChangeType', 'ColumnDataType', 'FacetSortOrder', - 'PropertyChangeType', '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 f3fae231c677..eece007579d4 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 @@ -41,40 +41,6 @@ def __init__( self.type = kwargs['type'] -class DateTimeInterval(msrest.serialization.Model): - """An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. ``[start, end)``. - - 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(DateTimeInterval, self).__init__(**kwargs) - self.start = kwargs['start'] - self.end = kwargs['end'] - - class Error(msrest.serialization.Model): """Error details. @@ -320,8 +286,8 @@ class FacetResult(Facet): :type total_records: long :param count: Required. Number of records returned in the facet response. :type count: int - :param data: Required. A table containing the desired facets. Only present if the facet is - valid. + :param data: Required. A JObject array or Table containing the desired facets. Only present if + the facet is valid. :type data: object """ @@ -437,8 +403,9 @@ class QueryRequest(msrest.serialization.Model): :param subscriptions: Azure subscriptions against which to execute the query. :type subscriptions: list[str] - :param management_group_id: The management group identifier. - :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] :param query: Required. The resources query. :type query: str :param options: The query evaluation options. @@ -453,7 +420,7 @@ class QueryRequest(msrest.serialization.Model): _attribute_map = { 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, - 'management_group_id': {'key': 'managementGroupId', 'type': 'str'}, + 'management_groups': {'key': 'managementGroups', 'type': '[str]'}, 'query': {'key': 'query', 'type': 'str'}, 'options': {'key': 'options', 'type': 'QueryRequestOptions'}, 'facets': {'key': 'facets', 'type': '[FacetRequest]'}, @@ -465,7 +432,7 @@ def __init__( ): super(QueryRequest, self).__init__(**kwargs) self.subscriptions = kwargs.get('subscriptions', None) - self.management_group_id = kwargs.get('management_group_id', None) + self.management_groups = kwargs.get('management_groups', None) self.query = kwargs['query'] self.options = kwargs.get('options', None) self.facets = kwargs.get('facets', None) @@ -484,8 +451,12 @@ 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". + "table", "objectArray". Default value: "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 """ _validation = { @@ -498,6 +469,7 @@ class QueryRequestOptions(msrest.serialization.Model): 'top': {'key': '$top', 'type': 'int'}, 'skip': {'key': '$skip', 'type': 'int'}, 'result_format': {'key': 'resultFormat', 'type': 'str'}, + 'allow_partial_scopes': {'key': 'allowPartialScopes', 'type': 'bool'}, } def __init__( @@ -508,7 +480,8 @@ 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', None) + self.result_format = kwargs.get('result_format', "objectArray") + self.allow_partial_scopes = kwargs.get('allow_partial_scopes', False) class QueryResponse(msrest.serialization.Model): @@ -525,10 +498,9 @@ class QueryResponse(msrest.serialization.Model): values include: "true", "false". :type result_truncated: str or ~azure.mgmt.resourcegraph.models.ResultTruncated :param skip_token: When present, the value can be passed to a subsequent query call (together - with the same query and subscriptions used in the current request) to retrieve the next page of - data. + 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 tabular format. + :param data: Required. Query output in JObject array or Table format. :type data: object :param facets: Query facets. :type facets: list[~azure.mgmt.resourcegraph.models.Facet] @@ -563,326 +535,6 @@ 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 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.ResourceSnapshotData - :param after_snapshot: Required. The snapshot after the change. - :type after_snapshot: ~azure.mgmt.resourcegraph.models.ResourceSnapshotData - :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 = { - 'change_id': {'key': 'changeId', 'type': 'str'}, - 'before_snapshot': {'key': 'beforeSnapshot', 'type': 'ResourceSnapshotData'}, - 'after_snapshot': {'key': 'afterSnapshot', 'type': 'ResourceSnapshotData'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'property_changes': {'key': 'propertyChanges', 'type': '[ResourcePropertyChange]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeData, self).__init__(**kwargs) - 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 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 = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSnapshotData, self).__init__(**kwargs) - 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 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 = { - '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 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 = { - '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_id: Required. Specifies the resource for a change details request. - :type resource_id: str - :param change_id: Required. Specifies the change ID. - :type change_id: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'change_id': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'change_id': {'key': 'changeId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangeDetailsRequestParameters, self).__init__(**kwargs) - self.resource_id = kwargs['resource_id'] - self.change_id = kwargs['change_id'] - - -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_id: Required. Specifies the resource for a changes request. - :type resource_id: str - :param interval: Required. Specifies the date and time interval for a changes request. - :type interval: ~azure.mgmt.resourcegraph.models.DateTimeInterval - :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 fetch_property_changes: The flag if set to true will fetch property changes. - :type fetch_property_changes: bool - """ - - _validation = { - 'resource_id': {'required': True}, - 'interval': {'required': True}, - 'top': {'maximum': 1000, 'minimum': 1}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'DateTimeInterval'}, - 'skip_token': {'key': '$skipToken', 'type': 'str'}, - 'top': {'key': '$top', 'type': 'int'}, - 'fetch_property_changes': {'key': 'fetchPropertyChanges', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceChangesRequestParameters, self).__init__(**kwargs) - self.resource_id = kwargs['resource_id'] - self.interval = kwargs['interval'] - self.skip_token = kwargs.get('skip_token', None) - self.top = kwargs.get('top', None) - self.fetch_property_changes = kwargs.get('fetch_property_changes', 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 Table(msrest.serialization.Model): """Query output in tabular format. 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 36ec1b5fd4d6..8cf22e7aaaa2 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 @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -49,43 +48,6 @@ def __init__( self.type = type -class DateTimeInterval(msrest.serialization.Model): - """An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. ``[start, end)``. - - 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(DateTimeInterval, self).__init__(**kwargs) - self.start = start - self.end = end - - class Error(msrest.serialization.Model): """Error details. @@ -354,8 +316,8 @@ class FacetResult(Facet): :type total_records: long :param count: Required. Number of records returned in the facet response. :type count: int - :param data: Required. A table containing the desired facets. Only present if the facet is - valid. + :param data: Required. A JObject array or Table containing the desired facets. Only present if + the facet is valid. :type data: object """ @@ -487,8 +449,9 @@ class QueryRequest(msrest.serialization.Model): :param subscriptions: Azure subscriptions against which to execute the query. :type subscriptions: list[str] - :param management_group_id: The management group identifier. - :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] :param query: Required. The resources query. :type query: str :param options: The query evaluation options. @@ -503,7 +466,7 @@ class QueryRequest(msrest.serialization.Model): _attribute_map = { 'subscriptions': {'key': 'subscriptions', 'type': '[str]'}, - 'management_group_id': {'key': 'managementGroupId', 'type': 'str'}, + 'management_groups': {'key': 'managementGroups', 'type': '[str]'}, 'query': {'key': 'query', 'type': 'str'}, 'options': {'key': 'options', 'type': 'QueryRequestOptions'}, 'facets': {'key': 'facets', 'type': '[FacetRequest]'}, @@ -514,14 +477,14 @@ def __init__( *, query: str, subscriptions: Optional[List[str]] = None, - management_group_id: Optional[str] = None, + management_groups: Optional[List[str]] = None, options: Optional["QueryRequestOptions"] = None, facets: Optional[List["FacetRequest"]] = None, **kwargs ): super(QueryRequest, self).__init__(**kwargs) self.subscriptions = subscriptions - self.management_group_id = management_group_id + self.management_groups = management_groups self.query = query self.options = options self.facets = facets @@ -540,8 +503,12 @@ 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". + "table", "objectArray". Default value: "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 """ _validation = { @@ -554,6 +521,7 @@ class QueryRequestOptions(msrest.serialization.Model): 'top': {'key': '$top', 'type': 'int'}, 'skip': {'key': '$skip', 'type': 'int'}, 'result_format': {'key': 'resultFormat', 'type': 'str'}, + 'allow_partial_scopes': {'key': 'allowPartialScopes', 'type': 'bool'}, } def __init__( @@ -562,7 +530,8 @@ def __init__( skip_token: Optional[str] = None, top: Optional[int] = None, skip: Optional[int] = None, - result_format: Optional[Union[str, "ResultFormat"]] = None, + result_format: Optional[Union[str, "ResultFormat"]] = "objectArray", + allow_partial_scopes: Optional[bool] = False, **kwargs ): super(QueryRequestOptions, self).__init__(**kwargs) @@ -570,6 +539,7 @@ def __init__( self.top = top self.skip = skip self.result_format = result_format + self.allow_partial_scopes = allow_partial_scopes class QueryResponse(msrest.serialization.Model): @@ -586,10 +556,9 @@ class QueryResponse(msrest.serialization.Model): values include: "true", "false". :type result_truncated: str or ~azure.mgmt.resourcegraph.models.ResultTruncated :param skip_token: When present, the value can be passed to a subsequent query call (together - with the same query and subscriptions used in the current request) to retrieve the next page of - data. + 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 tabular format. + :param data: Required. Query output in JObject array or Table format. :type data: object :param facets: Query facets. :type facets: list[~azure.mgmt.resourcegraph.models.Facet] @@ -631,362 +600,6 @@ 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 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.ResourceSnapshotData - :param after_snapshot: Required. The snapshot after the change. - :type after_snapshot: ~azure.mgmt.resourcegraph.models.ResourceSnapshotData - :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 = { - 'change_id': {'key': 'changeId', 'type': 'str'}, - 'before_snapshot': {'key': 'beforeSnapshot', 'type': 'ResourceSnapshotData'}, - 'after_snapshot': {'key': 'afterSnapshot', 'type': 'ResourceSnapshotData'}, - 'change_type': {'key': 'changeType', 'type': 'str'}, - 'property_changes': {'key': 'propertyChanges', 'type': '[ResourcePropertyChange]'}, - } - - def __init__( - self, - *, - change_id: str, - before_snapshot: "ResourceSnapshotData", - after_snapshot: "ResourceSnapshotData", - change_type: Optional[Union[str, "ChangeType"]] = None, - property_changes: Optional[List["ResourcePropertyChange"]] = None, - **kwargs - ): - super(ResourceChangeData, self).__init__(**kwargs) - 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 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 = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - content: Optional[object] = None, - **kwargs - ): - super(ResourceSnapshotData, self).__init__(**kwargs) - 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 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 = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - content: Optional[object] = None, - **kwargs - ): - super(ResourceChangeDataAfterSnapshot, self).__init__(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 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 = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'content': {'key': 'content', 'type': 'object'}, - } - - def __init__( - self, - *, - timestamp: datetime.datetime, - content: Optional[object] = None, - **kwargs - ): - super(ResourceChangeDataBeforeSnapshot, self).__init__(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_id: Required. Specifies the resource for a change details request. - :type resource_id: str - :param change_id: Required. Specifies the change ID. - :type change_id: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'change_id': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'change_id': {'key': 'changeId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: str, - change_id: str, - **kwargs - ): - super(ResourceChangeDetailsRequestParameters, self).__init__(**kwargs) - self.resource_id = resource_id - self.change_id = change_id - - -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_id: Required. Specifies the resource for a changes request. - :type resource_id: str - :param interval: Required. Specifies the date and time interval for a changes request. - :type interval: ~azure.mgmt.resourcegraph.models.DateTimeInterval - :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 fetch_property_changes: The flag if set to true will fetch property changes. - :type fetch_property_changes: bool - """ - - _validation = { - 'resource_id': {'required': True}, - 'interval': {'required': True}, - 'top': {'maximum': 1000, 'minimum': 1}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'DateTimeInterval'}, - 'skip_token': {'key': '$skipToken', 'type': 'str'}, - 'top': {'key': '$top', 'type': 'int'}, - 'fetch_property_changes': {'key': 'fetchPropertyChanges', 'type': 'bool'}, - } - - def __init__( - self, - *, - resource_id: str, - interval: "DateTimeInterval", - skip_token: Optional[str] = None, - top: Optional[int] = None, - fetch_property_changes: Optional[bool] = None, - **kwargs - ): - super(ResourceChangesRequestParameters, self).__init__(**kwargs) - self.resource_id = resource_id - self.interval = interval - self.skip_token = skip_token - self.top = top - self.fetch_property_changes = fetch_property_changes - - -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 Table(msrest.serialization.Model): """Query output in tabular format. 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 792abd3129b9..f317d67a5ab2 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,21 +26,6 @@ def __getattr__(cls, name): raise AttributeError(name) -class ChangeCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The change category. - """ - - 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" - class ColumnDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Data type of a column in a table. """ @@ -58,14 +43,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 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 583ad54110bb..baeed524e446 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 = "2020-04-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -98,8 +98,9 @@ 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 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 3ab49b213d1d..fd63e4b1e2ed 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 @@ -30,8 +30,7 @@ def resources( **kwargs # type: Any ): # type: (...) -> "_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 @@ -45,7 +44,7 @@ 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" @@ -80,115 +79,3 @@ def resources( return deserialized resources.metadata = {'url': '/providers/Microsoft.ResourceGraph/resources'} # type: ignore - - 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-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 = 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 - - def resource_change_details( - self, - parameters, # type: "_models.ResourceChangeDetailsRequestParameters" - **kwargs # type: Any - ): - # type: (...) -> "_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 = 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