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..28fc9ebe5e41 --- /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": "a6302e8490871f3619de9cd7001fd5f9cba887bf", + "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..5aee060b4ccc --- /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 QuotaOperations +from .operations import QuotaRequestStatusOperations +from .operations import QuotaResourceProvidersOperations +from .operations import OperationOperations +from . import models + + +class AzureQuotaExtensionAPI(SDKClient): + """Microsoft Azure Quota Resource Provider + + :ivar config: Configuration for client. + :vartype config: AzureQuotaExtensionAPIConfiguration + + :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 quota_resource_providers: QuotaResourceProviders operations + :vartype quota_resource_providers: azure.mgmt.quota.operations.QuotaResourceProvidersOperations + :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.quota = QuotaOperations( + self._client, self.config, self._serialize, self._deserialize) + self.quota_request_status = QuotaRequestStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.quota_resource_providers = QuotaResourceProvidersOperations( + 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..b67ab02bef22 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -0,0 +1,110 @@ +# 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 ExceptionResponse, ExceptionResponseException + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResponse + from ._models_py3 import QuotaBucketProperties + 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 QuotaTemplateDetails + from ._models_py3 import QuotaTemplatesDetails + from ._models_py3 import QuotaTypeDimensionInformation + from ._models_py3 import ResourceName + from ._models_py3 import ResourceProviderDimension + from ._models_py3 import ResourceProviderInformation + from ._models_py3 import ResourceProvidersList + from ._models_py3 import ResourceProviderTemplate + from ._models_py3 import ResourceQueryDetails + from ._models_py3 import ServiceError + from ._models_py3 import ServiceErrorDetail + from ._models_py3 import SubRequest +except (SyntaxError, ImportError): + from ._models import CommonResourceProperties + from ._models import CreateGenericQuotaRequestParameters + from ._models import CurrentQuotaLimitBase + from ._models import ExceptionResponse, ExceptionResponseException + from ._models import OperationDisplay + from ._models import OperationResponse + from ._models import QuotaBucketProperties + 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 QuotaTemplateDetails + from ._models import QuotaTemplatesDetails + from ._models import QuotaTypeDimensionInformation + from ._models import ResourceName + from ._models import ResourceProviderDimension + from ._models import ResourceProviderInformation + from ._models import ResourceProvidersList + from ._models import ResourceProviderTemplate + from ._models import ResourceQueryDetails + from ._models import ServiceError + from ._models import ServiceErrorDetail + from ._models import SubRequest +from ._paged_models import CurrentQuotaLimitBasePaged +from ._paged_models import OperationResponsePaged +from ._paged_models import QuotaRequestDetailsPaged +from ._azure_quota_extension_api_enums import ( + ResourceType, + QuotaRequestState, + ResourceQueryType, + ResourceQueryMethod, +) + +__all__ = [ + 'CommonResourceProperties', + 'CreateGenericQuotaRequestParameters', + 'CurrentQuotaLimitBase', + 'ExceptionResponse', 'ExceptionResponseException', + 'OperationDisplay', + 'OperationResponse', + 'QuotaBucketProperties', + 'QuotaLimitsResponse', + 'QuotaProperties', + 'QuotaRequestDetails', + 'QuotaRequestOneResourceSubmitResponse', + 'QuotaRequestProperties', + 'QuotaRequestSubmitResponse', + 'QuotaRequestSubmitResponse202', + 'QuotaTemplateDetails', + 'QuotaTemplatesDetails', + 'QuotaTypeDimensionInformation', + 'ResourceName', + 'ResourceProviderDimension', + 'ResourceProviderInformation', + 'ResourceProvidersList', + 'ResourceProviderTemplate', + 'ResourceQueryDetails', + 'ServiceError', + 'ServiceErrorDetail', + 'SubRequest', + 'CurrentQuotaLimitBasePaged', + 'QuotaRequestDetailsPaged', + 'OperationResponsePaged', + 'ResourceType', + 'QuotaRequestState', + 'ResourceQueryType', + 'ResourceQueryMethod', +] 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..2e2951c866de --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_azure_quota_extension_api_enums.py @@ -0,0 +1,42 @@ +# 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 ResourceType(str, Enum): + + standard = "standard" + dedicated = "dedicated" + low_priority = "lowPriority" + shared = "shared" + service_specific = "serviceSpecific" + + +class QuotaRequestState(str, Enum): + + accepted = "Accepted" + invalid = "Invalid" + succeeded = "Succeeded" + failed = "Failed" + in_progress = "InProgress" + + +class ResourceQueryType(str, Enum): + + arg = "ARG" + rest_api = "RestAPI" + + +class ResourceQueryMethod(str, Enum): + + get = "GET" + post = "POST" 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..15ff631a677c --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py @@ -0,0 +1,935 @@ +# 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. "Microsoft.Quota/quotaLimits" + :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. + :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 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 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 QuotaBucketProperties(Model): + """quotaBucket provider properties. + + :param name: Property name. + :type name: str + :param display_name: Display name. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuotaBucketProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', 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: Quota limit. + :type limit: int + :ivar current_value: Usage information for the current resource. + :vartype current_value: int + :ivar 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. + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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 = { + 'current_value': {'readonly': True}, + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + '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.current_value = 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/quotaLimits" + :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 + :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'}, + '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.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: Quota limit. + :type limit: int + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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 = { + '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': 'int'}, + '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'}, + '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.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 + :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'}, + '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.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: The quota request details. + :type properties: ~azure.mgmt.quota.models.QuotaRequestProperties + :ivar type: Resource type. "Microsoft.Quota/quotaLimits" + :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: Quota limit. + :type limit: int + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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}, + 'current_value': {'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': 'int'}, + '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'}, + '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.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.properties = kwargs.get('properties', None) + + +class QuotaTemplateDetails(Model): + """Quota template details. + + :param resource_type: Resource type. + :type resource_type: str + :param resource_type1: Resource type + :type resource_type1: str + :param value: Quota type information. + :type value: list[~azure.mgmt.quota.models.QuotaTypeDimensionInformation] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_type1': {'key': 'properties.resourceType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '[QuotaTypeDimensionInformation]'}, + } + + def __init__(self, **kwargs): + super(QuotaTemplateDetails, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.resource_type1 = kwargs.get('resource_type1', None) + self.value = kwargs.get('value', None) + + +class QuotaTemplatesDetails(Model): + """Quota templates details. + + :param value: Quota templates information. + :type value: list[~azure.mgmt.quota.models.QuotaTemplateDetails] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaTemplateDetails]'}, + } + + def __init__(self, **kwargs): + super(QuotaTemplatesDetails, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class QuotaTypeDimensionInformation(Model): + """Quota type information. + + :param name: Property name. + :type name: str + :param display_name: Display name. + :type display_name: str + :param id: Dimension ID. + :type id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuotaTypeDimensionInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.id = kwargs.get('id', 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 ResourceProviderDimension(Model): + """Resource provider resource dimension. + + :param name: Resource dimension name. + :type name: str + :param display_name: Display name. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class ResourceProviderInformation(Model): + """Resource provider information. + + :param resource_provider_name: Resource provider name. + :type resource_provider_name: str + :param value: The resource provider templates + :type value: list[~azure.mgmt.quota.models.ResourceProviderTemplate] + """ + + _attribute_map = { + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '[ResourceProviderTemplate]'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderInformation, self).__init__(**kwargs) + self.resource_provider_name = kwargs.get('resource_provider_name', None) + self.value = kwargs.get('value', None) + + +class ResourceProvidersList(Model): + """Resource providers list. + + :param value: Resource provider information. + :type value: list[~azure.mgmt.quota.models.ResourceProviderInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderInformation]'}, + } + + def __init__(self, **kwargs): + super(ResourceProvidersList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ResourceProviderTemplate(Model): + """Resource template details for the resource provider. + + :param resource_type: Resource type. + :type resource_type: str + :param resource_query: Resource query for dimension values. + :type resource_query: ~azure.mgmt.quota.models.ResourceQueryDetails + :param resource_usages_query: Resource usages query. + :type resource_usages_query: ~azure.mgmt.quota.models.ResourceQueryDetails + :param dimensions: Resource provider dimensions. + :type dimensions: list[~azure.mgmt.quota.models.ResourceProviderDimension] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_query': {'key': 'resourceQuery', 'type': 'ResourceQueryDetails'}, + 'resource_usages_query': {'key': 'resourceUsagesQuery', 'type': 'ResourceQueryDetails'}, + 'dimensions': {'key': 'dimensions', 'type': '[ResourceProviderDimension]'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderTemplate, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.resource_query = kwargs.get('resource_query', None) + self.resource_usages_query = kwargs.get('resource_usages_query', None) + self.dimensions = kwargs.get('dimensions', None) + + +class ResourceQueryDetails(Model): + """Resource query details. + + :param resource_query_type: Resource query type. Possible values include: + 'ARG', 'RestAPI' + :type resource_query_type: str or + ~azure.mgmt.quota.models.ResourceQueryType + :param resource_query_method: Resource query method. Possible values + include: 'GET', 'POST' + :type resource_query_method: str or + ~azure.mgmt.quota.models.ResourceQueryMethod + :param resource_query_uri: Base URI for for resource query. + :type resource_query_uri: str + :param resource_query_post_template: Template to create the resource + query. + :type resource_query_post_template: str + """ + + _attribute_map = { + 'resource_query_type': {'key': 'resourceQueryType', 'type': 'str'}, + 'resource_query_method': {'key': 'resourceQueryMethod', 'type': 'str'}, + 'resource_query_uri': {'key': 'resourceQueryUri', 'type': 'str'}, + 'resource_query_post_template': {'key': 'resourceQueryPostTemplate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceQueryDetails, self).__init__(**kwargs) + self.resource_query_type = kwargs.get('resource_query_type', None) + self.resource_query_method = kwargs.get('resource_query_method', None) + self.resource_query_uri = kwargs.get('resource_query_uri', None) + self.resource_query_post_template = kwargs.get('resource_query_post_template', 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. + + :ivar limit: Resource quota limit. + :vartype limit: int + :param name: Resource name. + :type name: ~azure.mgmt.quota.models.ResourceName + :ivar resource_type: Resource type for which the quota check was made. + :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 + """ + + _validation = { + 'limit': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'message': {'readonly': True}, + 'sub_request_id': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + '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'}, + } + + def __init__(self, **kwargs): + super(SubRequest, self).__init__(**kwargs) + self.limit = None + 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 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..5f9ca684f917 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py @@ -0,0 +1,935 @@ +# 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. "Microsoft.Quota/quotaLimits" + :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. + :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 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 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 QuotaBucketProperties(Model): + """quotaBucket provider properties. + + :param name: Property name. + :type name: str + :param display_name: Display name. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(QuotaBucketProperties, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +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: Quota limit. + :type limit: int + :ivar current_value: Usage information for the current resource. + :vartype current_value: int + :ivar 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. + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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 = { + 'current_value': {'readonly': True}, + 'unit': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'is_quota_applicable': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + '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: int=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + super(QuotaProperties, self).__init__(**kwargs) + self.limit = limit + self.current_value = None + 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/quotaLimits" + :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 + :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'}, + 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'properties.value', 'type': '[SubRequest]'}, + } + + def __init__(self, *, provisioning_state=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.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: Quota limit. + :type limit: int + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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 = { + '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': 'int'}, + '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'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type=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.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 + :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'}, + 'request_submit_time': {'key': 'requestSubmitTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[SubRequest]'}, + } + + def __init__(self, *, provisioning_state=None, value=None, **kwargs) -> None: + super(QuotaRequestProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.message = None + 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: The quota request details. + :type properties: ~azure.mgmt.quota.models.QuotaRequestProperties + :ivar type: Resource type. "Microsoft.Quota/quotaLimits" + :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: Quota limit. + :type limit: int + :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. Possible values include: + 'standard', 'dedicated', 'lowPriority', 'shared', 'serviceSpecific' + :type resource_type: str or ~azure.mgmt.quota.models.ResourceType + :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}, + 'current_value': {'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': 'int'}, + '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'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type=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.current_value = None + self.unit = unit + self.name1 = name1 + self.resource_type = resource_type + self.quota_period = None + self.properties = properties + + +class QuotaTemplateDetails(Model): + """Quota template details. + + :param resource_type: Resource type. + :type resource_type: str + :param resource_type1: Resource type + :type resource_type1: str + :param value: Quota type information. + :type value: list[~azure.mgmt.quota.models.QuotaTypeDimensionInformation] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_type1': {'key': 'properties.resourceType', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '[QuotaTypeDimensionInformation]'}, + } + + def __init__(self, *, resource_type: str=None, resource_type1: str=None, value=None, **kwargs) -> None: + super(QuotaTemplateDetails, self).__init__(**kwargs) + self.resource_type = resource_type + self.resource_type1 = resource_type1 + self.value = value + + +class QuotaTemplatesDetails(Model): + """Quota templates details. + + :param value: Quota templates information. + :type value: list[~azure.mgmt.quota.models.QuotaTemplateDetails] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaTemplateDetails]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(QuotaTemplatesDetails, self).__init__(**kwargs) + self.value = value + + +class QuotaTypeDimensionInformation(Model): + """Quota type information. + + :param name: Property name. + :type name: str + :param display_name: Display name. + :type display_name: str + :param id: Dimension ID. + :type id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, id: str=None, **kwargs) -> None: + super(QuotaTypeDimensionInformation, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.id = id + + +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 ResourceProviderDimension(Model): + """Resource provider resource dimension. + + :param name: Resource dimension name. + :type name: str + :param display_name: Display name. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(ResourceProviderDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class ResourceProviderInformation(Model): + """Resource provider information. + + :param resource_provider_name: Resource provider name. + :type resource_provider_name: str + :param value: The resource provider templates + :type value: list[~azure.mgmt.quota.models.ResourceProviderTemplate] + """ + + _attribute_map = { + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '[ResourceProviderTemplate]'}, + } + + def __init__(self, *, resource_provider_name: str=None, value=None, **kwargs) -> None: + super(ResourceProviderInformation, self).__init__(**kwargs) + self.resource_provider_name = resource_provider_name + self.value = value + + +class ResourceProvidersList(Model): + """Resource providers list. + + :param value: Resource provider information. + :type value: list[~azure.mgmt.quota.models.ResourceProviderInformation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderInformation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ResourceProvidersList, self).__init__(**kwargs) + self.value = value + + +class ResourceProviderTemplate(Model): + """Resource template details for the resource provider. + + :param resource_type: Resource type. + :type resource_type: str + :param resource_query: Resource query for dimension values. + :type resource_query: ~azure.mgmt.quota.models.ResourceQueryDetails + :param resource_usages_query: Resource usages query. + :type resource_usages_query: ~azure.mgmt.quota.models.ResourceQueryDetails + :param dimensions: Resource provider dimensions. + :type dimensions: list[~azure.mgmt.quota.models.ResourceProviderDimension] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_query': {'key': 'resourceQuery', 'type': 'ResourceQueryDetails'}, + 'resource_usages_query': {'key': 'resourceUsagesQuery', 'type': 'ResourceQueryDetails'}, + 'dimensions': {'key': 'dimensions', 'type': '[ResourceProviderDimension]'}, + } + + def __init__(self, *, resource_type: str=None, resource_query=None, resource_usages_query=None, dimensions=None, **kwargs) -> None: + super(ResourceProviderTemplate, self).__init__(**kwargs) + self.resource_type = resource_type + self.resource_query = resource_query + self.resource_usages_query = resource_usages_query + self.dimensions = dimensions + + +class ResourceQueryDetails(Model): + """Resource query details. + + :param resource_query_type: Resource query type. Possible values include: + 'ARG', 'RestAPI' + :type resource_query_type: str or + ~azure.mgmt.quota.models.ResourceQueryType + :param resource_query_method: Resource query method. Possible values + include: 'GET', 'POST' + :type resource_query_method: str or + ~azure.mgmt.quota.models.ResourceQueryMethod + :param resource_query_uri: Base URI for for resource query. + :type resource_query_uri: str + :param resource_query_post_template: Template to create the resource + query. + :type resource_query_post_template: str + """ + + _attribute_map = { + 'resource_query_type': {'key': 'resourceQueryType', 'type': 'str'}, + 'resource_query_method': {'key': 'resourceQueryMethod', 'type': 'str'}, + 'resource_query_uri': {'key': 'resourceQueryUri', 'type': 'str'}, + 'resource_query_post_template': {'key': 'resourceQueryPostTemplate', 'type': 'str'}, + } + + def __init__(self, *, resource_query_type=None, resource_query_method=None, resource_query_uri: str=None, resource_query_post_template: str=None, **kwargs) -> None: + super(ResourceQueryDetails, self).__init__(**kwargs) + self.resource_query_type = resource_query_type + self.resource_query_method = resource_query_method + self.resource_query_uri = resource_query_uri + self.resource_query_post_template = resource_query_post_template + + +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. + + :ivar limit: Resource quota limit. + :vartype limit: int + :param name: Resource name. + :type name: ~azure.mgmt.quota.models.ResourceName + :ivar resource_type: Resource type for which the quota check was made. + :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 + """ + + _validation = { + 'limit': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'message': {'readonly': True}, + 'sub_request_id': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'int'}, + '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'}, + } + + def __init__(self, *, name=None, unit: str=None, provisioning_state=None, **kwargs) -> None: + super(SubRequest, self).__init__(**kwargs) + self.limit = None + self.name = name + self.resource_type = None + self.unit = unit + self.provisioning_state = provisioning_state + self.message = None + self.sub_request_id = None 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..1b0852d08902 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_paged_models.py @@ -0,0 +1,53 @@ +# 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 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..f07fc973dfc6 --- /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 ._quota_operations import QuotaOperations +from ._quota_request_status_operations import QuotaRequestStatusOperations +from ._quota_resource_providers_operations import QuotaResourceProvidersOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'QuotaOperations', + 'QuotaRequestStatusOperations', + 'QuotaResourceProvidersOperations', + '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..88d21cb646f7 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operation_operations.py @@ -0,0 +1,102 @@ +# 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 GET operations. + + :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..4f903a507ca6 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py @@ -0,0 +1,416 @@ +# 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): + """Gets the quota limit and current quota usage of a resource. The + response can be used to determine the remaining quota and 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 + :type resource_name: str + :param scope: The target Azure resource URI. For example, + `/subscriptions/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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/quotaLimits/{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 response.status_code == 202: + 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 to the + requested value. To update the quota, follow these steps: + 1. Use the GET operation 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. + + :param resource_name: Resource name for a given resource provider. For + example: + - SKU name for Microsoft.Compute + - Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices + :type resource_name: str + :param scope: The target Azure resource URI. For example, + `/subscriptions/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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. + :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/quotaLimits/{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 response.status_code == 202: + 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 GET operation 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. + + :param resource_name: Resource name for a given resource provider. For + example: + - SKU name for Microsoft.Compute + - Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices + :type resource_name: str + :param scope: The target Azure resource URI. For example, + `/subscriptions/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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. + :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/quotaLimits/{resourceName}'} + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Get a list of current quota limits and usages of all resources. 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/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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/quotaLimits'} 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..e5addb9abab2 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py @@ -0,0 +1,198 @@ +# 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): + """Gets 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/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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/quotaLimitsRequests/{id}'} + + def list( + self, scope, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """For the specified location and resource provider, gets the current + quota requests under the subscription for a one year period ending at + the time is made. Use the **oData** filter can be used to select quota + requests. + + :param scope: The target Azure resource URI. For example, + `/subscriptions/9f6cce51-6baf-4de5-a3c4-6f58b85315b9/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 `/quotaLimits`, 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, the value of the **nextLink** element + 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/quotaLimitsRequests'} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_resource_providers_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_resource_providers_operations.py new file mode 100644 index 000000000000..ba18fd1d9bc7 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_resource_providers_operations.py @@ -0,0 +1,99 @@ +# 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 QuotaResourceProvidersOperations(object): + """QuotaResourceProvidersOperations 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): + """Gets the list of current resource providers supported by the + Microsoft.Quota resource provider. + For each resource provider, the resource templates the resource + provider supports are be provided. + For each resource template, the resource dimensions are listed. The + resource dimensions are the name-value pairs in the resource URI. + Example: Microsoft.Compute Resource Provider + The URI template is + '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{locationId}/quotaBucket'. + The actual dimensions vary depending on the resource provider. + The resource dimensions are {subscriptions},{locations},{quotaBucket}. + + :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: ResourceProvidersList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.quota.models.ResourceProvidersList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ExceptionResponseException` + """ + # 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) + + # 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('ResourceProvidersList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Quota/quotaLimitProviders'} 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