Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sdk/resources/azure-mgmt-resourcegraph/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Release History

## 8.1.0b4 (2026-05-28)

### Features Added

- Client `ResourceGraphClient` added parameter `cloud_setting` in method `__init__`
- Client `ResourceGraphClient` added method `send_request`
- Client `ResourceGraphClient` added operation group `graph_query`
- Added enum `CreatedByType`
- Added model `ErrorFieldContract`
- Added model `GraphQueryError`
- Added model `GraphQueryErrorError`
- Added model `GraphQueryProperties`
- Added model `GraphQueryPropertiesUpdateParameters`
- Added model `GraphQueryResource`
- Added model `GraphQueryUpdateParameters`
- Added model `ProxyResource`
- Added model `Resource`
- Added enum `ResultKind`
- Added model `SystemData`
- Added model `GraphQueryOperations`

### Breaking Changes

- Method `ResourceGraphClient.__init__` inserted a `positional_or_keyword` parameter `subscription_id`
- Deleted or renamed model `Column`
- Deleted or renamed model `ColumnDataType`
- Deleted or renamed model `Table`
- Deleted or renamed model `ResourceGraphClientOperationsMixin`
- Method `ResourceGraphClient.resources_history` changed return type from `JSON` to `Any`

## 8.0.1 (2025-11-24)

