Skip to content

Commit

Permalink
[AutoRelease] t2-quota-2025-01-16-93059(can only be merged by SDK own…
Browse files Browse the repository at this point in the history
…er) (#39215)

* code and test

* update testcases

* Update CHANGELOG.md to remove method details

* Update changelog for quota operations changes

* Update release date in CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: ChenxiJiang333 <[email protected]>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent d38a8af commit 3919ebc
Show file tree
Hide file tree
Showing 113 changed files with 3,349 additions and 5,687 deletions.
70 changes: 70 additions & 0 deletions sdk/quota/azure-mgmt-quota/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
# Release History

## 2.0.0b2 (2025-01-22)

### Features Added

- Model `GroupQuotaDetails` added property `resource_name`
- Model `GroupQuotaLimitList` added property `properties`
- Model `GroupQuotaLimitList` added property `id`
- Model `GroupQuotaLimitList` added property `name`
- Model `GroupQuotaLimitList` added property `type`
- Model `GroupQuotaLimitList` added property `system_data`
- Model `SubscriptionQuotaAllocationsList` added property `properties`
- Model `SubscriptionQuotaAllocationsList` added property `id`
- Model `SubscriptionQuotaAllocationsList` added property `name`
- Model `SubscriptionQuotaAllocationsList` added property `type`
- Model `SubscriptionQuotaAllocationsList` added property `system_data`
- Model `SubscriptionQuotaDetails` added property `resource_name`
- Added model `GroupQuotaLimitListProperties`
- Added model `GroupQuotaLimitProperties`
- Added model `GroupQuotasEntityPatchProperties`
- Added model `GroupQuotasEntityProperties`
- Added model `SubscriptionQuotaAllocationsListProperties`
- Added model `SubscriptionQuotaAllocationsProperties`

### Breaking Changes

- Deleted or renamed client operation group `QuotaMgmtClient.group_quota_usages`
- Deleted or renamed client operation group `QuotaMgmtClient.group_quota_location_settings`
- Model `GroupQuotaDetails` deleted or renamed its instance variable `region`
- Model `GroupQuotaLimit` deleted or renamed its instance variable `id`
- Model `GroupQuotaLimit` deleted or renamed its instance variable `name`
- Model `GroupQuotaLimit` deleted or renamed its instance variable `type`
- Model `GroupQuotaLimit` deleted or renamed its instance variable `system_data`
- Model `GroupQuotaLimitList` deleted or renamed its instance variable `value`
- Model `GroupQuotaLimitList` deleted or renamed its instance variable `next_link`
- Model `GroupQuotasEntityBase` deleted or renamed its instance variable `additional_attributes`
- Model `GroupQuotasEntityBasePatch` deleted or renamed its instance variable `additional_attributes`
- Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `id`
- Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `name`
- Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `type`
- Model `SubscriptionQuotaAllocations` deleted or renamed its instance variable `system_data`
- Model `SubscriptionQuotaAllocationsList` deleted or renamed its instance variable `value`
- Model `SubscriptionQuotaAllocationsList` deleted or renamed its instance variable `next_link`
- Model `SubscriptionQuotaDetails` deleted or renamed its instance variable `region`
- Deleted or renamed model `AdditionalAttributes`
- Deleted or renamed model `AdditionalAttributesPatch`
- Deleted or renamed model `BillingAccountId`
- Deleted or renamed model `EnforcementState`
- Deleted or renamed model `EnvironmentType`
- Deleted or renamed model `GroupQuotasEnforcementListResponse`
- Deleted or renamed model `GroupQuotasEnforcementResponse`
- Deleted or renamed model `GroupQuotasEnforcementResponseProperties`
- Deleted or renamed model `GroupingId`
- Deleted or renamed model `GroupingIdType`
- Method `GroupQuotaLimitsOperations.list` inserted a `positional_or_keyword` parameter `location`
- Method `GroupQuotaLimitsOperations.list` deleted or renamed its parameter `filter` of kind `positional_or_keyword`
- Deleted or renamed method `GroupQuotaLimitsOperations.get`
- Method `GroupQuotaLimitsRequestOperations.begin_update` inserted a `positional_or_keyword` parameter `location`
- Method `GroupQuotaLimitsRequestOperations.begin_update` deleted or renamed its parameter `resource_name` of kind `positional_or_keyword`
- Deleted or renamed method `GroupQuotaLimitsRequestOperations.begin_create_or_update`
- Method `GroupQuotaSubscriptionAllocationOperations.list` inserted a `positional_or_keyword` parameter `resource_provider_name`
- Method `GroupQuotaSubscriptionAllocationOperations.list` inserted a `positional_or_keyword` parameter `location`
- Method `GroupQuotaSubscriptionAllocationOperations.list` deleted or renamed its parameter `filter` of kind `positional_or_keyword`
- Deleted or renamed method `GroupQuotaSubscriptionAllocationOperations.get`
- Method `GroupQuotaSubscriptionAllocationRequestOperations.begin_update` inserted a `positional_or_keyword` parameter `location`
- Method `GroupQuotaSubscriptionAllocationRequestOperations.begin_update` deleted or renamed its parameter `resource_name` of kind `positional_or_keyword`
- Method `GroupQuotaSubscriptionAllocationRequestOperations.get` inserted a `positional_or_keyword` parameter `resource_provider_name`
- Deleted or renamed method `GroupQuotaSubscriptionAllocationRequestOperations.begin_create_or_update`
- Deleted or renamed operation group `GroupQuotaLocationSettingsOperations`
- Deleted or renamed operation group `GroupQuotaUsagesOperations`

## 2.0.0b1 (2024-04-22)

### Features Added
Expand Down
8 changes: 4 additions & 4 deletions sdk/quota/azure-mgmt-quota/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "665e7c3b6f26b148b3c05e55602621bc293cc0a4",
"commit": "1b038fc40563bdafb343a71cd5f7d3dee6bc4b5b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.7",
"@autorest/python@6.27.4",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/quota/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/quota/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2024-12-18-preview --use=@autorest/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/quota/resource-manager/readme.md"
}
12 changes: 9 additions & 3 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._quota_mgmt_client import QuotaMgmtClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._quota_mgmt_client import QuotaMgmtClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"QuotaMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
7 changes: 3 additions & 4 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for QuotaMgmtClient.
Note that all parameters used to create this instance are saved as instance
Expand All @@ -28,13 +27,13 @@ class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attribu
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2023-06-01-preview")
api_version: str = kwargs.pop("api_version", "2024-12-18-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
37 changes: 12 additions & 25 deletions sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_quota_mgmt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -20,12 +21,10 @@
from .operations import (
GroupQuotaLimitsOperations,
GroupQuotaLimitsRequestOperations,
GroupQuotaLocationSettingsOperations,
GroupQuotaSubscriptionAllocationOperations,
GroupQuotaSubscriptionAllocationRequestOperations,
GroupQuotaSubscriptionRequestsOperations,
GroupQuotaSubscriptionsOperations,
GroupQuotaUsagesOperations,
GroupQuotasOperations,
QuotaOperationOperations,
QuotaOperations,
Expand All @@ -34,11 +33,10 @@
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes
"""Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota
Entity.
Expand All @@ -50,24 +48,19 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too
:ivar group_quota_subscription_requests: GroupQuotaSubscriptionRequestsOperations operations
:vartype group_quota_subscription_requests:
azure.mgmt.quota.operations.GroupQuotaSubscriptionRequestsOperations
:ivar group_quota_limits: GroupQuotaLimitsOperations operations
:vartype group_quota_limits: azure.mgmt.quota.operations.GroupQuotaLimitsOperations
:ivar group_quota_limits_request: GroupQuotaLimitsRequestOperations operations
:vartype group_quota_limits_request:
azure.mgmt.quota.operations.GroupQuotaLimitsRequestOperations
:ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations
operations
:vartype group_quota_subscription_allocation:
azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationOperations
:ivar group_quota_limits: GroupQuotaLimitsOperations operations
:vartype group_quota_limits: azure.mgmt.quota.operations.GroupQuotaLimitsOperations
:ivar group_quota_subscription_allocation_request:
GroupQuotaSubscriptionAllocationRequestOperations operations
:vartype group_quota_subscription_allocation_request:
azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationRequestOperations
:ivar group_quota_usages: GroupQuotaUsagesOperations operations
:vartype group_quota_usages: azure.mgmt.quota.operations.GroupQuotaUsagesOperations
:ivar group_quota_location_settings: GroupQuotaLocationSettingsOperations operations
:vartype group_quota_location_settings:
azure.mgmt.quota.operations.GroupQuotaLocationSettingsOperations
:ivar group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations
operations
:vartype group_quota_subscription_allocation:
azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationOperations
:ivar usages: UsagesOperations operations
:vartype usages: azure.mgmt.quota.operations.UsagesOperations
:ivar quota: QuotaOperations operations
Expand All @@ -82,7 +75,7 @@ class QuotaMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2024-12-18-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -128,22 +121,16 @@ def __init__(
self.group_quota_subscription_requests = GroupQuotaSubscriptionRequestsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_limits = GroupQuotaLimitsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_limits_request = GroupQuotaLimitsRequestOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations(
self.group_quota_limits = GroupQuotaLimitsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_subscription_allocation_request = GroupQuotaSubscriptionAllocationRequestOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_usages = GroupQuotaUsagesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.group_quota_location_settings = GroupQuotaLocationSettingsOperations(
self.group_quota_subscription_allocation = GroupQuotaSubscriptionAllocationOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down Expand Up @@ -178,7 +165,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "QuotaMgmtClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Loading

0 comments on commit 3919ebc

Please sign in to comment.