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..263e944d30c0 --- /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.5, 3.6, 3.7 and 3.8. +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..c2f912f2dd93 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "303b5ed32590496321112bedb43abbb032df423e", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/quota/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "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..0260537a02bb --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file 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..0260537a02bb --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file 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..cd32bdf2d7bb --- /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 ._configuration import AzureQuotaExtensionAPIConfiguration +from ._azure_quota_extension_api import AzureQuotaExtensionAPI +__all__ = ['AzureQuotaExtensionAPI', 'AzureQuotaExtensionAPIConfiguration'] + +from .version import VERSION + +__version__ = VERSION + 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..7b6036d20cb7 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py @@ -0,0 +1,62 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +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(SDKClient): + """Microsoft Azure Quota Resource Provider + + :ivar config: Configuration for client. + :vartype config: AzureQuotaExtensionAPIConfiguration + + :ivar usages: Usages operations + :vartype usages: azure.mgmt.quota.operations.UsagesOperations + :ivar quota: Quota operations + :vartype quota: azure.mgmt.quota.operations.QuotaOperations + :ivar quota_request_status: QuotaRequestStatus operations + :vartype quota_request_status: azure.mgmt.quota.operations.QuotaRequestStatusOperations + :ivar operation: Operation operations + :vartype operation: azure.mgmt.quota.operations.OperationOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = AzureQuotaExtensionAPIConfiguration(credentials, base_url) + super(AzureQuotaExtensionAPI, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-03-15-preview' + self._serialize = Serializer(client_models) + 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) 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..18c032ac23f1 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py @@ -0,0 +1,43 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class AzureQuotaExtensionAPIConfiguration(AzureConfiguration): + """Configuration for AzureQuotaExtensionAPI + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AzureQuotaExtensionAPIConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-quota/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials 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..5864b8c5d079 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -0,0 +1,103 @@ +# 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, ExceptionResponseException + from ._models_py3 import LimitJsonObject + from ._models_py3 import LimitObject + from ._models_py3 import LimitValue + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResponse + from ._models_py3 import QuotaLimitsResponse + from ._models_py3 import QuotaProperties + from ._models_py3 import QuotaRequestDetails + 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 UsagesObject + from ._models_py3 import UsagesProperties +except (SyntaxError, ImportError): + from ._models import CommonResourceProperties + from ._models import CreateGenericQuotaRequestParameters + from ._models import CurrentQuotaLimitBase + from ._models import CurrentUsagesBase + from ._models import ExceptionResponse, ExceptionResponseException + from ._models import LimitJsonObject + from ._models import LimitObject + from ._models import LimitValue + from ._models import OperationDisplay + from ._models import OperationResponse + from ._models import QuotaLimitsResponse + from ._models import QuotaProperties + from ._models import QuotaRequestDetails + from ._models import QuotaRequestOneResourceSubmitResponse + from ._models import QuotaRequestProperties + from ._models import QuotaRequestSubmitResponse + from ._models import QuotaRequestSubmitResponse202 + from ._models import ResourceName + from ._models import ServiceError + from ._models import ServiceErrorDetail + from ._models import SubRequest + from ._models import UsagesObject + from ._models import UsagesProperties +from ._paged_models import CurrentQuotaLimitBasePaged +from ._paged_models import CurrentUsagesBasePaged +from ._paged_models import OperationResponsePaged +from ._paged_models import QuotaRequestDetailsPaged +from ._azure_quota_extension_api_enums import ( + UsagesTypes, + QuotaRequestState, + LimitType, + QuotaLimitTypes, +) + +__all__ = [ + 'CommonResourceProperties', + 'CreateGenericQuotaRequestParameters', + 'CurrentQuotaLimitBase', + 'CurrentUsagesBase', + 'ExceptionResponse', 'ExceptionResponseException', + 'LimitJsonObject', + 'LimitObject', + 'LimitValue', + 'OperationDisplay', + 'OperationResponse', + 'QuotaLimitsResponse', + 'QuotaProperties', + 'QuotaRequestDetails', + 'QuotaRequestOneResourceSubmitResponse', + 'QuotaRequestProperties', + 'QuotaRequestSubmitResponse', + 'QuotaRequestSubmitResponse202', + 'ResourceName', + 'ServiceError', + 'ServiceErrorDetail', + 'SubRequest', + 'UsagesObject', + 'UsagesProperties', + 'CurrentUsagesBasePaged', + 'CurrentQuotaLimitBasePaged', + 'QuotaRequestDetailsPaged', + 'OperationResponsePaged', + 'UsagesTypes', + 'QuotaRequestState', + 'LimitType', + 'QuotaLimitTypes', +] 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..84b882ccdea6 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py @@ -0,0 +1,38 @@ +# 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 + + +class UsagesTypes(str, Enum): + + individual = "Individual" + combined = "Combined" + + +class QuotaRequestState(str, Enum): + + accepted = "Accepted" + invalid = "Invalid" + succeeded = "Succeeded" + failed = "Failed" + in_progress = "InProgress" + + +class LimitType(str, Enum): + + limit_value = "LimitValue" + + +class QuotaLimitTypes(str, Enum): + + independent = "Independent" + shared = "Shared" 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..6f0abfb747c2 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py @@ -0,0 +1,944 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CommonResourceProperties(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(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(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(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(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 ExceptionResponseException(HttpOperationError): + """Server responsed with exception of type: 'ExceptionResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ExceptionResponseException, self).__init__(deserialize, response, 'ExceptionResponse', *args) + + +class LimitJsonObject(Model): + """LimitJson abstract class. + + All required parameters must be populated in order to send to Azure. + + :param limit_object_type: Required. Constant filled by server. + :type limit_object_type: str + """ + + _validation = { + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LimitJsonObject, self).__init__(**kwargs) + self.limit_object_type = None + + +class LimitObject(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: Possible values include: 'LimitValue' + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + :param limit_type: 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.get('value', None) + self.limit_object_type = kwargs.get('limit_object_type', None) + self.limit_type = kwargs.get('limit_type', None) + + +class LimitValue(Model): + """The resource quota limit. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar limit_object_type: Required. Default value: "LimitValue" . + :vartype limit_object_type: str + :param value: Required. The quota/limit value + :type value: int + :param limit_type: Possible values include: 'Independent', 'Shared' + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + """ + + _validation = { + 'limit_object_type': {'required': True, 'constant': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + } + + limit_object_type = "LimitValue" + + def __init__(self, **kwargs): + super(LimitValue, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.limit_type = kwargs.get('limit_type', None) + + +class OperationDisplay(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 OperationResponse(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 QuotaLimitsResponse(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(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: object + """ + + _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(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 + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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 + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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 = kwargs.get('provisioning_state', None) + self.message = None + self.error = kwargs.get('error', None) + self.request_submit_time = None + self.value = kwargs.get('value', None) + + +class QuotaRequestOneResourceSubmitResponse(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 + :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 name1: Resource name provided by the resource provider. Use this + property name when requesting quota. + :type name1: ~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: object + """ + + _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'}, + 'name1': {'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.name1 = kwargs.get('name1', 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(Model): + """Quota request properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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 + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + '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 = kwargs.get('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(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(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](https://docs.microsoft.com/en-us/rest/api/reserved-vm-instances/quotarequeststatus/get) + 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 name1: Resource name provided by the resource provider. Use this + property name when requesting quota. + :type name1: ~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: object + """ + + _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'}, + 'name1': {'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.name1 = kwargs.get('name1', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.properties = kwargs.get('properties', None) + + +class ResourceName(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(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(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(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 + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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}, + '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 = kwargs.get('provisioning_state', None) + self.message = None + self.sub_request_id = None + self.limit = kwargs.get('limit', None) + + +class UsagesObject(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: 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.get('value', None) + self.usages_type = kwargs.get('usages_type', None) + + +class UsagesProperties(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: object + """ + + _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..961b7a5d5b60 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py @@ -0,0 +1,944 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CommonResourceProperties(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) -> None: + super(CommonResourceProperties, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CreateGenericQuotaRequestParameters(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=None, **kwargs) -> None: + super(CreateGenericQuotaRequestParameters, self).__init__(**kwargs) + self.value = value + + +class CurrentQuotaLimitBase(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=None, **kwargs) -> None: + super(CurrentQuotaLimitBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = properties + + +class CurrentUsagesBase(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=None, **kwargs) -> None: + super(CurrentUsagesBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = properties + + +class ExceptionResponse(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=None, **kwargs) -> None: + super(ExceptionResponse, self).__init__(**kwargs) + self.error = error + + +class ExceptionResponseException(HttpOperationError): + """Server responsed with exception of type: 'ExceptionResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ExceptionResponseException, self).__init__(deserialize, response, 'ExceptionResponse', *args) + + +class LimitJsonObject(Model): + """LimitJson abstract class. + + All required parameters must be populated in order to send to Azure. + + :param limit_object_type: Required. Constant filled by server. + :type limit_object_type: str + """ + + _validation = { + 'limit_object_type': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LimitJsonObject, self).__init__(**kwargs) + self.limit_object_type = None + + +class LimitObject(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: Possible values include: 'LimitValue' + :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType + :param limit_type: 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=None, limit_type=None, **kwargs) -> None: + super(LimitObject, self).__init__(**kwargs) + self.value = value + self.limit_object_type = limit_object_type + self.limit_type = limit_type + + +class LimitValue(Model): + """The resource quota limit. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar limit_object_type: Required. Default value: "LimitValue" . + :vartype limit_object_type: str + :param value: Required. The quota/limit value + :type value: int + :param limit_type: Possible values include: 'Independent', 'Shared' + :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes + """ + + _validation = { + 'limit_object_type': {'required': True, 'constant': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'limit_object_type': {'key': 'limitObjectType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'int'}, + 'limit_type': {'key': 'limitType', 'type': 'str'}, + } + + limit_object_type = "LimitValue" + + def __init__(self, *, value: int, limit_type=None, **kwargs) -> None: + super(LimitValue, self).__init__(**kwargs) + self.value = value + self.limit_type = limit_type + + +class OperationDisplay(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: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationResponse(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: str=None, display=None, origin: str=None, **kwargs) -> None: + super(OperationResponse, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + + +class QuotaLimitsResponse(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=None, next_link: str=None, **kwargs) -> None: + super(QuotaLimitsResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class QuotaProperties(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: object + """ + + _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=None, name=None, resource_type: str=None, properties=None, **kwargs) -> None: + 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(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 + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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 + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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, *, provisioning_state=None, error=None, value=None, **kwargs) -> None: + super(QuotaRequestDetails, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = provisioning_state + self.message = None + self.error = error + self.request_submit_time = None + self.value = value + + +class QuotaRequestOneResourceSubmitResponse(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 + :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 name1: Resource name provided by the resource provider. Use this + property name when requesting quota. + :type name1: ~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: object + """ + + _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'}, + 'name1': {'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=None, unit: str=None, name1=None, resource_type: str=None, error=None, properties=None, **kwargs) -> None: + 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.name1 = name1 + self.resource_type = resource_type + self.quota_period = None + self.is_quota_applicable = None + self.error = error + self.properties = properties + + +class QuotaRequestProperties(Model): + """Quota request properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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 + :param value: Quota request details. + :type value: list[~azure.mgmt.quota.models.SubRequest] + """ + + _validation = { + '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, *, provisioning_state=None, error=None, value=None, **kwargs) -> None: + super(QuotaRequestProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.message = None + self.error = error + self.request_submit_time = None + self.value = value + + +class QuotaRequestSubmitResponse(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=None, **kwargs) -> None: + super(QuotaRequestSubmitResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = properties + self.type = None + + +class QuotaRequestSubmitResponse202(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](https://docs.microsoft.com/en-us/rest/api/reserved-vm-instances/quotarequeststatus/get) + 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 name1: Resource name provided by the resource provider. Use this + property name when requesting quota. + :type name1: ~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: object + """ + + _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'}, + 'name1': {'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=None, unit: str=None, name1=None, resource_type: str=None, properties=None, **kwargs) -> None: + 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.name1 = name1 + self.resource_type = resource_type + self.quota_period = None + self.properties = properties + + +class ResourceName(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: str=None, **kwargs) -> None: + super(ResourceName, self).__init__(**kwargs) + self.value = value + self.localized_value = None + + +class ServiceError(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: str=None, message: str=None, **kwargs) -> None: + super(ServiceError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = None + + +class ServiceErrorDetail(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) -> None: + super(ServiceErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + + +class SubRequest(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 + :param provisioning_state: The quota request status. Possible values + include: 'Accepted', 'Invalid', 'Succeeded', 'Failed', 'InProgress' + :type 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}, + '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=None, unit: str=None, provisioning_state=None, limit=None, **kwargs) -> None: + super(SubRequest, self).__init__(**kwargs) + self.name = name + self.resource_type = None + self.unit = unit + self.provisioning_state = provisioning_state + self.message = None + self.sub_request_id = None + self.limit = limit + + +class UsagesObject(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: 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=None, **kwargs) -> None: + super(UsagesObject, self).__init__(**kwargs) + self.value = value + self.usages_type = usages_type + + +class UsagesProperties(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: object + """ + + _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=None, name=None, resource_type: str=None, properties=None, **kwargs) -> None: + 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/models/_paged_models.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_paged_models.py new file mode 100644 index 000000000000..a939845c37c4 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_paged_models.py @@ -0,0 +1,66 @@ +# 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 msrest.paging import Paged + + +class CurrentUsagesBasePaged(Paged): + """ + A paging container for iterating over a list of :class:`CurrentUsagesBase ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CurrentUsagesBase]'} + } + + def __init__(self, *args, **kwargs): + + super(CurrentUsagesBasePaged, self).__init__(*args, **kwargs) +class CurrentQuotaLimitBasePaged(Paged): + """ + A paging container for iterating over a list of :class:`CurrentQuotaLimitBase ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'} + } + + def __init__(self, *args, **kwargs): + + super(CurrentQuotaLimitBasePaged, self).__init__(*args, **kwargs) +class QuotaRequestDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`QuotaRequestDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[QuotaRequestDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(QuotaRequestDetailsPaged, self).__init__(*args, **kwargs) +class OperationResponsePaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationResponse ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationResponse]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationResponsePaged, self).__init__(*args, **kwargs) 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..dc950428edb3 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py @@ -0,0 +1,22 @@ +# 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..f2ec4e279efd --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """GET operations. + + List all the operations supported by the Microsoft.Quota resource + provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationResponse + :rtype: + ~azure.mgmt.quota.models.OperationResponsePaged[~azure.mgmt.quota.models.OperationResponse] + :raises: + :class:`ExceptionResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Quota/operations'} 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..f39a204b1ad9 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py @@ -0,0 +1,419 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class QuotaOperations(object): + """QuotaOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-15-preview" + + self.config = config + + def get( + self, resource_name, scope, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CurrentQuotaLimitBase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ExceptionResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} + + + def _create_or_update_initial( + self, resource_name, scope, properties=None, custom_headers=None, raw=False, **operation_config): + create_quota_request = models.CurrentQuotaLimitBase(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(create_quota_request, 'CurrentQuotaLimitBase') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ExceptionResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_name, scope, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update the quota limit for the specified resource with the + requested value. To update the quota, follow these steps: + 1. 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](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). + 2. 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 properties: Quota properties for the specified resource, based + on the API called, Quotas or Usages. + :type properties: ~azure.mgmt.quota.models.QuotaProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CurrentQuotaLimitBase + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.quota.models.CurrentQuotaLimitBase]] + :raises: + :class:`ExceptionResponseException` + """ + raw_result = self._create_or_update_initial( + resource_name=resource_name, + scope=scope, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CurrentQuotaLimitBase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} + + + def _update_initial( + self, resource_name, scope, properties=None, custom_headers=None, raw=False, **operation_config): + create_quota_request = models.CurrentQuotaLimitBase(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(create_quota_request, 'CurrentQuotaLimitBase') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ExceptionResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CurrentQuotaLimitBase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_name, scope, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the quota limit for a specific resource to the specified value: + 1. 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](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). + 2. 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 properties: Quota properties for the specified resource, based + on the API called, Quotas or Usages. + :type properties: ~azure.mgmt.quota.models.QuotaProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CurrentQuotaLimitBase + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.quota.models.CurrentQuotaLimitBase]] + :raises: + :class:`ExceptionResponseException` + """ + raw_result = self._update_initial( + resource_name=resource_name, + scope=scope, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CurrentQuotaLimitBase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas/{resourceName}'} + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CurrentQuotaLimitBase + :rtype: + ~azure.mgmt.quota.models.CurrentQuotaLimitBasePaged[~azure.mgmt.quota.models.CurrentQuotaLimitBase] + :raises: + :class:`ExceptionResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CurrentQuotaLimitBasePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotas'} 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..e2b3b0d64d32 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QuotaRequestStatusOperations(object): + """QuotaRequestStatusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-15-preview" + + self.config = config + + def get( + self, id, scope, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QuotaRequestDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ExceptionResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('QuotaRequestDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests/{id}'} + + def list( + self, scope, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """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: | 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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of QuotaRequestDetails + :rtype: + ~azure.mgmt.quota.models.QuotaRequestDetailsPaged[~azure.mgmt.quota.models.QuotaRequestDetails] + :raises: + :class:`ExceptionResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.QuotaRequestDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/quotaRequests'} 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..e53ef1177659 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py @@ -0,0 +1,182 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-03-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-15-preview" + + self.config = config + + def get( + self, resource_name, scope, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CurrentUsagesBase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.quota.models.CurrentUsagesBase or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ExceptionResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CurrentUsagesBase', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages/{resourceName}'} + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CurrentUsagesBase + :rtype: + ~azure.mgmt.quota.models.CurrentUsagesBasePaged[~azure.mgmt.quota.models.CurrentUsagesBase] + :raises: + :class:`ExceptionResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ExceptionResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CurrentUsagesBasePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Quota/usages'} 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..e0ec669828cb --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/version.py @@ -0,0 +1,13 @@ +# 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 = "0.1.0" + 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..b7a56f9b6323 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/sdk_packaging.toml @@ -0,0 +1,8 @@ +[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 = 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..468d04cba0ce --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/setup.py @@ -0,0 +1,91 @@ +#!/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.5', + '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', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + 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..950a9f370118 --- /dev/null +++ b/sdk/quota/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/quota/ + +pr: + branches: + include: + - master + - 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