### Other Changes
Expand Down
17 changes: 9 additions & 8 deletions sdk/resources/azure-mgmt-resourcegraph/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"commit": "e96c24570a484cff13d153fb472f812878866a39",
"apiVersions": {
"GraphQueryApi": "2024-04-01",
"ResourceChanges": "2020-09-01-preview",
"ResourceGraphApi": "2024-04-01",
"ResourceHistory": "2021-06-01-preview"
},
"commit": "cb62053a18882dd258d9922be9770702b7ef6ac9",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.42.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/resourcegraph/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2021-03 --use=@autorest/python@6.42.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/resourcegraph/resource-manager/readme.md"
"typespec_src": "specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/ResourceGraph",
"emitterVersion": "0.62.1"
}
115 changes: 69 additions & 46 deletions sdk/resources/azure-mgmt-resourcegraph/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,72 @@
{
"CrossLanguagePackageId": null,
"CrossLanguagePackageId": "ResourceChanges",
"CrossLanguageDefinitionId": {
"azure.mgmt.resourcegraph.models.Column": null,
"azure.mgmt.resourcegraph.models.Error": null,
"azure.mgmt.resourcegraph.models.ErrorDetails": null,
"azure.mgmt.resourcegraph.models.ErrorFieldContract": null,
"azure.mgmt.resourcegraph.models.ErrorResponse": null,
"azure.mgmt.resourcegraph.models.Facet": null,
"azure.mgmt.resourcegraph.models.FacetError": null,
"azure.mgmt.resourcegraph.models.FacetRequest": null,
"azure.mgmt.resourcegraph.models.FacetRequestOptions": null,
"azure.mgmt.resourcegraph.models.FacetResult": null,
"azure.mgmt.resourcegraph.models.GraphQueryError": null,
"azure.mgmt.resourcegraph.models.GraphQueryErrorError": null,
"azure.mgmt.resourcegraph.models.GraphQueryListResult": null,
"azure.mgmt.resourcegraph.models.Resource": null,
"azure.mgmt.resourcegraph.models.GraphQueryResource": null,
"azure.mgmt.resourcegraph.models.GraphQueryUpdateParameters": null,
"azure.mgmt.resourcegraph.models.Operation": null,
"azure.mgmt.resourcegraph.models.OperationDisplay": null,
"azure.mgmt.resourcegraph.models.OperationListResult": null,
"azure.mgmt.resourcegraph.models.QueryRequest": null,
"azure.mgmt.resourcegraph.models.QueryRequestOptions": null,
"azure.mgmt.resourcegraph.models.QueryResponse": null,
"azure.mgmt.resourcegraph.models.Table": null,
"azure.mgmt.resourcegraph.models.FacetSortOrder": null,
"azure.mgmt.resourcegraph.models.ResultKind": null,
"azure.mgmt.resourcegraph.models.ColumnDataType": null,
"azure.mgmt.resourcegraph.models.ResultFormat": null,
"azure.mgmt.resourcegraph.models.ResultTruncated": null,
"azure.mgmt.resourcegraph.ResourceGraphClient.resources": null,
"azure.mgmt.resourcegraph.aio.ResourceGraphClient.resources": null,
"azure.mgmt.resourcegraph.operations.Operations.list": null,
"azure.mgmt.resourcegraph.aio.operations.Operations.list": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.list_by_subscription": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.list_by_subscription": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.list": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.list": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.get": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.get": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.delete": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.delete": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.create_or_update": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.create_or_update": null,
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.update": null,
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.update": null
}
"azure.mgmt.resourcegraph.models.DateTimeInterval": "ResourceGraphCommon.DateTimeInterval",
"azure.mgmt.resourcegraph.models.Error": "ResourceGraphCommon.Error",
"azure.mgmt.resourcegraph.models.ErrorDetails": "ResourceGraphCommon.ErrorDetails",
"azure.mgmt.resourcegraph.models.ErrorFieldContract": "GraphQueryApi.ErrorFieldContract",
"azure.mgmt.resourcegraph.models.ErrorResponse": "ResourceGraphCommon.ErrorResponse",
"azure.mgmt.resourcegraph.models.Facet": "ResourceGraphApi.Facet",
"azure.mgmt.resourcegraph.models.FacetError": "ResourceGraphApi.FacetError",
"azure.mgmt.resourcegraph.models.FacetRequest": "ResourceGraphApi.FacetRequest",
"azure.mgmt.resourcegraph.models.FacetRequestOptions": "ResourceGraphApi.FacetRequestOptions",
"azure.mgmt.resourcegraph.models.FacetResult": "ResourceGraphApi.FacetResult",
"azure.mgmt.resourcegraph.models.GraphQueryError": "GraphQueryApi.GraphQueryError",
"azure.mgmt.resourcegraph.models.GraphQueryErrorError": "GraphQueryApi.GraphQueryErrorError",
"azure.mgmt.resourcegraph.models.GraphQueryProperties": "GraphQueryApi.GraphQueryProperties",
"azure.mgmt.resourcegraph.models.GraphQueryPropertiesUpdateParameters": "GraphQueryApi.GraphQueryPropertiesUpdateParameters",
"azure.mgmt.resourcegraph.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
"azure.mgmt.resourcegraph.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
"azure.mgmt.resourcegraph.models.GraphQueryResource": "GraphQueryApi.GraphQueryResource",
"azure.mgmt.resourcegraph.models.GraphQueryUpdateParameters": "GraphQueryApi.GraphQueryUpdateParameters",
"azure.mgmt.resourcegraph.models.Operation": "ResourceGraphApi.Operation",
"azure.mgmt.resourcegraph.models.OperationDisplay": "ResourceGraphApi.OperationDisplay",
"azure.mgmt.resourcegraph.models.QueryRequest": "ResourceGraphApi.QueryRequest",
"azure.mgmt.resourcegraph.models.QueryRequestOptions": "ResourceGraphApi.QueryRequestOptions",
"azure.mgmt.resourcegraph.models.QueryResponse": "ResourceGraphApi.QueryResponse",
"azure.mgmt.resourcegraph.models.ResourceChangeData": "ResourceChanges.ResourceChangeData",
"azure.mgmt.resourcegraph.models.ResourceSnapshotData": "ResourceChanges.ResourceSnapshotData",
"azure.mgmt.resourcegraph.models.ResourceChangeDataAfterSnapshot": "ResourceChanges.ResourceChangeDataAfterSnapshot",
"azure.mgmt.resourcegraph.models.ResourceChangeDataBeforeSnapshot": "ResourceChanges.ResourceChangeDataBeforeSnapshot",
"azure.mgmt.resourcegraph.models.ResourceChangeDetailsRequestParameters": "ResourceChanges.ResourceChangeDetailsRequestParameters",
"azure.mgmt.resourcegraph.models.ResourceChangeList": "ResourceChanges.ResourceChangeList",
"azure.mgmt.resourcegraph.models.ResourceChangesRequestParameters": "ResourceChanges.ResourceChangesRequestParameters",
"azure.mgmt.resourcegraph.models.ResourceChangesRequestParametersInterval": "ResourceChanges.ResourceChangesRequestParametersInterval",
"azure.mgmt.resourcegraph.models.ResourcePropertyChange": "ResourceChanges.ResourcePropertyChange",
"azure.mgmt.resourcegraph.models.ResourcesHistoryRequest": "ResourceHistory.ResourcesHistoryRequest",
"azure.mgmt.resourcegraph.models.ResourcesHistoryRequestOptions": "ResourceHistory.ResourcesHistoryRequestOptions",
"azure.mgmt.resourcegraph.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
"azure.mgmt.resourcegraph.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
"azure.mgmt.resourcegraph.models.ResultKind": "GraphQueryApi.ResultKind",
"azure.mgmt.resourcegraph.models.ChangeType": "ResourceChanges.ChangeType",
"azure.mgmt.resourcegraph.models.ChangeCategory": "ResourceChanges.ChangeCategory",
"azure.mgmt.resourcegraph.models.PropertyChangeType": "ResourceChanges.PropertyChangeType",
"azure.mgmt.resourcegraph.models.ResultTruncated": "ResourceGraphApi.ResultTruncated",
"azure.mgmt.resourcegraph.models.ResultFormat": "ResourceGraphCommon.ResultFormat",
"azure.mgmt.resourcegraph.models.AuthorizationScopeFilter": "ResourceGraphApi.AuthorizationScopeFilter",
"azure.mgmt.resourcegraph.models.FacetSortOrder": "ResourceGraphApi.FacetSortOrder",
"azure.mgmt.resourcegraph.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list",
"azure.mgmt.resourcegraph.aio.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.get": "GraphQueryApi.GraphQueryResources.get",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.get": "GraphQueryApi.GraphQueryResources.get",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.create_or_update": "GraphQueryApi.GraphQueryResources.createOrUpdate",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.create_or_update": "GraphQueryApi.GraphQueryResources.createOrUpdate",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.update": "GraphQueryApi.GraphQueryResources.update",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.update": "GraphQueryApi.GraphQueryResources.update",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.delete": "GraphQueryApi.GraphQueryResources.delete",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.delete": "GraphQueryApi.GraphQueryResources.delete",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.list": "GraphQueryApi.GraphQueryResources.list",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.list": "GraphQueryApi.GraphQueryResources.list",
"azure.mgmt.resourcegraph.operations.GraphQueryOperations.list_by_subscription": "GraphQueryApi.GraphQueryResources.listBySubscription",
"azure.mgmt.resourcegraph.aio.operations.GraphQueryOperations.list_by_subscription": "GraphQueryApi.GraphQueryResources.listBySubscription",
"azure.mgmt.resourcegraph.ResourceGraphClient.resource_changes": "ResourceChanges.resourceChanges",
"azure.mgmt.resourcegraph.aio.ResourceGraphClient.resource_changes": "ResourceChanges.resourceChanges",
"azure.mgmt.resourcegraph.ResourceGraphClient.resource_change_details": "ResourceChanges.resourceChangeDetails",
"azure.mgmt.resourcegraph.aio.ResourceGraphClient.resource_change_details": "ResourceChanges.resourceChangeDetails",
"azure.mgmt.resourcegraph.ResourceGraphClient.resources": "ResourceGraphApi.resources",
"azure.mgmt.resourcegraph.aio.ResourceGraphClient.resources": "ResourceGraphApi.resources",
"azure.mgmt.resourcegraph.ResourceGraphClient.resources_history": "ResourceHistory.resourcesHistory",
"azure.mgmt.resourcegraph.aio.ResourceGraphClient.resources_history": "ResourceHistory.resourcesHistory"
},
"CrossLanguageVersion": "c38463afc85a"
}
2 changes: 1 addition & 1 deletion sdk/resources/azure-mgmt-resourcegraph/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand All @@ -12,7 +12,7 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._resource_graph_client import ResourceGraphClient # type: ignore
from ._client import ResourceGraphClient # type: ignore
from ._version import VERSION

