Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoRelease] t2-resourcegraph-2021-04-25-38865 #18281

Merged
merged 5 commits into from
Apr 25, 2021
Merged
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
8 changes: 8 additions & 0 deletions sdk/resources/azure-mgmt-resourcegraph/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 8.1.0b1 (2021-04-25)

**Features**

- Added operation ResourceGraphClientOperationsMixin.resource_change_details
- Added operation ResourceGraphClientOperationsMixin.resource_changes
- Added operation ResourceGraphClientOperationsMixin.resources_history

## 8.0.0 (2021-03-31)

**Features**
Expand Down
1 change: 1 addition & 0 deletions sdk/resources/azure-mgmt-resourcegraph/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/resources/azure-mgmt-resourcegraph/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/[email protected]",
"commit": "a144e3b668c2712808ddf0025005cc13becad93a",
"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/[email protected] --version=3.3.0",
"readme": "specification/resourcegraph/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(
super(ResourceGraphClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"chosen_version": "",
"total_api_version_list": ["2020-04-01-preview", "2020-09-01-preview", "2021-03-01"],
"client": {
"name": "ResourceGraphClient",
"filename": "_resource_graph_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceGraphClientConfiguration\"], \"._operations_mixin\": [\"ResourceGraphClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ResourceGraphClientConfiguration\"], \"._operations_mixin\": [\"ResourceGraphClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -22,40 +24,122 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
}
},
"constant": {
},
"call": "credential"
"call": "credential",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"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
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"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\"\"\""
"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\"]}}}",
"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"
},
"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\"\"\""
"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",
"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"
},
"call": "query"
"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\"\"\""
},
"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\"\"\""
},
"call": "request"
}
}
},
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import ResourceGraphClientConfiguration
from .operations import ResourceGraphClientOperationsMixin
Expand Down Expand Up @@ -53,6 +54,21 @@ def __init__(
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

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

self.credential = credential
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-resourcegraph/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -50,6 +51,20 @@ def __init__(
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Loading