diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py index e61506f3b937..59b103bf0f59 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/__init__.py @@ -22,7 +22,6 @@ from ._models_py3 import CreateGenericQuotaRequestParameters from ._models_py3 import CurrentQuotaLimit from ._models_py3 import CurrentQuotaLimitBase - from ._models_py3 import CurrentQuotaLimitBaseName from ._models_py3 import EmailAction from ._models_py3 import EmailActions from ._models_py3 import Error, ErrorException @@ -44,6 +43,7 @@ from ._models_py3 import PurchaseRequest from ._models_py3 import PurchaseRequestPropertiesReservedResourceProperties 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 @@ -58,6 +58,7 @@ from ._models_py3 import ReservationProperties from ._models_py3 import ReservationResponse from ._models_py3 import ReservationSplitProperties + from ._models_py3 import ResourceName from ._models_py3 import ScopeProperties from ._models_py3 import ServiceError from ._models_py3 import ServiceErrorDetail @@ -66,7 +67,6 @@ from ._models_py3 import SkuRestriction from ._models_py3 import SplitRequest from ._models_py3 import SubRequest - from ._models_py3 import SubRequestName from ._models_py3 import SubscriptionScopeProperties from ._models_py3 import SupportRequestAction except (SyntaxError, ImportError): @@ -82,7 +82,6 @@ from ._models import CreateGenericQuotaRequestParameters from ._models import CurrentQuotaLimit from ._models import CurrentQuotaLimitBase - from ._models import CurrentQuotaLimitBaseName from ._models import EmailAction from ._models import EmailActions from ._models import Error, ErrorException @@ -104,6 +103,7 @@ from ._models import PurchaseRequest from ._models import PurchaseRequestPropertiesReservedResourceProperties from ._models import QuotaLimitsResponse + from ._models import QuotaProperties from ._models import QuotaRequestDetails from ._models import QuotaRequestOneResourceSubmitResponse from ._models import QuotaRequestProperties @@ -118,6 +118,7 @@ from ._models import ReservationProperties from ._models import ReservationResponse from ._models import ReservationSplitProperties + from ._models import ResourceName from ._models import ScopeProperties from ._models import ServiceError from ._models import ServiceErrorDetail @@ -126,7 +127,6 @@ from ._models import SkuRestriction from ._models import SplitRequest from ._models import SubRequest - from ._models import SubRequestName from ._models import SubscriptionScopeProperties from ._models import SupportRequestAction from ._paged_models import CurrentQuotaLimitBasePaged @@ -158,7 +158,6 @@ 'CreateGenericQuotaRequestParameters', 'CurrentQuotaLimit', 'CurrentQuotaLimitBase', - 'CurrentQuotaLimitBaseName', 'EmailAction', 'EmailActions', 'Error', 'ErrorException', @@ -180,6 +179,7 @@ 'PurchaseRequest', 'PurchaseRequestPropertiesReservedResourceProperties', 'QuotaLimitsResponse', + 'QuotaProperties', 'QuotaRequestDetails', 'QuotaRequestOneResourceSubmitResponse', 'QuotaRequestProperties', @@ -194,6 +194,7 @@ 'ReservationProperties', 'ReservationResponse', 'ReservationSplitProperties', + 'ResourceName', 'ScopeProperties', 'ServiceError', 'ServiceErrorDetail', @@ -202,7 +203,6 @@ 'SkuRestriction', 'SplitRequest', 'SubRequest', - 'SubRequestName', 'SubscriptionScopeProperties', 'SupportRequestAction', 'CurrentQuotaLimitBasePaged', diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py index d9d3611631e9..7b5e1b153131 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models.py @@ -329,26 +329,8 @@ class CurrentQuotaLimit(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties :ivar provisioning_state: The quota request status. :vartype provisioning_state: object :ivar message: A user friendly message. @@ -356,32 +338,18 @@ class CurrentQuotaLimit(Model): """ _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, } _attribute_map = { - 'limit': {'key': 'quotaInformation.limit', 'type': 'int'}, - 'current_value': {'key': 'quotaInformation.currentValue', 'type': 'int'}, - 'unit': {'key': 'quotaInformation.unit', 'type': 'str'}, - 'name': {'key': 'quotaInformation.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'quotaInformation.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaInformation.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'quotaInformation.properties', 'type': 'object'}, + 'properties': {'key': 'quotaInformation.properties', 'type': 'QuotaProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, } def __init__(self, **kwargs): super(CurrentQuotaLimit, self).__init__(**kwargs) - self.limit = kwargs.get('limit', None) - self.current_value = None - self.unit = kwargs.get('unit', None) - self.name = kwargs.get('name', None) - self.resource_type = kwargs.get('resource_type', None) - self.quota_period = None self.properties = kwargs.get('properties', None) self.provisioning_state = None self.message = None @@ -390,85 +358,19 @@ def __init__(self, **kwargs): class CurrentQuotaLimitBase(Model): """Quota limits. - Variables are only populated by the server, and will be ignored when - sending a request. - - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ - _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, - } - _attribute_map = { - 'limit': {'key': 'limit', 'type': 'int'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, } def __init__(self, **kwargs): super(CurrentQuotaLimitBase, self).__init__(**kwargs) - self.limit = kwargs.get('limit', None) - self.current_value = None - self.unit = kwargs.get('unit', None) - self.name = kwargs.get('name', None) - self.resource_type = kwargs.get('resource_type', None) - self.quota_period = None self.properties = kwargs.get('properties', None) -class CurrentQuotaLimitBaseName(Model): - """Name of the resource provide by the resource Provider. Please use this name - property for quotaRequests. - - 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(CurrentQuotaLimitBaseName, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.localized_value = None - - class EmailAction(Model): """Email Action. @@ -488,7 +390,7 @@ def __init__(self, **kwargs): class EmailActions(Model): """The email actions. - :param value: The list of actions based on the success or failure of + :param value: The list of email actions based on the success or failure of automatic quota increase action. :type value: list[~azure.mgmt.reservations.models.EmailAction] """ @@ -1013,6 +915,60 @@ def __init__(self, **kwargs): self.next_link = kwargs.get('next_link', None) +class QuotaProperties(Model): + """Resource quota properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param limit: The quota limit. + :type limit: int + :ivar current_value: The current resource usages information. + :vartype current_value: int + :param unit: The units of the limit, such as - Count, Bytes, etc. Use the + unit field provided in the Get quota response. + :type unit: str + :param name: Name of the resource provide by the resource Provider. Please + use this name property for quotaRequests. + :type name: ~azure.mgmt.reservations.models.ResourceName + :param resource_type: The Resource Type Name. + :type resource_type: object + :ivar quota_period: The quota period over which the usage values are + summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per + one second). This parameter is optional because, for some resources like + compute, the period doesn’t matter. + :vartype quota_period: str + :param properties: Additional properties for the specific resource + provider. + :type properties: object + """ + + _validation = { + 'current_value': {'readonly': True}, + 'quota_period': {'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': 'object'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + '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 = kwargs.get('unit', None) + self.name = kwargs.get('name', None) + self.resource_type = kwargs.get('resource_type', None) + self.quota_period = None + self.properties = kwargs.get('properties', None) + + class QuotaRequestDetails(Model): """The details of the quota Request. @@ -1086,26 +1042,8 @@ class QuotaRequestOneResourceSubmitResponse(Model): conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. :vartype request_submit_time: datetime - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name1: Name of the resource provide by the resource Provider. - Please use this name property for quotaRequests. - :type name1: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ _validation = { @@ -1115,8 +1053,6 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, 'request_submit_time': {'readonly': True}, - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, } _attribute_map = { @@ -1126,13 +1062,7 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, - 'limit': {'key': 'properties.properties.limit', 'type': 'int'}, - 'current_value': {'key': 'properties.properties.currentValue', 'type': 'int'}, - 'unit': {'key': 'properties.properties.unit', 'type': 'str'}, - 'name1': {'key': 'properties.properties.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'properties.properties.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'properties.properties.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties.properties.properties', 'type': 'object'}, + 'properties': {'key': 'properties.properties.properties', 'type': 'QuotaProperties'}, } def __init__(self, **kwargs): @@ -1143,12 +1073,6 @@ def __init__(self, **kwargs): 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.properties = kwargs.get('properties', None) @@ -1676,6 +1600,34 @@ def __init__(self, **kwargs): self.split_source = kwargs.get('split_source', None) +class ResourceName(Model): + """Name of the resource provide by the resource Provider. Please use this name + property for quotaRequests. + + 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 ScopeProperties(Model): """ScopeProperties. @@ -1849,7 +1801,7 @@ class SubRequest(Model): :ivar limit: The Resource limit. :vartype limit: int :param name: The Resource name. - :type name: ~azure.mgmt.reservations.models.SubRequestName + :type name: ~azure.mgmt.reservations.models.ResourceName :ivar resource_type: Resource type for which the quota check was made. :vartype resource_type: str :param unit: The units of the limit, such as - Count, Bytes, etc. Use the @@ -1872,7 +1824,7 @@ class SubRequest(Model): _attribute_map = { 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'SubRequestName'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'unit': {'key': 'unit', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'object'}, @@ -1891,34 +1843,6 @@ def __init__(self, **kwargs): self.sub_request_id = None -class SubRequestName(Model): - """The Resource name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar localized_value: Resource display name. - :vartype localized_value: str - :ivar value: Resource name. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SubRequestName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - class SubscriptionScopeProperties(Model): """SubscriptionScopeProperties. diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py index 7a372ddea51f..184afd017a72 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/models/_models_py3.py @@ -329,26 +329,8 @@ class CurrentQuotaLimit(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties :ivar provisioning_state: The quota request status. :vartype provisioning_state: object :ivar message: A user friendly message. @@ -356,32 +338,18 @@ class CurrentQuotaLimit(Model): """ _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, } _attribute_map = { - 'limit': {'key': 'quotaInformation.limit', 'type': 'int'}, - 'current_value': {'key': 'quotaInformation.currentValue', 'type': 'int'}, - 'unit': {'key': 'quotaInformation.unit', 'type': 'str'}, - 'name': {'key': 'quotaInformation.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'quotaInformation.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaInformation.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'quotaInformation.properties', 'type': 'object'}, + 'properties': {'key': 'quotaInformation.properties', 'type': 'QuotaProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, } - def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(CurrentQuotaLimit, self).__init__(**kwargs) - self.limit = limit - self.current_value = None - self.unit = unit - self.name = name - self.resource_type = resource_type - self.quota_period = None self.properties = properties self.provisioning_state = None self.message = None @@ -390,85 +358,19 @@ def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type= class CurrentQuotaLimitBase(Model): """Quota limits. - Variables are only populated by the server, and will be ignored when - sending a request. - - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name: Name of the resource provide by the resource Provider. Please - use this name property for quotaRequests. - :type name: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ - _validation = { - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, - } - _attribute_map = { - 'limit': {'key': 'limit', 'type': 'int'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'resourceType', 'type': 'object'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'QuotaProperties'}, } - def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(CurrentQuotaLimitBase, self).__init__(**kwargs) - self.limit = limit - self.current_value = None - self.unit = unit - self.name = name - self.resource_type = resource_type - self.quota_period = None self.properties = properties -class CurrentQuotaLimitBaseName(Model): - """Name of the resource provide by the resource Provider. Please use this name - property for quotaRequests. - - 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(CurrentQuotaLimitBaseName, self).__init__(**kwargs) - self.value = value - self.localized_value = None - - class EmailAction(Model): """Email Action. @@ -488,7 +390,7 @@ def __init__(self, *, email_address: str=None, **kwargs) -> None: class EmailActions(Model): """The email actions. - :param value: The list of actions based on the success or failure of + :param value: The list of email actions based on the success or failure of automatic quota increase action. :type value: list[~azure.mgmt.reservations.models.EmailAction] """ @@ -1013,6 +915,60 @@ def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: self.next_link = next_link +class QuotaProperties(Model): + """Resource quota properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param limit: The quota limit. + :type limit: int + :ivar current_value: The current resource usages information. + :vartype current_value: int + :param unit: The units of the limit, such as - Count, Bytes, etc. Use the + unit field provided in the Get quota response. + :type unit: str + :param name: Name of the resource provide by the resource Provider. Please + use this name property for quotaRequests. + :type name: ~azure.mgmt.reservations.models.ResourceName + :param resource_type: The Resource Type Name. + :type resource_type: object + :ivar quota_period: The quota period over which the usage values are + summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per + one second). This parameter is optional because, for some resources like + compute, the period doesn’t matter. + :vartype quota_period: str + :param properties: Additional properties for the specific resource + provider. + :type properties: object + """ + + _validation = { + 'current_value': {'readonly': True}, + 'quota_period': {'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': 'object'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, limit: int=None, unit: str=None, name=None, resource_type=None, properties=None, **kwargs) -> None: + super(QuotaProperties, self).__init__(**kwargs) + self.limit = limit + self.current_value = None + self.unit = unit + self.name = name + self.resource_type = resource_type + self.quota_period = None + self.properties = properties + + class QuotaRequestDetails(Model): """The details of the quota Request. @@ -1086,26 +1042,8 @@ class QuotaRequestOneResourceSubmitResponse(Model): conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. :vartype request_submit_time: datetime - :param limit: The quota limit. - :type limit: int - :ivar current_value: The current resource usages information. - :vartype current_value: int - :param unit: The units of the limit, such as - Count, Bytes, etc. Use the - unit field provided in the Get quota response. - :type unit: str - :param name1: Name of the resource provide by the resource Provider. - Please use this name property for quotaRequests. - :type name1: ~azure.mgmt.reservations.models.CurrentQuotaLimitBaseName - :param resource_type: The Resource Type Name. - :type resource_type: object - :ivar quota_period: The quota period over which the usage values are - summarized, such as - P1D (Per one day), PT1M (Per one minute), PT1S (Per - one second). This parameter is optional because, for some resources like - compute, the period doesn’t matter. - :vartype quota_period: str - :param properties: Additional properties for the specific resource - provider. - :type properties: object + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.models.QuotaProperties """ _validation = { @@ -1115,8 +1053,6 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'readonly': True}, 'message': {'readonly': True}, 'request_submit_time': {'readonly': True}, - 'current_value': {'readonly': True}, - 'quota_period': {'readonly': True}, } _attribute_map = { @@ -1126,16 +1062,10 @@ class QuotaRequestOneResourceSubmitResponse(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'object'}, 'message': {'key': 'properties.message', 'type': 'str'}, 'request_submit_time': {'key': 'properties.requestSubmitTime', 'type': 'iso-8601'}, - 'limit': {'key': 'properties.properties.limit', 'type': 'int'}, - 'current_value': {'key': 'properties.properties.currentValue', 'type': 'int'}, - 'unit': {'key': 'properties.properties.unit', 'type': 'str'}, - 'name1': {'key': 'properties.properties.name', 'type': 'CurrentQuotaLimitBaseName'}, - 'resource_type': {'key': 'properties.properties.resourceType', 'type': 'object'}, - 'quota_period': {'key': 'properties.properties.quotaPeriod', 'type': 'str'}, - 'properties': {'key': 'properties.properties.properties', 'type': 'object'}, + 'properties': {'key': 'properties.properties.properties', 'type': 'QuotaProperties'}, } - def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type=None, properties=None, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(QuotaRequestOneResourceSubmitResponse, self).__init__(**kwargs) self.id = None self.name = None @@ -1143,12 +1073,6 @@ def __init__(self, *, limit: int=None, unit: str=None, name1=None, resource_type 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.properties = properties @@ -1676,6 +1600,34 @@ def __init__(self, *, split_destinations=None, split_source: str=None, **kwargs) self.split_source = split_source +class ResourceName(Model): + """Name of the resource provide by the resource Provider. Please use this name + property for quotaRequests. + + 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 ScopeProperties(Model): """ScopeProperties. @@ -1849,7 +1801,7 @@ class SubRequest(Model): :ivar limit: The Resource limit. :vartype limit: int :param name: The Resource name. - :type name: ~azure.mgmt.reservations.models.SubRequestName + :type name: ~azure.mgmt.reservations.models.ResourceName :ivar resource_type: Resource type for which the quota check was made. :vartype resource_type: str :param unit: The units of the limit, such as - Count, Bytes, etc. Use the @@ -1872,7 +1824,7 @@ class SubRequest(Model): _attribute_map = { 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'SubRequestName'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'unit': {'key': 'unit', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'object'}, @@ -1891,34 +1843,6 @@ def __init__(self, *, name=None, unit: str=None, provisioning_state=None, **kwar self.sub_request_id = None -class SubRequestName(Model): - """The Resource name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar localized_value: Resource display name. - :vartype localized_value: str - :ivar value: Resource name. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SubRequestName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - class SubscriptionScopeProperties(Model): """SubscriptionScopeProperties. diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py index 5b8aa7eba994..df3cd32429b1 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_request_operations.py @@ -42,7 +42,9 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, **operation_config): + self, subscription_id, provider_id, location, resource_name, if_match, properties=None, custom_headers=None, raw=False, **operation_config): + create_quota_request = models.CurrentQuotaLimitBase(properties=properties) + # Construct URL url = self.create.metadata['url'] path_format_arguments = { @@ -93,20 +95,21 @@ def _create_initial( return deserialized def create( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, polling=True, **operation_config): + self, subscription_id, provider_id, location, resource_name, if_match, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): """Submits a Quota Request for a resource provider at the specified location for the specific resource in the parameter. Submits Quota change request for a resource provider for the specified location for the specific resource in the parameter. To use, first make - a Get request to get quota information. This information consists of a - list of resources and information regarding those resources. For all - the resources in that list which require an update to their quotas, - update their limit fields in the response from the Get request to their - new values. Then, submit this updated JSON object to this quota request - API. This will update the quota to the values specified. The location - header in the response will be used to track the status of the quota - request. Please check the provisioningState field in the response. + a Get request to get quota information for the specific resource. This + information consists of information regarding that specific resources. + For the specific resource, if it requires an update to the quota, + update the limit field in the response from the Get request to the new + value of quota. Then, submit this updated JSON object to this quota + request API. This will update the quota to the value specified. The + location header in the response will be used to track the status of the + quota request. Please check the provisioningState field in the + response. :param subscription_id: Azure subscription id. :type subscription_id: str @@ -118,13 +121,12 @@ def create( provider, such as SKU name for Microsoft.Compute, pool for Microsoft.Batch. :type resource_name: str - :param create_quota_request: Quota requests payload. - :type create_quota_request: - ~azure.mgmt.reservations.models.CurrentQuotaLimitBase :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.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 @@ -142,8 +144,8 @@ def create( provider_id=provider_id, location=location, resource_name=resource_name, - create_quota_request=create_quota_request, if_match=if_match, + properties=properties, custom_headers=custom_headers, raw=True, **operation_config @@ -169,7 +171,9 @@ def get_long_running_output(response): def _update_initial( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, **operation_config): + self, subscription_id, provider_id, location, resource_name, if_match, 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 = { @@ -220,20 +224,21 @@ def _update_initial( return deserialized def update( - self, subscription_id, provider_id, location, resource_name, create_quota_request, if_match, custom_headers=None, raw=False, polling=True, **operation_config): + self, subscription_id, provider_id, location, resource_name, if_match, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): """Submits a Quota Request for a resource provider at the specified location for the specific resource in the parameter. Submits Quota change request for a resource provider for the specified location for the specific resource in the parameter. To use, first make - a Get request to get quota information. This information consists of a - list of resources and information regarding those resources. For all - the resources in that list which require an update to their quotas, - update their limit fields in the response from the Get request to their - new values. Then, submit this updated JSON object to this quota request - API. This will update the quota to the values specified. The location - header in the response will be used to track the status of the quota - request. Please check the provisioningState field in the response. + a Get request to get quota information for the specific resource. This + information consists of information regarding that specific resources. + For the specific resource, if it requires an update to the quota, + update the limit field in the response from the Get request to the new + value of quota. Then, submit this updated JSON object to this quota + request API. This will update the quota to the value specified. The + location header in the response will be used to track the status of the + quota request. Please check the provisioningState field in the + response. :param subscription_id: Azure subscription id. :type subscription_id: str @@ -245,13 +250,12 @@ def update( provider, such as SKU name for Microsoft.Compute, pool for Microsoft.Batch. :type resource_name: str - :param create_quota_request: Quota requests payload. - :type create_quota_request: - ~azure.mgmt.reservations.models.CurrentQuotaLimitBase :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str + :param properties: Quota properties for the resource. + :type properties: ~azure.mgmt.reservations.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 @@ -269,8 +273,8 @@ def update( provider_id=provider_id, location=location, resource_name=resource_name, - create_quota_request=create_quota_request, if_match=if_match, + properties=properties, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py index 1ed7b7c9bb4f..c2eaa33c2744 100644 --- a/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py +++ b/sdk/reservations/azure-mgmt-reservations/azure/mgmt/reservations/operations/_quota_requests_operations.py @@ -43,8 +43,8 @@ def get_status( """Gets the Quota request status by requestId, for the specified resource provider at specified location. - Gets the QuotaRequest details and status by the quota requestId for the - resources for the resource provider at a specific location. The + Gets the QuotaRequest details and status by the quota request Id for + the resources for the resource provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits.