From df5f701cb34b89baba8979c2ee218a4bf1c19183 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 6 Sep 2021 10:29:43 +0000 Subject: [PATCH 1/2] CodeGen from PR 15918 in Azure/azure-rest-api-specs Updating tag value (#15918) --- sdk/quota/azure-mgmt-quota/CHANGELOG.md | 5 + sdk/quota/azure-mgmt-quota/MANIFEST.in | 6 + sdk/quota/azure-mgmt-quota/README.md | 27 + sdk/quota/azure-mgmt-quota/_meta.json | 11 + sdk/quota/azure-mgmt-quota/azure/__init__.py | 1 + .../azure-mgmt-quota/azure/mgmt/__init__.py | 1 + .../azure/mgmt/quota/__init__.py | 19 + .../mgmt/quota/_azure_quota_extension_api.py | 98 ++ .../azure/mgmt/quota/_configuration.py | 65 + .../azure/mgmt/quota/_metadata.json | 94 ++ .../azure/mgmt/quota/_version.py | 9 + .../azure/mgmt/quota/aio/__init__.py | 10 + .../quota/aio/_azure_quota_extension_api.py | 91 ++ .../azure/mgmt/quota/aio/_configuration.py | 61 + .../mgmt/quota/aio/operations/__init__.py | 19 + .../aio/operations/_operation_operations.py | 107 ++ .../quota/aio/operations/_quota_operations.py | 474 +++++++ .../_quota_request_status_operations.py | 208 +++ .../aio/operations/_usages_operations.py | 185 +++ .../azure/mgmt/quota/models/__init__.py | 105 ++ .../_azure_quota_extension_api_enums.py | 57 + .../azure/mgmt/quota/models/_models.py | 1053 +++++++++++++++ .../azure/mgmt/quota/models/_models_py3.py | 1139 +++++++++++++++++ .../azure/mgmt/quota/operations/__init__.py | 19 + .../quota/operations/_operation_operations.py | 112 ++ .../quota/operations/_quota_operations.py | 484 +++++++ .../_quota_request_status_operations.py | 214 ++++ .../quota/operations/_usages_operations.py | 191 +++ .../azure/mgmt/quota/py.typed | 1 + sdk/quota/azure-mgmt-quota/sdk_packaging.toml | 9 + sdk/quota/azure-mgmt-quota/setup.cfg | 2 + sdk/quota/azure-mgmt-quota/setup.py | 90 ++ sdk/quota/ci.yml | 33 + 33 files changed, 5000 insertions(+) create mode 100644 sdk/quota/azure-mgmt-quota/CHANGELOG.md create mode 100644 sdk/quota/azure-mgmt-quota/MANIFEST.in create mode 100644 sdk/quota/azure-mgmt-quota/README.md create mode 100644 sdk/quota/azure-mgmt-quota/_meta.json create mode 100644 sdk/quota/azure-mgmt-quota/azure/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_metadata.json create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operation_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/py.typed create mode 100644 sdk/quota/azure-mgmt-quota/sdk_packaging.toml create mode 100644 sdk/quota/azure-mgmt-quota/setup.cfg create mode 100644 sdk/quota/azure-mgmt-quota/setup.py create mode 100644 sdk/quota/ci.yml diff --git a/sdk/quota/azure-mgmt-quota/CHANGELOG.md b/sdk/quota/azure-mgmt-quota/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/quota/azure-mgmt-quota/MANIFEST.in b/sdk/quota/azure-mgmt-quota/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/quota/azure-mgmt-quota/README.md b/sdk/quota/azure-mgmt-quota/README.md new file mode 100644 index 000000000000..acf03a205940 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.6+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-quota%2FREADME.png) diff --git a/sdk/quota/azure-mgmt-quota/_meta.json b/sdk/quota/azure-mgmt-quota/_meta.json new file mode 100644 index 000000000000..d10a9618d290 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "17c68996ed7e30574adb5a51311954990932f768", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/quota/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/quota/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/azure/__init__.py b/sdk/quota/azure-mgmt-quota/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py new file mode 100644 index 000000000000..e3a34f9e8ab9 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._azure_quota_extension_api import AzureQuotaExtensionAPI +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureQuotaExtensionAPI'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py new file mode 100644 index 000000000000..8a48b3a48d0c --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py @@ -0,0 +1,98 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import AzureQuotaExtensionAPIConfiguration +from .operations import UsagesOperations +from .operations import QuotaOperations +from .operations import QuotaRequestStatusOperations +from .operations import OperationOperations +from . import models + + +class AzureQuotaExtensionAPI(object): + """Microsoft Azure Quota Resource Provider. + + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.quota.operations.UsagesOperations + :ivar quota: QuotaOperations operations + :vartype quota: azure.mgmt.quota.operations.QuotaOperations + :ivar quota_request_status: QuotaRequestStatusOperations operations + :vartype quota_request_status: azure.mgmt.quota.operations.QuotaRequestStatusOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.quota.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureQuotaExtensionAPIConfiguration(credential, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota = QuotaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota_request_status = QuotaRequestStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + 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() + + def __enter__(self): + # type: () -> AzureQuotaExtensionAPI + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py new file mode 100644 index 000000000000..04bee75ccc66 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py @@ -0,0 +1,65 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureQuotaExtensionAPIConfiguration(Configuration): + """Configuration for AzureQuotaExtensionAPI. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + """ + + def __init__( + self, + credential, # type: "TokenCredential" + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(AzureQuotaExtensionAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.api_version = "2021-03-15-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-quota/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_metadata.json b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_metadata.json new file mode 100644 index 000000000000..96aa0db20c72 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_metadata.json @@ -0,0 +1,94 @@ +{ + "chosen_version": "2021-03-15-preview", + "total_api_version_list": ["2021-03-15-preview"], + "client": { + "name": "AzureQuotaExtensionAPI", + "filename": "_azure_quota_extension_api", + "description": "Microsoft Azure Quota Resource Provider.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "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\": [\"AzureQuotaExtensionAPIConfiguration\"]}}, \"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\": [\"AzureQuotaExtensionAPIConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "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: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + } + }, + "constant": { + }, + "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, + "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": { + "usages": "UsagesOperations", + "quota": "QuotaOperations", + "quota_request_status": "QuotaRequestStatusOperations", + "operation": "OperationOperations" + } +} \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py new file mode 100644 index 000000000000..ab00c327b957 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py @@ -0,0 +1,10 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._azure_quota_extension_api import AzureQuotaExtensionAPI +__all__ = ['AzureQuotaExtensionAPI'] diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py new file mode 100644 index 000000000000..5390e9b8e7ce --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py @@ -0,0 +1,91 @@ +# 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. +# -------------------------------------------------------------------------- + +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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureQuotaExtensionAPIConfiguration +from .operations import UsagesOperations +from .operations import QuotaOperations +from .operations import QuotaRequestStatusOperations +from .operations import OperationOperations +from .. import models + + +class AzureQuotaExtensionAPI(object): + """Microsoft Azure Quota Resource Provider. + + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.quota.aio.operations.UsagesOperations + :ivar quota: QuotaOperations operations + :vartype quota: azure.mgmt.quota.aio.operations.QuotaOperations + :ivar quota_request_status: QuotaRequestStatusOperations operations + :vartype quota_request_status: azure.mgmt.quota.aio.operations.QuotaRequestStatusOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.quota.aio.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureQuotaExtensionAPIConfiguration(credential, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota = QuotaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota_request_status = QuotaRequestStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + 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() + + async def __aenter__(self) -> "AzureQuotaExtensionAPI": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py new file mode 100644 index 000000000000..f099610bf3e8 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py @@ -0,0 +1,61 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureQuotaExtensionAPIConfiguration(Configuration): + """Configuration for AzureQuotaExtensionAPI. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(AzureQuotaExtensionAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.api_version = "2021-03-15-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-quota/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py new file mode 100644 index 000000000000..891eceff0d25 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._usages_operations import UsagesOperations +from ._quota_operations import QuotaOperations +from ._quota_request_status_operations import QuotaRequestStatusOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'UsagesOperations', + 'QuotaOperations', + 'QuotaRequestStatusOperations', + 'OperationOperations', +] diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operation_operations.py new file mode 100644 index 000000000000..0abff86cae38 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operation_operations.py @@ -0,0 +1,107 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """GET operations. + + List all the operations supported by the Microsoft.Quota resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Quota/operations'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py new file mode 100644 index 000000000000..6d727925e11a --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py @@ -0,0 +1,474 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QuotaOperations: + """QuotaOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> "_models.CurrentQuotaLimitBase": + """Get the quota limit of a resource. The response can be used to determine the remaining quota to + calculate a new quota limit that can be submitted with a PUT request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentQuotaLimitBase, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_name: str, + scope: str, + create_quota_request: "_models.CurrentQuotaLimitBase", + **kwargs: Any + ) -> Optional["_models.CurrentQuotaLimitBase"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CurrentQuotaLimitBase"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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(create_quota_request, 'CurrentQuotaLimitBase') + body_content_kwargs['content'] = body_content + request = self._client.put(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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: "_models.CurrentQuotaLimitBase", + **kwargs: Any + ) -> AsyncLROPoller["_models.CurrentQuotaLimitBase"]: + """Create or update the quota limit for the specified resource with the requested value. To update + the quota, follow these steps: + + + #. Use the GET operation for quotas and usages to determine how much quota remains for the + specific resource and to calculate the new quota limit. These steps are detailed in `this + example + `_. + #. Use this PUT operation to update the quota limit. Please check the URI in location header + for the detailed status of the request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param create_quota_request: Quota request payload. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CurrentQuotaLimitBase or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_name=resource_name, + scope=scope, + create_quota_request=create_quota_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + async def _update_initial( + self, + resource_name: str, + scope: str, + create_quota_request: "_models.CurrentQuotaLimitBase", + **kwargs: Any + ) -> Optional["_models.CurrentQuotaLimitBase"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CurrentQuotaLimitBase"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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(create_quota_request, 'CurrentQuotaLimitBase') + body_content_kwargs['content'] = body_content + request = self._client.patch(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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + async def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: "_models.CurrentQuotaLimitBase", + **kwargs: Any + ) -> AsyncLROPoller["_models.CurrentQuotaLimitBase"]: + """Update the quota limit for a specific resource to the specified value: + + + #. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the + specific resource and to calculate the new quota limit. These steps are detailed in `this + example + `_. + #. Use this PUT operation to update the quota limit. Please check the URI in location header + for the detailed status of the request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param create_quota_request: Quota requests payload. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CurrentQuotaLimitBase or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_name=resource_name, + scope=scope, + create_quota_request=create_quota_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def list( + self, + scope: str, + **kwargs: Any + ) -> AsyncIterable["_models.QuotaLimits"]: + """Get a list of current quota limits of all resources for the specified scope. The response from + this GET operation can be leveraged to submit requests to update a quota. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either QuotaLimits or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaLimits] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('QuotaLimits', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py new file mode 100644 index 000000000000..ca672462d4e0 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py @@ -0,0 +1,208 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QuotaRequestStatusOperations: + """QuotaRequestStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + id: str, + scope: str, + **kwargs: Any + ) -> "_models.QuotaRequestDetails": + """Get the quota request details and status by quota request ID for the resources of the resource + provider at a specific location. The quota request ID **id** is returned in the response of the + PUT operation. + + :param id: Quota request ID. + :type id: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QuotaRequestDetails, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaRequestDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'id': self._serialize.url("id", id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QuotaRequestDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests/{id}'} # type: ignore + + def list( + self, + scope: str, + filter: Optional[str] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.QuotaRequestDetailsList"]: + """For the specified scope, get the current quota requests for a one year period ending at the + time is made. Use the **oData** filter to select quota requests. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param filter: .. list-table:: + :header-rows: 1 + + * - Field + - Supported operators + * - + + + |requestSubmitTime | ge, le, eq, gt, lt + |provisioningState eq {QuotaRequestState} + |resourceName eq {resourceName}. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a + partial result. If a previous response contains a **nextLink** element, its value includes a + **skiptoken** parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either QuotaRequestDetailsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaRequestDetailsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaRequestDetailsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('QuotaRequestDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py new file mode 100644 index 000000000000..bfcdb7333b47 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py @@ -0,0 +1,185 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations: + """UsagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> "_models.CurrentUsagesBase": + """Get the current usage of a resource. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentUsagesBase, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.CurrentUsagesBase + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentUsagesBase"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CurrentUsagesBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages/{resourceName}'} # type: ignore + + def list( + self, + scope: str, + **kwargs: Any + ) -> AsyncIterable["_models.UsagesLimits"]: + """Get a list of current usage for all resources for the scope specified. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesLimits or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.UsagesLimits] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesLimits', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py new file mode 100644 index 000000000000..5be9e5f27a73 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import CommonResourceProperties + from ._models_py3 import CreateGenericQuotaRequestParameters + from ._models_py3 import CurrentQuotaLimitBase + from ._models_py3 import CurrentUsagesBase + from ._models_py3 import ExceptionResponse + from ._models_py3 import LimitJsonObject + from ._models_py3 import LimitObject + from ._models_py3 import LimitValue + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import OperationResponse + from ._models_py3 import QuotaLimits + from ._models_py3 import QuotaLimitsResponse + from ._models_py3 import QuotaProperties + from ._models_py3 import QuotaRequestDetails + from ._models_py3 import QuotaRequestDetailsList + from ._models_py3 import QuotaRequestOneResourceSubmitResponse + from ._models_py3 import QuotaRequestProperties + from ._models_py3 import QuotaRequestSubmitResponse + from ._models_py3 import QuotaRequestSubmitResponse202 + from ._models_py3 import ResourceName + from ._models_py3 import ServiceError + from ._models_py3 import ServiceErrorDetail + from ._models_py3 import SubRequest + from ._models_py3 import UsagesLimits + from ._models_py3 import UsagesObject + from ._models_py3 import UsagesProperties +except (SyntaxError, ImportError): + from ._models import CommonResourceProperties # type: ignore + from ._models import CreateGenericQuotaRequestParameters # type: ignore + from ._models import CurrentQuotaLimitBase # type: ignore + from ._models import CurrentUsagesBase # type: ignore + from ._models import ExceptionResponse # type: ignore + from ._models import LimitJsonObject # type: ignore + from ._models import LimitObject # type: ignore + from ._models import LimitValue # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import OperationResponse # type: ignore + from ._models import QuotaLimits # type: ignore + from ._models import QuotaLimitsResponse # type: ignore + from ._models import QuotaProperties # type: ignore + from ._models import QuotaRequestDetails # type: ignore + from ._models import QuotaRequestDetailsList # type: ignore + from ._models import QuotaRequestOneResourceSubmitResponse # type: ignore + from ._models import QuotaRequestProperties # type: ignore + from ._models import QuotaRequestSubmitResponse # type: ignore + from ._models import QuotaRequestSubmitResponse202 # type: ignore + from ._models import ResourceName # type: ignore + from ._models import ServiceError # type: ignore + from ._models import ServiceErrorDetail # type: ignore + from ._models import SubRequest # type: ignore + from ._models import UsagesLimits # type: ignore + from ._models import UsagesObject # type: ignore + from ._models import UsagesProperties # type: ignore + +from ._azure_quota_extension_api_enums import ( + LimitType, + QuotaLimitTypes, + QuotaRequestState, + UsagesTypes, +) + +__all__ = [ + 'CommonResourceProperties', + 'CreateGenericQuotaRequestParameters', + 'CurrentQuotaLimitBase', + 'CurrentUsagesBase', + 'ExceptionResponse', + 'LimitJsonObject', + 'LimitObject', + 'LimitValue', + 'OperationDisplay', + 'OperationList', + 'OperationResponse', + 'QuotaLimits', + 'QuotaLimitsResponse', + 'QuotaProperties', + 'QuotaRequestDetails', + 'QuotaRequestDetailsList', + 'QuotaRequestOneResourceSubmitResponse', + 'QuotaRequestProperties', + 'QuotaRequestSubmitResponse', + 'QuotaRequestSubmitResponse202', + 'ResourceName', + 'ServiceError', + 'ServiceErrorDetail', + 'SubRequest', + 'UsagesLimits', + 'UsagesObject', + 'UsagesProperties', + 'LimitType', + 'QuotaLimitTypes', + 'QuotaRequestState', + 'UsagesTypes', +] diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py new file mode 100644 index 000000000000..acb53f1316eb --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py @@ -0,0 +1,57 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class LimitType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The limit object type. + """ + + LIMIT_VALUE = "LimitValue" + +class QuotaLimitTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The quota or usages limit types. + """ + + INDEPENDENT = "Independent" + SHARED = "Shared" + +class QuotaRequestState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Quota request status. + """ + + ACCEPTED = "Accepted" + INVALID = "Invalid" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + +class UsagesTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The quota or usages limit types. + """ + + INDIVIDUAL = "Individual" + COMBINED = "Combined" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py new file mode 100644 index 000000000000..2dec4fb51c19 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py @@ -0,0 +1,1053 @@ +# 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. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class CommonResourceProperties(msrest.serialization.Model): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. Example: "Microsoft.Quota/quotas". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CommonResourceProperties, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CreateGenericQuotaRequestParameters(msrest.serialization.Model): + """Quota change requests information. + + :param value: Quota change requests. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + } + + def __init__( + self, + **kwargs + ): + super(CreateGenericQuotaRequestParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CurrentQuotaLimitBase(msrest.serialization.Model): + """Quota limit. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :ivar name: The resource name. + :vartype name: str + :param properties: Quota properties for the specified resource, based on the API called, Quotas + or Usages. + :type properties: ~azure.mgmt.quota.models.QuotaProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentQuotaLimitBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = kwargs.get('properties', None) + + +class CurrentUsagesBase(msrest.serialization.Model): + """Resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :ivar name: The resource name. + :vartype name: str + :param properties: Usage properties for the specified resource. + :type properties: ~azure.mgmt.quota.models.UsagesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'UsagesProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CurrentUsagesBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = kwargs.get('properties', None) + + +class ExceptionResponse(msrest.serialization.Model): + """Error. + + :param error: API error details. + :type error: ~azure.mgmt.quota.models.ServiceError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ServiceError'}, + } + + def __init__( + self, + **kwargs + ): + super(ExceptionResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class LimitJsonObject(msrest.serialization.Model): + """LimitJson abstract class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LimitValue. + + All required parameters must be populated in order to send to Azure. + + :param limit_object_type: Required. The limit object type.Constant filled by server. Possible + values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + """ + + _validation = { + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + _subtype_map = { + 'limit_object_type': {'LimitValue': 'LimitValue'} + } + + def __init__( + self, + **kwargs + ): + super(LimitJsonObject, self).__init__(**kwargs) + self.limit_object_type = None # type: Optional[str] + + +class LimitObject(msrest.serialization.Model): + """The resource quota limit value. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The quota/limit value. + :type value: int + :param limit_object_type: The limit object type. Possible values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + :param limit_type: The quota or usages limit types. Possible values include: "Independent", + "Shared". + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LimitObject, self).__init__(**kwargs) + self.value = kwargs['value'] + self.limit_object_type = kwargs.get('limit_object_type', None) + self.limit_type = kwargs.get('limit_type', None) + + +class LimitValue(LimitJsonObject, LimitObject): + """The resource quota limit. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The quota/limit value. + :type value: int + :param limit_type: The quota or usages limit types. Possible values include: "Independent", + "Shared". + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + :param limit_object_type: Required. The limit object type.Constant filled by server. Possible + values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + """ + + _validation = { + 'value': {'required': True}, + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LimitValue, self).__init__(**kwargs) + self.value = kwargs['value'] + self.limit_type = kwargs.get('limit_type', None) + self.limit_object_type = 'LimitValue' # type: str + self.limit_object_type = 'LimitValue' # type: str + + +class OperationDisplay(msrest.serialization.Model): + """OperationDisplay. + + :param provider: Provider name. + :type provider: str + :param resource: Resource name. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationList(msrest.serialization.Model): + """OperationList. + + :param value: + :type value: list[~azure.mgmt.quota.models.OperationResponse] + :param next_link: URL to get the next page of items. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OperationResponse(msrest.serialization.Model): + """OperationResponse. + + :param name: + :type name: str + :param display: + :type display: ~azure.mgmt.quota.models.OperationDisplay + :param origin: + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResponse, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class QuotaLimits(msrest.serialization.Model): + """Quota limits. + + :param value: List of quota limits. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this string is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaLimits, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class QuotaLimitsResponse(msrest.serialization.Model): + """Quota limits request response. + + :param value: List of quota limits with the quota request status. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaLimitsResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class QuotaProperties(msrest.serialization.Model): + """Quota properties for the specified resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitJsonObject + :ivar unit: The quota units, such as Count and Bytes. When requesting quota, use the **unit** + value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :param name: Resource name provided by the resource provider. Use this property name when + requesting quota. + :type name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'LimitJsonObject'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'isQuotaApplicable', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaProperties, self).__init__(**kwargs) + self.limit = kwargs.get('limit', None) + self.unit = None + self.name = kwargs.get('name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.is_quota_applicable = None + self.properties = kwargs.get('properties', None) + + +class QuotaRequestDetails(msrest.serialization.Model): + """List of quota requests with details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: Quota request name. + :vartype name: str + :ivar type: Resource type. "Microsoft.Quota/quotas". + :vartype type: str + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :ivar request_submit_time: The quota request submission time. The date conforms to the + following format specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ServiceErrorDetail'}, + 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'properties.value', 'type': '[SubRequest]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestDetails, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.error = kwargs.get('error', None) + self.request_submit_time = None + self.value = kwargs.get('value', None) + + +class QuotaRequestDetailsList(msrest.serialization.Model): + """Quota request information. + + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.QuotaRequestDetails] + :param next_link: The URI for fetching the next page of quota limits. When there are no more + pages, this string is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaRequestDetails]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestDetailsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class QuotaRequestOneResourceSubmitResponse(msrest.serialization.Model): + """Quota request response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: The name of the quota request. + :vartype name: str + :ivar type: Resource type. "Microsoft.Quota/ServiceLimitRequests". + :vartype type: str + :ivar provisioning_state: Quota request status. Possible values include: "Accepted", "Invalid", + "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :ivar request_submit_time: Quota request submission time. The date conforms to the following + ISO 8601 standard format: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitObject + :ivar current_value: Usage information for the current resource. + :vartype current_value: int + :param unit: The quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :param name_properties_name: Resource name provided by the resource provider. Use this property + name when requesting quota. + :type name_properties_name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + 'current_value': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, + 'limit': {'key': 'properties.limit', 'type': 'LimitObject'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'int'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'quota_period': {'key': 'properties.quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'properties.isQuotaApplicable', 'type': 'bool'}, + 'error': {'key': 'properties.error', 'type': 'ServiceErrorDetail'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestOneResourceSubmitResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.request_submit_time = None + self.limit = kwargs.get('limit', None) + self.current_value = None + self.unit = kwargs.get('unit', None) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.is_quota_applicable = None + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) + + +class QuotaRequestProperties(msrest.serialization.Model): + """Quota request properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :ivar request_submit_time: The quota request submission time. The date conforms to the + following format specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ServiceErrorDetail'}, + 'request_submit_time': {'key': 'requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[SubRequest]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.message = None + self.error = kwargs.get('error', None) + self.request_submit_time = None + self.value = kwargs.get('value', None) + + +class QuotaRequestSubmitResponse(msrest.serialization.Model): + """Quota request response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: Quota request name. + :vartype name: str + :param properties: Quota request details. + :type properties: ~azure.mgmt.quota.models.QuotaRequestProperties + :ivar type: Resource type. "Microsoft.Quota/quotas". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'QuotaRequestProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestSubmitResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = kwargs.get('properties', None) + self.type = None + + +class QuotaRequestSubmitResponse202(msrest.serialization.Model): + """The quota request response with the quota request ID. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The quota request ID. To check the request status, use the **id** value in a `Quota + Request Status + `_ GET + operation. + :vartype id: str + :ivar name: Operation ID. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Quota request status. Possible values include: "Accepted", "Invalid", + "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly message. + :vartype message: str + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitObject + :param unit: The quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :param name_properties_name: Resource name provided by the resource provider. Use this property + name when requesting quota. + :type name_properties_name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'quota_period': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'limit': {'key': 'properties.limit', 'type': 'LimitObject'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'quota_period': {'key': 'properties.quotaPeriod', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaRequestSubmitResponse202, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.limit = kwargs.get('limit', None) + self.unit = kwargs.get('unit', None) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.properties = kwargs.get('properties', None) + + +class ResourceName(msrest.serialization.Model): + """Name of the resource provided by the resource Provider. When requesting quota, use this property name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Resource name. + :type value: str + :ivar localized_value: Resource display name. + :vartype localized_value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = None + + +class ServiceError(msrest.serialization.Model): + """API error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :ivar details: List of error details. + :vartype details: list[~azure.mgmt.quota.models.ServiceErrorDetail] + """ + + _validation = { + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ServiceErrorDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = None + + +class ServiceErrorDetail(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + + +class SubRequest(msrest.serialization.Model): + """Request property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Resource name. + :type name: ~azure.mgmt.quota.models.ResourceName + :ivar resource_type: Resource type for which the quota properties were requested. + :vartype resource_type: str + :param unit: Quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :ivar sub_request_id: Quota request ID. + :vartype sub_request_id: str + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitJsonObject + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'sub_request_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'sub_request_id': {'key': 'subRequestId', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'LimitJsonObject'}, + } + + def __init__( + self, + **kwargs + ): + super(SubRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_type = None + self.unit = kwargs.get('unit', None) + self.provisioning_state = None + self.message = None + self.sub_request_id = None + self.limit = kwargs.get('limit', None) + + +class UsagesLimits(msrest.serialization.Model): + """Quota limits. + + :param value: List of quota limits. + :type value: list[~azure.mgmt.quota.models.CurrentUsagesBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentUsagesBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsagesLimits, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class UsagesObject(msrest.serialization.Model): + """The resource usages value. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The usages value. + :type value: int + :param usages_type: The quota or usages limit types. Possible values include: "Individual", + "Combined". + :type usages_type: str or ~azure.mgmt.quota.models.UsagesTypes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'usages_type': {'key': 'usagesType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsagesObject, self).__init__(**kwargs) + self.value = kwargs['value'] + self.usages_type = kwargs.get('usages_type', None) + + +class UsagesProperties(msrest.serialization.Model): + """Usage properties for the specified resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param usages: The quota limit properties for this resource. + :type usages: ~azure.mgmt.quota.models.UsagesObject + :ivar unit: The units for the quota usage, such as Count and Bytes. When requesting quota, use + the **unit** value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :param name: Resource name provided by the resource provider. Use this property name when + requesting quota. + :type name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: The name of the resource type. + :type resource_type: str + :ivar quota_period: The time period for the summary of the quota usage values. For example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because it is not relevant for all resources such as compute. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'usages': {'key': 'usages', 'type': 'UsagesObject'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'isQuotaApplicable', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(UsagesProperties, self).__init__(**kwargs) + self.usages = kwargs.get('usages', None) + self.unit = None + self.name = kwargs.get('name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.is_quota_applicable = None + self.properties = kwargs.get('properties', None) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py new file mode 100644 index 000000000000..fe580dfba37d --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py @@ -0,0 +1,1139 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_quota_extension_api_enums import * + + +class CommonResourceProperties(msrest.serialization.Model): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. Example: "Microsoft.Quota/quotas". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CommonResourceProperties, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CreateGenericQuotaRequestParameters(msrest.serialization.Model): + """Quota change requests information. + + :param value: Quota change requests. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + } + + def __init__( + self, + *, + value: Optional[List["CurrentQuotaLimitBase"]] = None, + **kwargs + ): + super(CreateGenericQuotaRequestParameters, self).__init__(**kwargs) + self.value = value + + +class CurrentQuotaLimitBase(msrest.serialization.Model): + """Quota limit. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :ivar name: The resource name. + :vartype name: str + :param properties: Quota properties for the specified resource, based on the API called, Quotas + or Usages. + :type properties: ~azure.mgmt.quota.models.QuotaProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, + } + + def __init__( + self, + *, + properties: Optional["QuotaProperties"] = None, + **kwargs + ): + super(CurrentQuotaLimitBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = properties + + +class CurrentUsagesBase(msrest.serialization.Model): + """Resource usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :ivar name: The resource name. + :vartype name: str + :param properties: Usage properties for the specified resource. + :type properties: ~azure.mgmt.quota.models.UsagesProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'UsagesProperties'}, + } + + def __init__( + self, + *, + properties: Optional["UsagesProperties"] = None, + **kwargs + ): + super(CurrentUsagesBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = properties + + +class ExceptionResponse(msrest.serialization.Model): + """Error. + + :param error: API error details. + :type error: ~azure.mgmt.quota.models.ServiceError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ServiceError'}, + } + + def __init__( + self, + *, + error: Optional["ServiceError"] = None, + **kwargs + ): + super(ExceptionResponse, self).__init__(**kwargs) + self.error = error + + +class LimitJsonObject(msrest.serialization.Model): + """LimitJson abstract class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LimitValue. + + All required parameters must be populated in order to send to Azure. + + :param limit_object_type: Required. The limit object type.Constant filled by server. Possible + values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + """ + + _validation = { + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + _subtype_map = { + 'limit_object_type': {'LimitValue': 'LimitValue'} + } + + def __init__( + self, + **kwargs + ): + super(LimitJsonObject, self).__init__(**kwargs) + self.limit_object_type = None # type: Optional[str] + + +class LimitObject(msrest.serialization.Model): + """The resource quota limit value. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The quota/limit value. + :type value: int + :param limit_object_type: The limit object type. Possible values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + :param limit_type: The quota or usages limit types. Possible values include: "Independent", + "Shared". + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + } + + def __init__( + self, + *, + value: int, + limit_object_type: Optional[Union[str, "LimitType"]] = None, + limit_type: Optional[Union[str, "QuotaLimitTypes"]] = None, + **kwargs + ): + super(LimitObject, self).__init__(**kwargs) + self.value = value + self.limit_object_type = limit_object_type + self.limit_type = limit_type + + +class LimitValue(LimitJsonObject, LimitObject): + """The resource quota limit. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The quota/limit value. + :type value: int + :param limit_type: The quota or usages limit types. Possible values include: "Independent", + "Shared". + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + :param limit_object_type: Required. The limit object type.Constant filled by server. Possible + values include: "LimitValue". + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + """ + + _validation = { + 'value': {'required': True}, + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + def __init__( + self, + *, + value: int, + limit_type: Optional[Union[str, "QuotaLimitTypes"]] = None, + **kwargs + ): + super(LimitValue, self).__init__(value=value, limit_type=limit_type, **kwargs) + self.value = value + self.limit_type = limit_type + self.limit_object_type = 'LimitValue' # type: str + self.limit_object_type = 'LimitValue' # type: str + + +class OperationDisplay(msrest.serialization.Model): + """OperationDisplay. + + :param provider: Provider name. + :type provider: str + :param resource: Resource name. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationList(msrest.serialization.Model): + """OperationList. + + :param value: + :type value: list[~azure.mgmt.quota.models.OperationResponse] + :param next_link: URL to get the next page of items. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OperationResponse"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationResponse(msrest.serialization.Model): + """OperationResponse. + + :param name: + :type name: str + :param display: + :type display: ~azure.mgmt.quota.models.OperationDisplay + :param origin: + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + **kwargs + ): + super(OperationResponse, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + + +class QuotaLimits(msrest.serialization.Model): + """Quota limits. + + :param value: List of quota limits. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this string is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CurrentQuotaLimitBase"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(QuotaLimits, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class QuotaLimitsResponse(msrest.serialization.Model): + """Quota limits request response. + + :param value: List of quota limits with the quota request status. + :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CurrentQuotaLimitBase"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(QuotaLimitsResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class QuotaProperties(msrest.serialization.Model): + """Quota properties for the specified resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitJsonObject + :ivar unit: The quota units, such as Count and Bytes. When requesting quota, use the **unit** + value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :param name: Resource name provided by the resource provider. Use this property name when + requesting quota. + :type name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'LimitJsonObject'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'isQuotaApplicable', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + limit: Optional["LimitJsonObject"] = None, + name: Optional["ResourceName"] = None, + resource_type: Optional[str] = None, + properties: Optional[Any] = None, + **kwargs + ): + super(QuotaProperties, self).__init__(**kwargs) + self.limit = limit + self.unit = None + self.name = name + self.resource_type = resource_type + self.quota_period = None + self.is_quota_applicable = None + self.properties = properties + + +class QuotaRequestDetails(msrest.serialization.Model): + """List of quota requests with details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: Quota request name. + :vartype name: str + :ivar type: Resource type. "Microsoft.Quota/quotas". + :vartype type: str + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :ivar request_submit_time: The quota request submission time. The date conforms to the + following format specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ServiceErrorDetail'}, + 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'properties.value', 'type': '[SubRequest]'}, + } + + def __init__( + self, + *, + error: Optional["ServiceErrorDetail"] = None, + value: Optional[List["SubRequest"]] = None, + **kwargs + ): + super(QuotaRequestDetails, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.error = error + self.request_submit_time = None + self.value = value + + +class QuotaRequestDetailsList(msrest.serialization.Model): + """Quota request information. + + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.QuotaRequestDetails] + :param next_link: The URI for fetching the next page of quota limits. When there are no more + pages, this string is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaRequestDetails]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["QuotaRequestDetails"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(QuotaRequestDetailsList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class QuotaRequestOneResourceSubmitResponse(msrest.serialization.Model): + """Quota request response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: The name of the quota request. + :vartype name: str + :ivar type: Resource type. "Microsoft.Quota/ServiceLimitRequests". + :vartype type: str + :ivar provisioning_state: Quota request status. Possible values include: "Accepted", "Invalid", + "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :ivar request_submit_time: Quota request submission time. The date conforms to the following + ISO 8601 standard format: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitObject + :ivar current_value: Usage information for the current resource. + :vartype current_value: int + :param unit: The quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :param name_properties_name: Resource name provided by the resource provider. Use this property + name when requesting quota. + :type name_properties_name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + 'current_value': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, + 'limit': {'key': 'properties.limit', 'type': 'LimitObject'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'int'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'quota_period': {'key': 'properties.quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'properties.isQuotaApplicable', 'type': 'bool'}, + 'error': {'key': 'properties.error', 'type': 'ServiceErrorDetail'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__( + self, + *, + limit: Optional["LimitObject"] = None, + unit: Optional[str] = None, + name_properties_name: Optional["ResourceName"] = None, + resource_type: Optional[str] = None, + error: Optional["ServiceErrorDetail"] = None, + properties: Optional[Any] = None, + **kwargs + ): + super(QuotaRequestOneResourceSubmitResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.request_submit_time = None + self.limit = limit + self.current_value = None + self.unit = unit + self.name_properties_name = name_properties_name + self.resource_type = resource_type + self.quota_period = None + self.is_quota_applicable = None + self.error = error + self.properties = properties + + +class QuotaRequestProperties(msrest.serialization.Model): + """Quota request properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :param error: Error details of the quota request. + :type error: ~azure.mgmt.quota.models.ServiceErrorDetail + :ivar request_submit_time: The quota request submission time. The date conforms to the + following format specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. + :vartype request_submit_time: ~datetime.datetime + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'request_submit_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ServiceErrorDetail'}, + 'request_submit_time': {'key': 'requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[SubRequest]'}, + } + + def __init__( + self, + *, + error: Optional["ServiceErrorDetail"] = None, + value: Optional[List["SubRequest"]] = None, + **kwargs + ): + super(QuotaRequestProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.message = None + self.error = error + self.request_submit_time = None + self.value = value + + +class QuotaRequestSubmitResponse(msrest.serialization.Model): + """Quota request response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Quota request ID. + :vartype id: str + :ivar name: Quota request name. + :vartype name: str + :param properties: Quota request details. + :type properties: ~azure.mgmt.quota.models.QuotaRequestProperties + :ivar type: Resource type. "Microsoft.Quota/quotas". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'QuotaRequestProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + properties: Optional["QuotaRequestProperties"] = None, + **kwargs + ): + super(QuotaRequestSubmitResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = properties + self.type = None + + +class QuotaRequestSubmitResponse202(msrest.serialization.Model): + """The quota request response with the quota request ID. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The quota request ID. To check the request status, use the **id** value in a `Quota + Request Status + `_ GET + operation. + :vartype id: str + :ivar name: Operation ID. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Quota request status. Possible values include: "Accepted", "Invalid", + "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly message. + :vartype message: str + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitObject + :param unit: The quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :param name_properties_name: Resource name provided by the resource provider. Use this property + name when requesting quota. + :type name_properties_name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: Resource type name. + :type resource_type: str + :ivar quota_period: The time period over which the quota usage values are summarized. For + example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because, for some resources like compute, the period is irrelevant. + :vartype quota_period: str + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'quota_period': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'limit': {'key': 'properties.limit', 'type': 'LimitObject'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'quota_period': {'key': 'properties.quotaPeriod', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__( + self, + *, + limit: Optional["LimitObject"] = None, + unit: Optional[str] = None, + name_properties_name: Optional["ResourceName"] = None, + resource_type: Optional[str] = None, + properties: Optional[Any] = None, + **kwargs + ): + super(QuotaRequestSubmitResponse202, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.message = None + self.limit = limit + self.unit = unit + self.name_properties_name = name_properties_name + self.resource_type = resource_type + self.quota_period = None + self.properties = properties + + +class ResourceName(msrest.serialization.Model): + """Name of the resource provided by the resource Provider. When requesting quota, use this property name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: Resource name. + :type value: str + :ivar localized_value: Resource display name. + :vartype localized_value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + **kwargs + ): + super(ResourceName, self).__init__(**kwargs) + self.value = value + self.localized_value = None + + +class ServiceError(msrest.serialization.Model): + """API error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :ivar details: List of error details. + :vartype details: list[~azure.mgmt.quota.models.ServiceErrorDetail] + """ + + _validation = { + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ServiceErrorDetail]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ServiceError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = None + + +class ServiceErrorDetail(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + + +class SubRequest(msrest.serialization.Model): + """Request property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Resource name. + :type name: ~azure.mgmt.quota.models.ResourceName + :ivar resource_type: Resource type for which the quota properties were requested. + :vartype resource_type: str + :param unit: Quota limit units, such as Count and Bytes. When requesting quota, use the + **unit** value returned in the GET response in the request body of your PUT operation. + :type unit: str + :ivar provisioning_state: The quota request status. Possible values include: "Accepted", + "Invalid", "Succeeded", "Failed", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.QuotaRequestState + :ivar message: User-friendly status message. + :vartype message: str + :ivar sub_request_id: Quota request ID. + :vartype sub_request_id: str + :param limit: Resource quota limit properties. + :type limit: ~azure.mgmt.quota.models.LimitJsonObject + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'message': {'readonly': True}, + 'sub_request_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'sub_request_id': {'key': 'subRequestId', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'LimitJsonObject'}, + } + + def __init__( + self, + *, + name: Optional["ResourceName"] = None, + unit: Optional[str] = None, + limit: Optional["LimitJsonObject"] = None, + **kwargs + ): + super(SubRequest, self).__init__(**kwargs) + self.name = name + self.resource_type = None + self.unit = unit + self.provisioning_state = None + self.message = None + self.sub_request_id = None + self.limit = limit + + +class UsagesLimits(msrest.serialization.Model): + """Quota limits. + + :param value: List of quota limits. + :type value: list[~azure.mgmt.quota.models.CurrentUsagesBase] + :param next_link: The URI used to fetch the next page of quota limits. When there are no more + pages, this is null. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CurrentUsagesBase]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CurrentUsagesBase"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(UsagesLimits, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UsagesObject(msrest.serialization.Model): + """The resource usages value. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The usages value. + :type value: int + :param usages_type: The quota or usages limit types. Possible values include: "Individual", + "Combined". + :type usages_type: str or ~azure.mgmt.quota.models.UsagesTypes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'int'}, + 'usages_type': {'key': 'usagesType', 'type': 'str'}, + } + + def __init__( + self, + *, + value: int, + usages_type: Optional[Union[str, "UsagesTypes"]] = None, + **kwargs + ): + super(UsagesObject, self).__init__(**kwargs) + self.value = value + self.usages_type = usages_type + + +class UsagesProperties(msrest.serialization.Model): + """Usage properties for the specified resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param usages: The quota limit properties for this resource. + :type usages: ~azure.mgmt.quota.models.UsagesObject + :ivar unit: The units for the quota usage, such as Count and Bytes. When requesting quota, use + the **unit** value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :param name: Resource name provided by the resource provider. Use this property name when + requesting quota. + :type name: ~azure.mgmt.quota.models.ResourceName + :param resource_type: The name of the resource type. + :type resource_type: str + :ivar quota_period: The time period for the summary of the quota usage values. For example: + *P1D (per one day)*\ PT1M (per one minute) + *PT1S (per one second). + This parameter is optional because it is not relevant for all resources such as compute. + :vartype quota_period: str + :ivar is_quota_applicable: States if quota can be requested for this resource. + :vartype is_quota_applicable: bool + :param properties: Additional properties for the specific resource provider. + :type properties: any + """ + + _validation = { + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'usages': {'key': 'usages', 'type': 'UsagesObject'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'is_quota_applicable': {'key': 'isQuotaApplicable', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + usages: Optional["UsagesObject"] = None, + name: Optional["ResourceName"] = None, + resource_type: Optional[str] = None, + properties: Optional[Any] = None, + **kwargs + ): + super(UsagesProperties, self).__init__(**kwargs) + self.usages = usages + self.unit = None + self.name = name + self.resource_type = resource_type + self.quota_period = None + self.is_quota_applicable = None + self.properties = properties diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py new file mode 100644 index 000000000000..891eceff0d25 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._usages_operations import UsagesOperations +from ._quota_operations import QuotaOperations +from ._quota_request_status_operations import QuotaRequestStatusOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'UsagesOperations', + 'QuotaOperations', + 'QuotaRequestStatusOperations', + 'OperationOperations', +] diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py new file mode 100644 index 000000000000..cae2381de218 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationList"] + """GET operations. + + List all the operations supported by the Microsoft.Quota resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Quota/operations'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py new file mode 100644 index 000000000000..21e6bca8057c --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py @@ -0,0 +1,484 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QuotaOperations(object): + """QuotaOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_name, # type: str + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CurrentQuotaLimitBase" + """Get the quota limit of a resource. The response can be used to determine the remaining quota to + calculate a new quota limit that can be submitted with a PUT request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentQuotaLimitBase, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_name, # type: str + scope, # type: str + create_quota_request, # type: "_models.CurrentQuotaLimitBase" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.CurrentQuotaLimitBase"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CurrentQuotaLimitBase"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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(create_quota_request, 'CurrentQuotaLimitBase') + body_content_kwargs['content'] = body_content + request = self._client.put(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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_name, # type: str + scope, # type: str + create_quota_request, # type: "_models.CurrentQuotaLimitBase" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CurrentQuotaLimitBase"] + """Create or update the quota limit for the specified resource with the requested value. To update + the quota, follow these steps: + + + #. Use the GET operation for quotas and usages to determine how much quota remains for the + specific resource and to calculate the new quota limit. These steps are detailed in `this + example + `_. + #. Use this PUT operation to update the quota limit. Please check the URI in location header + for the detailed status of the request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param create_quota_request: Quota request payload. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CurrentQuotaLimitBase or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_name=resource_name, + scope=scope, + create_quota_request=create_quota_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def _update_initial( + self, + resource_name, # type: str + scope, # type: str + create_quota_request, # type: "_models.CurrentQuotaLimitBase" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.CurrentQuotaLimitBase"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CurrentQuotaLimitBase"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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(create_quota_request, 'CurrentQuotaLimitBase') + body_content_kwargs['content'] = body_content + request = self._client.patch(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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def begin_update( + self, + resource_name, # type: str + scope, # type: str + create_quota_request, # type: "_models.CurrentQuotaLimitBase" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CurrentQuotaLimitBase"] + """Update the quota limit for a specific resource to the specified value: + + + #. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the + specific resource and to calculate the new quota limit. These steps are detailed in `this + example + `_. + #. Use this PUT operation to update the quota limit. Please check the URI in location header + for the detailed status of the request. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param create_quota_request: Quota requests payload. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CurrentQuotaLimitBase or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentQuotaLimitBase"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_name=resource_name, + scope=scope, + create_quota_request=create_quota_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CurrentQuotaLimitBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} # type: ignore + + def list( + self, + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.QuotaLimits"] + """Get a list of current quota limits of all resources for the specified scope. The response from + this GET operation can be leveraged to submit requests to update a quota. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either QuotaLimits or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaLimits] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('QuotaLimits', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py new file mode 100644 index 000000000000..bdd48a7f8d9e --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py @@ -0,0 +1,214 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QuotaRequestStatusOperations(object): + """QuotaRequestStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + id, # type: str + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.QuotaRequestDetails" + """Get the quota request details and status by quota request ID for the resources of the resource + provider at a specific location. The quota request ID **id** is returned in the response of the + PUT operation. + + :param id: Quota request ID. + :type id: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QuotaRequestDetails, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaRequestDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'id': self._serialize.url("id", id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QuotaRequestDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests/{id}'} # type: ignore + + def list( + self, + scope, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.QuotaRequestDetailsList"] + """For the specified scope, get the current quota requests for a one year period ending at the + time is made. Use the **oData** filter to select quota requests. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :param filter: .. list-table:: + :header-rows: 1 + + * - Field + - Supported operators + * - + + + |requestSubmitTime | ge, le, eq, gt, lt + |provisioningState eq {QuotaRequestState} + |resourceName eq {resourceName}. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a + partial result. If a previous response contains a **nextLink** element, its value includes a + **skiptoken** parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either QuotaRequestDetailsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaRequestDetailsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaRequestDetailsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('QuotaRequestDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py new file mode 100644 index 000000000000..4cd7eac4e3a8 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py @@ -0,0 +1,191 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.quota.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_name, # type: str + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CurrentUsagesBase" + """Get the current usage of a resource. + + :param resource_name: Resource name for a given resource provider. For example: + + + * SKU name for Microsoft.Compute + * SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + For Microsoft.Network PublicIPAddresses. + :type resource_name: str + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CurrentUsagesBase, or the result of cls(response) + :rtype: ~azure.mgmt.quota.models.CurrentUsagesBase + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CurrentUsagesBase"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # 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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CurrentUsagesBase', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages/{resourceName}'} # type: ignore + + def list( + self, + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsagesLimits"] + """Get a list of current usage for all resources for the scope specified. + + :param scope: The target Azure resource URI. For example, + ``/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/``. + This is the target Azure resource URI for the List GET operation. If a ``{resourceName}`` is + added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the + specific resource. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsagesLimits or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.UsagesLimits] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsagesLimits', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ExceptionResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages'} # type: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/py.typed b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/sdk_packaging.toml b/sdk/quota/azure-mgmt-quota/sdk_packaging.toml new file mode 100644 index 000000000000..1cda0e0918b7 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-quota" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/quota/azure-mgmt-quota/setup.cfg b/sdk/quota/azure-mgmt-quota/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/quota/azure-mgmt-quota/setup.py b/sdk/quota/azure-mgmt-quota/setup.py new file mode 100644 index 000000000000..8b2008ff1505 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-quota" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/quota/ci.yml b/sdk/quota/ci.yml new file mode 100644 index 000000000000..e44f66e6fc2e --- /dev/null +++ b/sdk/quota/ci.yml @@ -0,0 +1,33 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/quota/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/quota/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: quota + Artifacts: + - name: azure-mgmt-quota + safeName: azuremgmtquota From 361511698cf7dc215031afa5f904ef8e9d87aa9a Mon Sep 17 00:00:00 2001 From: PythonSdkPipelines Date: Tue, 7 Sep 2021 07:34:45 +0000 Subject: [PATCH 2/2] version,CHANGELOG --- sdk/quota/azure-mgmt-quota/CHANGELOG.md | 2 +- sdk/quota/azure-mgmt-quota/README.md | 4 ++-- sdk/quota/azure-mgmt-quota/sdk_packaging.toml | 2 +- sdk/quota/azure-mgmt-quota/setup.py | 2 +- shared_requirements.txt | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/quota/azure-mgmt-quota/CHANGELOG.md b/sdk/quota/azure-mgmt-quota/CHANGELOG.md index 578ed6acf479..e399913622d6 100644 --- a/sdk/quota/azure-mgmt-quota/CHANGELOG.md +++ b/sdk/quota/azure-mgmt-quota/CHANGELOG.md @@ -1,5 +1,5 @@ # Release History -## 0.1.0 (1970-01-01) +## 1.0.0b1 (2021-09-07) * Initial Release diff --git a/sdk/quota/azure-mgmt-quota/README.md b/sdk/quota/azure-mgmt-quota/README.md index acf03a205940..a72971e687f0 100644 --- a/sdk/quota/azure-mgmt-quota/README.md +++ b/sdk/quota/azure-mgmt-quota/README.md @@ -1,6 +1,6 @@ # Microsoft Azure SDK for Python -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure Quota Management Client Library. This package has been tested with Python 2.7, 3.6+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). @@ -13,7 +13,7 @@ To learn how to use this package, see the [quickstart guide](https://aka.ms/azsd For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) -Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Code samples for this package can be found at [Quota Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) diff --git a/sdk/quota/azure-mgmt-quota/sdk_packaging.toml b/sdk/quota/azure-mgmt-quota/sdk_packaging.toml index 1cda0e0918b7..d65973d213de 100644 --- a/sdk/quota/azure-mgmt-quota/sdk_packaging.toml +++ b/sdk/quota/azure-mgmt-quota/sdk_packaging.toml @@ -1,7 +1,7 @@ [packaging] package_name = "azure-mgmt-quota" package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "MyService Management" +package_pprint_name = "Quota Management" package_doc_id = "" is_stable = false is_arm = true diff --git a/sdk/quota/azure-mgmt-quota/setup.py b/sdk/quota/azure-mgmt-quota/setup.py index 8b2008ff1505..facf86274c63 100644 --- a/sdk/quota/azure-mgmt-quota/setup.py +++ b/sdk/quota/azure-mgmt-quota/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-quota" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Quota Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') diff --git a/shared_requirements.txt b/shared_requirements.txt index d4abde6017be..011eb902f286 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -344,3 +344,4 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-mgmt-security msrest>=0.6.21 #override azure-mgmt-apimanagement msrest>=0.6.21 #override azure-mgmt-relay msrest>=0.6.21 +#override azure-mgmt-quota msrest>=0.6.21