-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[AutoRelease] t2-postgresqlflexibleservers-2024-10-30-49242(can only be merged by SDK owner) #38188
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
Merged
ChenxiJiang333
merged 4 commits into
Azure:main
from
azure-sdk:t2-postgresqlflexibleservers-2024-10-30-49242
Nov 4, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| { | ||
| "commit": "9a8af2acfafc4d7a23eff41b859d2d332f51b0bc", | ||
| "commit": "8abf88fb9caa0bfea8d4026a4b7628bbe47961ed", | ||
| "repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
| "autorest": "3.10.2", | ||
| "use": [ | ||
| "@autorest/[email protected]", | ||
| "@autorest/[email protected]" | ||
| ], | ||
| "autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-flexibleserver-2024-08-01 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False", | ||
| "autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-flexibleserver-2024-11-01-preview --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False", | ||
| "readme": "specification/postgresql/resource-manager/readme.md" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
...leservers/azure/mgmt/postgresqlflexibleservers/aio/operations/_quota_usages_operations.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # pylint: disable=too-many-lines,too-many-statements | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # 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. | ||
| # Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
| # -------------------------------------------------------------------------- | ||
| import sys | ||
| from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar | ||
| import urllib.parse | ||
|
|
||
| from azure.core.async_paging import AsyncItemPaged, AsyncList | ||
| from azure.core.exceptions import ( | ||
| ClientAuthenticationError, | ||
| HttpResponseError, | ||
| ResourceExistsError, | ||
| ResourceNotFoundError, | ||
| ResourceNotModifiedError, | ||
| map_error, | ||
| ) | ||
| from azure.core.pipeline import PipelineResponse | ||
| from azure.core.rest import AsyncHttpResponse, HttpRequest | ||
| from azure.core.tracing.decorator import distributed_trace | ||
| from azure.core.utils import case_insensitive_dict | ||
| from azure.mgmt.core.exceptions import ARMErrorFormat | ||
|
|
||
| from ... import models as _models | ||
| from ...operations._quota_usages_operations import build_list_request | ||
|
|
||
| if sys.version_info >= (3, 9): | ||
| from collections.abc import MutableMapping | ||
| else: | ||
| from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports | ||
| T = TypeVar("T") | ||
| ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] | ||
|
|
||
|
|
||
| class QuotaUsagesOperations: | ||
| """ | ||
| .. warning:: | ||
| **DO NOT** instantiate this class directly. | ||
|
|
||
| Instead, you should access the following operations through | ||
| :class:`~azure.mgmt.postgresqlflexibleservers.aio.PostgreSQLManagementClient`'s | ||
| :attr:`quota_usages` attribute. | ||
| """ | ||
|
|
||
| models = _models | ||
|
|
||
| def __init__(self, *args, **kwargs) -> None: | ||
| input_args = list(args) | ||
| self._client = input_args.pop(0) if input_args else kwargs.pop("client") | ||
| self._config = input_args.pop(0) if input_args else kwargs.pop("config") | ||
| self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") | ||
| self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") | ||
|
|
||
| @distributed_trace | ||
| def list(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.QuotaUsage"]: | ||
| """Get quota usages at specified location in a given subscription. | ||
|
|
||
| :param location_name: The name of the location. Required. | ||
| :type location_name: str | ||
| :return: An iterator like instance of either QuotaUsage or the result of cls(response) | ||
| :rtype: | ||
| ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.postgresqlflexibleservers.models.QuotaUsage] | ||
| :raises ~azure.core.exceptions.HttpResponseError: | ||
| """ | ||
| _headers = kwargs.pop("headers", {}) or {} | ||
| _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) | ||
|
|
||
| api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) | ||
| cls: ClsType[_models.QuotaUsagesListResult] = kwargs.pop("cls", None) | ||
|
|
||
| error_map: MutableMapping[int, Type[HttpResponseError]] = { | ||
| 401: ClientAuthenticationError, | ||
| 404: ResourceNotFoundError, | ||
| 409: ResourceExistsError, | ||
| 304: ResourceNotModifiedError, | ||
| } | ||
| error_map.update(kwargs.pop("error_map", {}) or {}) | ||
|
|
||
| def prepare_request(next_link=None): | ||
| if not next_link: | ||
|
|
||
| _request = build_list_request( | ||
| location_name=location_name, | ||
| subscription_id=self._config.subscription_id, | ||
| api_version=api_version, | ||
| headers=_headers, | ||
| params=_params, | ||
| ) | ||
| _request.url = self._client.format_url(_request.url) | ||
|
|
||
| else: | ||
| # make call to next link with the client's api-version | ||
| _parsed_next_link = urllib.parse.urlparse(next_link) | ||
| _next_request_params = case_insensitive_dict( | ||
| { | ||
| key: [urllib.parse.quote(v) for v in value] | ||
| for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() | ||
| } | ||
| ) | ||
| _next_request_params["api-version"] = self._config.api_version | ||
| _request = HttpRequest( | ||
| "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params | ||
| ) | ||
| _request.url = self._client.format_url(_request.url) | ||
| _request.method = "GET" | ||
| return _request | ||
|
|
||
| async def extract_data(pipeline_response): | ||
| deserialized = self._deserialize("QuotaUsagesListResult", pipeline_response) | ||
| list_of_elem = deserialized.value | ||
| if cls: | ||
| list_of_elem = cls(list_of_elem) # type: ignore | ||
| return deserialized.next_link or None, AsyncList(list_of_elem) | ||
|
|
||
| async def get_next(next_link=None): | ||
| _request = prepare_request(next_link) | ||
|
|
||
| _stream = False | ||
| pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access | ||
| _request, stream=_stream, **kwargs | ||
| ) | ||
| response = pipeline_response.http_response | ||
|
|
||
| if response.status_code not in [200]: | ||
| map_error(status_code=response.status_code, response=response, error_map=error_map) | ||
| error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) | ||
| raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) | ||
|
|
||
| return pipeline_response | ||
|
|
||
| return AsyncItemPaged(get_next, extract_data) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.