__version__ = VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
import sys
from typing import Any, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -17,50 +17,60 @@
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from azure.mgmt.core.tools import get_arm_endpoints

from . import models as _models
from ._configuration import ResourceGraphClientConfiguration
from ._utils.serialization import Deserializer, Serializer
from .operations import GraphQueryOperations, Operations, _ResourceGraphClientOperationsMixin

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # type: ignore

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


class ResourceGraphClient(_ResourceGraphClientOperationsMixin):
"""Azure Resource Graph API Reference.
class ResourceGraphClient(_ResourceGraphClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
"""ResourceGraphClient.

:ivar operations: Operations operations
:vartype operations: azure.mgmt.resourcegraph.operations.Operations
:ivar graph_query: GraphQueryOperations operations
:vartype graph_query: azure.mgmt.resourcegraph.operations.GraphQueryOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param base_url: Service URL. Default value is None.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is None.
:type base_url: str
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:paramtype cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2021-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
*,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
_endpoint = "{endpoint}"
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
_endpoints = get_arm_endpoints(_cloud)
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = ResourceGraphClientConfiguration(
credential=credential, cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs
credential=credential,
subscription_id=subscription_id,
base_url=cast(str, base_url),
cloud_setting=cloud_setting,
credential_scopes=credential_scopes,
**kwargs
)

_policies = kwargs.pop("policies", None)
Expand All @@ -81,22 +91,21 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.graph_query = GraphQueryOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
Expand All @@ -109,7 +118,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
"""

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self) -> None:
Expand Down
Loading
Loading