From 19cb4b18bd260035d41de1d7fc9cb1c48f790ea5 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 20 Aug 2026 15:24:38 +0000 Subject: [PATCH] Configurations: 'specification/quota/resource-manager/Microsoft.Quota/Quota/tspconfig.yaml', API Version: 2026-09-01-preview, SDK Release Type: beta, and CommitSHA: '409cf0ef77aaa992195b41e6b8a46b2c5f54f448' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6725994 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/quota/azure-mgmt-quota/CHANGELOG.md | 21 + sdk/quota/azure-mgmt-quota/README.md | 6 +- sdk/quota/azure-mgmt-quota/_metadata.json | 12 +- sdk/quota/azure-mgmt-quota/api.md | 3472 +++++++++++++++++ sdk/quota/azure-mgmt-quota/api.metadata.yml | 3 + .../azure-mgmt-quota/apiview-properties.json | 35 +- .../azure/mgmt/quota/_client.py | 25 +- .../azure/mgmt/quota/_configuration.py | 11 +- .../azure/mgmt/quota/_patch.py | 1 - .../azure/mgmt/quota/_utils/model_base.py | 734 +++- .../azure/mgmt/quota/_utils/serialization.py | 163 +- .../azure/mgmt/quota/_utils/utils.py | 40 + .../azure/mgmt/quota/_validation.py | 66 + .../azure/mgmt/quota/_version.py | 2 +- .../azure/mgmt/quota/aio/_client.py | 26 +- .../azure/mgmt/quota/aio/_configuration.py | 11 +- .../azure/mgmt/quota/aio/_patch.py | 1 - .../mgmt/quota/aio/operations/__init__.py | 4 + .../mgmt/quota/aio/operations/_operations.py | 2624 +++++++++++-- .../azure/mgmt/quota/aio/operations/_patch.py | 1 - .../azure/mgmt/quota/models/__init__.py | 24 + .../azure/mgmt/quota/models/_enums.py | 51 +- .../azure/mgmt/quota/models/_models.py | 674 +++- .../azure/mgmt/quota/models/_patch.py | 1 - .../azure/mgmt/quota/operations/__init__.py | 4 + .../mgmt/quota/operations/_operations.py | 3018 ++++++++++++-- .../azure/mgmt/quota/operations/_patch.py | 1 - .../azure/mgmt/quota/types.py | 855 ++++ .../delete_group_quota_subscriptions.py | 2 +- .../generated_samples/delete_group_quotas.py | 2 +- .../get_compute_one_sku_quota_limit.py | 2 +- .../get_compute_one_sku_usages.py | 2 +- .../get_compute_quota_limits.py | 2 +- .../generated_samples/get_compute_usages.py | 2 +- .../get_group_quota_enforcement.py | 2 +- .../get_group_quota_subscriptions.py | 2 +- .../get_group_quota_usages.py | 2 +- .../generated_samples/get_group_quotas.py | 2 +- ..._machine_learning_services_quota_limits.py | 2 +- .../get_machine_learning_services_usages.py | 2 +- .../get_network_one_sku_quota_limit.py | 2 +- .../get_network_one_sku_usages.py | 2 +- .../get_network_quota_limits.py | 2 +- .../generated_samples/get_network_usages.py | 2 +- .../generated_samples/get_operations.py | 40 + .../get_quota_request_status_by_id.py | 2 +- .../get_quota_request_status_failed.py | 2 +- .../get_quota_request_status_in_progress.py | 2 +- .../get_quota_requests_history.py | 2 +- .../group_quota_limits_requests_get.py | 2 +- .../group_quota_limits_requests_list.py | 2 +- .../incoming_quota_transfers_approve.py | 45 + .../incoming_quota_transfers_get.py | 43 + .../incoming_quota_transfers_list.py | 43 + ...ng_quota_transfers_list_by_subscription.py | 40 + .../incoming_quota_transfers_reject.py | 45 + .../list_group_quota_limits_compute.py | 2 +- .../list_group_quota_subscriptions.py | 2 +- .../generated_samples/list_group_quotas.py | 2 +- .../patch_compute_quota_request.py | 2 +- .../patch_group_quota_enforcement.py | 2 +- ...tch_group_quota_limits_requests_compute.py | 2 +- .../generated_samples/patch_group_quotas.py | 2 +- .../patch_group_quotas_subscription.py | 2 +- .../patch_network_one_sku_quota_request.py | 2 +- ...iption_quota_allocation_request_compute.py | 2 +- .../put_compute_one_sku_quota_request.py | 2 +- .../put_group_quota_enforcement.py | 2 +- .../put_group_quota_enforcement_failed.py | 2 +- .../generated_samples/put_group_quotas.py | 2 +- .../put_group_quotas_subscription.py | 2 +- ...ing_services_quota_request_low_priority.py | 2 +- .../put_network_one_sku_quota_request.py | 2 +- ...equest_standard_sku_public_ip_addresses.py | 2 +- .../quota_transfers_cancel.py | 43 + .../quota_transfers_create_or_update.py | 54 + ...transfers_create_or_update_auto_approve.py | 53 + .../quota_transfers_delete.py | 42 + .../generated_samples/quota_transfers_get.py | 43 + .../generated_samples/quota_transfers_list.py | 43 + ...scription_quota_allocation_list_compute.py | 2 +- ...n_quota_allocation_requests_get_compute.py | 2 +- ..._quota_allocation_requests_list_compute.py | 2 +- .../subscription_requests_get.py | 2 +- .../subscription_requests_list.py | 2 +- ...gmt_incoming_quota_transfers_operations.py | 78 + ...coming_quota_transfers_operations_async.py | 81 + .../test_quota_mgmt_quota_operations.py | 3 + .../test_quota_mgmt_quota_operations_async.py | 3 + ...ta_mgmt_quota_request_status_operations.py | 1 + ...t_quota_request_status_operations_async.py | 1 + ...t_quota_mgmt_quota_transfers_operations.py | 110 + ...a_mgmt_quota_transfers_operations_async.py | 113 + .../test_quota_mgmt_usages_operations.py | 1 + ...test_quota_mgmt_usages_operations_async.py | 1 + sdk/quota/azure-mgmt-quota/pyproject.toml | 10 +- sdk/quota/azure-mgmt-quota/tsp-location.yaml | 4 +- 97 files changed, 11961 insertions(+), 955 deletions(-) create mode 100644 sdk/quota/azure-mgmt-quota/api.md create mode 100644 sdk/quota/azure-mgmt-quota/api.metadata.yml create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/utils.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_validation.py create mode 100644 sdk/quota/azure-mgmt-quota/azure/mgmt/quota/types.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_approve.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_get.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list_by_subscription.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_reject.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_cancel.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update_auto_approve.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_delete.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_get.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_list.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations_async.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations.py create mode 100644 sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations_async.py diff --git a/sdk/quota/azure-mgmt-quota/CHANGELOG.md b/sdk/quota/azure-mgmt-quota/CHANGELOG.md index 5be370538256..522194f25762 100644 --- a/sdk/quota/azure-mgmt-quota/CHANGELOG.md +++ b/sdk/quota/azure-mgmt-quota/CHANGELOG.md @@ -1,5 +1,26 @@ # Release History +## 3.1.0b1 (2026-08-20) + +### Features Added + + - Client `QuotaMgmtClient` added operation group `incoming_quota_transfers` + - Client `QuotaMgmtClient` added operation group `quota_transfers` + - Added model `ApprovalRecord` + - Added model `CancellationRecord` + - Added model `IncomingQuotaTransfer` + - Added model `IncomingQuotaTransferApproveRequest` + - Added model `IncomingQuotaTransferProperties` + - Added model `IncomingQuotaTransferRejectRequest` + - Added model `QuotaTransfer` + - Added model `QuotaTransferCancelRequest` + - Added model `QuotaTransferProperties` + - Added model `RejectionRecord` + - Added enum `TransferProvisioningState` + - Added enum `TransferStatus` + - Added operation group `IncomingQuotaTransfersOperations` + - Added operation group `QuotaTransfersOperations` + ## 3.0.1 (2025-10-09) ### Bugs Fixed diff --git a/sdk/quota/azure-mgmt-quota/README.md b/sdk/quota/azure-mgmt-quota/README.md index f6127fb3c52d..6cfefd774aa0 100644 --- a/sdk/quota/azure-mgmt-quota/README.md +++ b/sdk/quota/azure-mgmt-quota/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Quota Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/quota/azure-mgmt-quota/_metadata.json b/sdk/quota/azure-mgmt-quota/_metadata.json index 591959aa75bd..5a2bcb32bdea 100644 --- a/sdk/quota/azure-mgmt-quota/_metadata.json +++ b/sdk/quota/azure-mgmt-quota/_metadata.json @@ -1,7 +1,11 @@ { - "apiVersion": "2025-09-01", - "commit": "f4d79a1a326481435d1240987885204b57ae5129", + "apiVersion": "2026-09-01-preview", + "apiVersions": { + "Microsoft.Quota": "2026-09-01-preview" + }, + "commit": "409cf0ef77aaa992195b41e6b8a46b2c5f54f448", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/quota/Quota.Management", - "emitterVersion": "0.50.0" + "typespec_src": "specification/quota/resource-manager/Microsoft.Quota/Quota", + "emitterVersion": "0.63.5", + "httpClientPythonVersion": "^0.36.0" } \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/api.md b/sdk/quota/azure-mgmt-quota/api.md new file mode 100644 index 000000000000..bb9120fd5ea4 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/api.md @@ -0,0 +1,3472 @@ +```py +namespace azure.mgmt.quota + + class azure.mgmt.quota.QuotaMgmtClient: implements ContextManager + group_quota_limits: GroupQuotaLimitsOperations + group_quota_limits_request: GroupQuotaLimitsRequestOperations + group_quota_location_settings: GroupQuotaLocationSettingsOperations + group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations + group_quota_subscription_allocation_request: GroupQuotaSubscriptionAllocationRequestOperations + group_quota_subscription_requests: GroupQuotaSubscriptionRequestsOperations + group_quota_subscriptions: GroupQuotaSubscriptionsOperations + group_quota_usages: GroupQuotaUsagesOperations + group_quotas: GroupQuotasOperations + incoming_quota_transfers: IncomingQuotaTransfersOperations + quota: QuotaOperations + quota_operation: QuotaOperationOperations + quota_request_status: QuotaRequestStatusOperations + quota_transfers: QuotaTransfersOperations + usages: UsagesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.quota.aio + + class azure.mgmt.quota.aio.QuotaMgmtClient: implements AsyncContextManager + group_quota_limits: GroupQuotaLimitsOperations + group_quota_limits_request: GroupQuotaLimitsRequestOperations + group_quota_location_settings: GroupQuotaLocationSettingsOperations + group_quota_subscription_allocation: GroupQuotaSubscriptionAllocationOperations + group_quota_subscription_allocation_request: GroupQuotaSubscriptionAllocationRequestOperations + group_quota_subscription_requests: GroupQuotaSubscriptionRequestsOperations + group_quota_subscriptions: GroupQuotaSubscriptionsOperations + group_quota_usages: GroupQuotaUsagesOperations + group_quotas: GroupQuotasOperations + incoming_quota_transfers: IncomingQuotaTransfersOperations + quota: QuotaOperations + quota_operation: QuotaOperationOperations + quota_request_status: QuotaRequestStatusOperations + quota_transfers: QuotaTransfersOperations + usages: UsagesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.quota.aio.operations + + class azure.mgmt.quota.aio.operations.GroupQuotaLimitsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> GroupQuotaLimitList: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaLimitsRequestOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[GroupQuotaLimitList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotaLimitList]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[GroupQuotaLimitList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotaLimitList]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotaLimitList]: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + request_id_parameter: str, + **kwargs: Any + ) -> SubmittedResourceRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + *, + filter: str, + **kwargs: Any + ) -> AsyncItemPaged[SubmittedResourceRequestStatus]: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaLocationSettingsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEnforcementStatus]: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> GroupQuotasEnforcementStatus: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionAllocationOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> SubscriptionQuotaAllocationsList: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionAllocationRequestOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: SubscriptionQuotaAllocationsList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubscriptionQuotaAllocationsList]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: SubscriptionQuotaAllocationsList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubscriptionQuotaAllocationsList]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SubscriptionQuotaAllocationsList]: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + allocation_id: str, + **kwargs: Any + ) -> QuotaAllocationRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + *, + filter: str, + **kwargs: Any + ) -> AsyncItemPaged[QuotaAllocationRequestStatus]: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionRequestsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + request_id_parameter: str, + **kwargs: Any + ) -> GroupQuotaSubscriptionRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncItemPaged[GroupQuotaSubscriptionRequestStatus]: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaSubscriptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotaSubscriptionId]: ... + + @distributed_trace_async + async def begin_delete( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotaSubscriptionId]: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> GroupQuotaSubscriptionId: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncItemPaged[GroupQuotaSubscriptionId]: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotaUsagesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> AsyncItemPaged[ResourceUsages]: ... + + + class azure.mgmt.quota.aio.operations.GroupQuotasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[GroupQuotasEntity] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[GroupQuotasEntity] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @overload + async def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @distributed_trace_async + async def begin_delete( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[GroupQuotasEntityPatch] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[GroupQuotasEntityPatch] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @overload + async def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[GroupQuotasEntity]: ... + + @distributed_trace_async + async def get( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> GroupQuotasEntity: ... + + @distributed_trace + def list( + self, + management_group_id: str, + **kwargs: Any + ) -> AsyncItemPaged[GroupQuotasEntity]: ... + + + class azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferApproveRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[IncomingQuotaTransfer]: ... + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferApproveRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[IncomingQuotaTransfer]: ... + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[IncomingQuotaTransfer]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_id', 'accept']}, api_versions_list=['2026-09-01-preview']) + async def get( + self, + target_provider: str, + region: str, + transfer_id: str, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list( + self, + target_provider: str, + region: str, + **kwargs: Any + ) -> AsyncItemPaged[IncomingQuotaTransfer]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[IncomingQuotaTransfer]: ... + + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferRejectRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferRejectRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + + class azure.mgmt.quota.aio.operations.QuotaOperationOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[OperationResponse]: ... + + + class azure.mgmt.quota.aio.operations.QuotaOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @overload + async def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @overload + async def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @overload + async def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @overload + async def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @overload + async def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CurrentQuotaLimitBase]: ... + + @distributed_trace_async + async def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> CurrentQuotaLimitBase: ... + + @distributed_trace + def list( + self, + scope: str, + **kwargs: Any + ) -> AsyncItemPaged[CurrentQuotaLimitBase]: ... + + + class azure.mgmt.quota.aio.operations.QuotaRequestStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + id: str, + scope: str, + **kwargs: Any + ) -> QuotaRequestDetails: ... + + @distributed_trace + def list( + self, + scope: str, + *, + filter: Optional[str] = ..., + skiptoken: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[QuotaRequestDetails]: ... + + + class azure.mgmt.quota.aio.operations.QuotaTransfersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[QuotaTransfer]: ... + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[QuotaTransfer]: ... + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[QuotaTransfer]: ... + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_name']}, api_versions_list=['2026-09-01-preview']) + async def delete( + self, + target_provider: str, + region: str, + transfer_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_name', 'accept']}, api_versions_list=['2026-09-01-preview']) + async def get( + self, + target_provider: str, + region: str, + transfer_name: str, + **kwargs: Any + ) -> QuotaTransfer: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list( + self, + target_provider: str, + region: str, + **kwargs: Any + ) -> AsyncItemPaged[QuotaTransfer]: ... + + + class azure.mgmt.quota.aio.operations.UsagesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> CurrentUsagesBase: ... + + @distributed_trace + def list( + self, + scope: str, + **kwargs: Any + ) -> AsyncItemPaged[CurrentUsagesBase]: ... + + +namespace azure.mgmt.quota.models + + class azure.mgmt.quota.models.AllocatedQuotaToSubscriptionList(_Model): + value: Optional[list[AllocatedToSubscription]] + + @overload + def __init__( + self, + *, + value: Optional[list[AllocatedToSubscription]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.AllocatedToSubscription(_Model): + quota_allocated: Optional[int] + subscription_id: Optional[str] + + @overload + def __init__( + self, + *, + quota_allocated: Optional[int] = ..., + subscription_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ApprovalRecord(_Model): + actor: str + comment: Optional[str] + occurred_at: datetime + + @overload + def __init__( + self, + *, + actor: str, + comment: Optional[str] = ..., + occurred_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.CancellationRecord(_Model): + actor: str + occurred_at: datetime + reason: Optional[str] + + @overload + def __init__( + self, + *, + actor: str, + occurred_at: datetime, + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.quota.models.CurrentQuotaLimitBase(ExtensionResource): + id: str + name: str + properties: Optional[QuotaProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[QuotaProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.CurrentUsagesBase(ExtensionResource): + id: str + name: str + properties: Optional[UsagesProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[UsagesProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.EnforcementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + NOT_AVAILABLE = "NotAvailable" + + + class azure.mgmt.quota.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.quota.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.quota.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ExceptionResponse(_Model): + error: Optional[ServiceError] + + @overload + def __init__( + self, + *, + error: Optional[ServiceError] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ExtensionResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.quota.models.GroupQuotaDetails(_Model): + allocated_to_subscriptions: Optional[AllocatedQuotaToSubscriptionList] + available_limit: Optional[int] + comment: Optional[str] + limit: Optional[int] + name: Optional[GroupQuotaDetailsName] + resource_name: Optional[str] + unit: Optional[str] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + comment: Optional[str] = ..., + limit: Optional[int] = ..., + resource_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaDetailsName(_Model): + localized_value: Optional[str] + value: Optional[str] + + + class azure.mgmt.quota.models.GroupQuotaLimit(_Model): + properties: Optional[GroupQuotaLimitProperties] + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaLimitProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaLimitList(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotaLimitListProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaLimitListProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaLimitListProperties(_Model): + next_link: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + value: Optional[list[GroupQuotaLimit]] + + @overload + def __init__( + self, + *, + value: Optional[list[GroupQuotaLimit]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaLimitProperties(GroupQuotaDetails): + allocated_to_subscriptions: AllocatedQuotaToSubscriptionList + available_limit: int + comment: str + limit: int + name: GroupQuotaDetailsName + resource_name: str + unit: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + comment: Optional[str] = ..., + limit: Optional[int] = ..., + resource_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaRequestBase(_Model): + properties: Optional[GroupQuotaRequestBaseProperties] + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaRequestBaseProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaRequestBaseProperties(_Model): + comments: Optional[str] + limit: Optional[int] + name: Optional[GroupQuotaRequestBasePropertiesName] + region: Optional[str] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + comments: Optional[str] = ..., + limit: Optional[int] = ..., + region: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaRequestBasePropertiesName(_Model): + localized_value: Optional[str] + value: Optional[str] + + + class azure.mgmt.quota.models.GroupQuotaSubscriptionId(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotaSubscriptionIdProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaSubscriptionIdProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaSubscriptionIdProperties(_Model): + provisioning_state: Optional[Union[str, RequestState]] + subscription_id: Optional[str] + + @overload + def __init__( + self, + *, + subscription_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaSubscriptionRequestStatus(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotaSubscriptionRequestStatusProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaSubscriptionRequestStatusProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaSubscriptionRequestStatusProperties(_Model): + provisioning_state: Optional[Union[str, RequestState]] + request_submit_time: Optional[datetime] + subscription_id: Optional[str] + + @overload + def __init__( + self, + *, + request_submit_time: Optional[datetime] = ..., + subscription_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaUsagesBase(_Model): + limit: Optional[int] + name: Optional[GroupQuotaUsagesBaseName] + unit: Optional[str] + usages: Optional[int] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + name: Optional[GroupQuotaUsagesBaseName] = ..., + usages: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotaUsagesBaseName(_Model): + localized_value: Optional[str] + value: Optional[str] + + @overload + def __init__( + self, + *, + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEnforcementStatus(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotasEnforcementStatusProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotasEnforcementStatusProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEnforcementStatusProperties(_Model): + enforced_group_name: Optional[str] + enforcement_enabled: Optional[Union[str, EnforcementState]] + fault_code: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + + @overload + def __init__( + self, + *, + enforcement_enabled: Optional[Union[str, EnforcementState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntity(ExtensionResource): + id: str + name: str + properties: Optional[GroupQuotasEntityProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotasEntityProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntityBase(_Model): + display_name: Optional[str] + group_type: Optional[Union[str, GroupType]] + provisioning_state: Optional[Union[str, RequestState]] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntityBasePatch(_Model): + display_name: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntityPatch(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotasEntityPatchProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotasEntityPatchProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntityPatchProperties(GroupQuotasEntityBasePatch): + display_name: str + provisioning_state: Union[str, RequestState] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupQuotasEntityProperties(GroupQuotasEntityBase): + display_name: str + group_type: Union[str, GroupType] + provisioning_state: Union[str, RequestState] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.GroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOCATION_GROUP = "AllocationGroup" + ENFORCED_GROUP = "EnforcedGroup" + + + class azure.mgmt.quota.models.IncomingQuotaTransfer(ProxyResource): + etag: Optional[str] + id: str + name: str + properties: Optional[IncomingQuotaTransferProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[IncomingQuotaTransferProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest(_Model): + comment: Optional[str] + + @overload + def __init__( + self, + *, + comment: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.IncomingQuotaTransferProperties(_Model): + amount: Optional[int] + approval: Optional[ApprovalRecord] + billing_account_id: Optional[str] + provisioning_state: Optional[Union[str, TransferProvisioningState]] + rejection: Optional[RejectionRecord] + resource_name: Optional[str] + source_etag: Optional[str] + source_subscription_id: Optional[str] + source_tenant_id: Optional[str] + transfer_id: Optional[str] + transfer_ref: Optional[str] + transfer_status: Optional[Union[str, TransferStatus]] + + + class azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest(_Model): + reason: Optional[str] + + @overload + def __init__( + self, + *, + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.LimitJsonObject(_Model): + limit_object_type: str + + @overload + def __init__( + self, + *, + limit_object_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.LimitObject(LimitJsonObject, discriminator='LimitValue'): + limit_object_type: Literal[LimitType.LIMIT_VALUE] + limit_type: Optional[Union[str, QuotaLimitTypes]] + value: int + + @overload + def __init__( + self, + *, + limit_type: Optional[Union[str, QuotaLimitTypes]] = ..., + value: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.LimitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIMIT_VALUE = "LimitValue" + + + class azure.mgmt.quota.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + operation: Optional[str] = ..., + provider: Optional[str] = ..., + resource: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.OperationResponse(_Model): + display: Optional[OperationDisplay] + name: Optional[str] + origin: Optional[str] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ..., + name: Optional[str] = ..., + origin: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.quota.models.QuotaAllocationRequestBase(_Model): + properties: Optional[QuotaAllocationRequestBaseProperties] + + @overload + def __init__( + self, + *, + properties: Optional[QuotaAllocationRequestBaseProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaAllocationRequestBaseProperties(_Model): + limit: Optional[int] + name: Optional[QuotaAllocationRequestBasePropertiesName] + region: Optional[str] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + region: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.QuotaAllocationRequestBasePropertiesName(_Model): + localized_value: Optional[str] + value: Optional[str] + + + class azure.mgmt.quota.models.QuotaAllocationRequestStatus(ExtensionResource): + id: str + name: str + properties: Optional[QuotaAllocationRequestStatusProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[QuotaAllocationRequestStatusProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.QuotaAllocationRequestStatusProperties(_Model): + fault_code: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + request_submit_time: Optional[datetime] + requested_resource: Optional[QuotaAllocationRequestBase] + + @overload + def __init__( + self, + *, + requested_resource: Optional[QuotaAllocationRequestBase] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaLimitTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INDEPENDENT = "Independent" + SHARED = "Shared" + + + class azure.mgmt.quota.models.QuotaProperties(_Model): + is_quota_applicable: Optional[bool] + limit: Optional[LimitJsonObject] + name: Optional[ResourceName] + properties: Optional[Any] + quota_period: Optional[str] + resource_type: Optional[str] + unit: Optional[str] + + @overload + def __init__( + self, + *, + limit: Optional[LimitJsonObject] = ..., + name: Optional[ResourceName] = ..., + properties: Optional[Any] = ..., + resource_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaRequestDetails(ExtensionResource): + id: str + name: str + properties: Optional[QuotaRequestProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[QuotaRequestProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.QuotaRequestProperties(_Model): + error: Optional[ServiceErrorDetail] + message: Optional[str] + provisioning_state: Optional[Union[str, QuotaRequestState]] + request_submit_time: Optional[datetime] + value: Optional[list[SubRequest]] + + @overload + def __init__( + self, + *, + error: Optional[ServiceErrorDetail] = ..., + value: Optional[list[SubRequest]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaRequestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + FAILED = "Failed" + INVALID = "Invalid" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.quota.models.QuotaTransfer(ProxyResource): + etag: Optional[str] + id: str + name: str + properties: Optional[QuotaTransferProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[QuotaTransferProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaTransferCancelRequest(_Model): + reason: Optional[str] + + @overload + def __init__( + self, + *, + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.QuotaTransferProperties(_Model): + amount: int + approval: Optional[ApprovalRecord] + auto_approve: Optional[bool] + billing_account_id: str + cancellation: Optional[CancellationRecord] + comment: Optional[str] + created_at: Optional[datetime] + created_by: Optional[str] + destination_subscription_id: str + destination_tenant_id: Optional[str] + display_name: str + expires_at: Optional[datetime] + provisioning_state: Optional[Union[str, TransferProvisioningState]] + resource_name: str + transfer_id: Optional[str] + transfer_status: Optional[Union[str, TransferStatus]] + + @overload + def __init__( + self, + *, + amount: int, + auto_approve: Optional[bool] = ..., + billing_account_id: str, + comment: Optional[str] = ..., + destination_subscription_id: str, + display_name: str, + resource_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.RejectionRecord(_Model): + actor: str + occurred_at: datetime + reason: Optional[str] + + @overload + def __init__( + self, + *, + actor: str, + occurred_at: datetime, + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.RequestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + CREATED = "Created" + ESCALATED = "Escalated" + FAILED = "Failed" + INVALID = "Invalid" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.quota.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.quota.models.ResourceName(_Model): + localized_value: Optional[str] + value: Optional[str] + + @overload + def __init__( + self, + *, + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ResourceUsages(ProxyResource): + id: str + name: str + properties: Optional[GroupQuotaUsagesBase] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[GroupQuotaUsagesBase] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ServiceError(_Model): + code: Optional[str] + details: Optional[list[ServiceErrorDetail]] + message: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.ServiceErrorDetail(_Model): + code: Optional[str] + message: Optional[str] + + + class azure.mgmt.quota.models.SubRequest(_Model): + limit: Optional[LimitJsonObject] + message: Optional[str] + name: Optional[ResourceName] + provisioning_state: Optional[Union[str, QuotaRequestState]] + resource_type: Optional[str] + sub_request_id: Optional[str] + unit: Optional[str] + + @overload + def __init__( + self, + *, + limit: Optional[LimitJsonObject] = ..., + name: Optional[ResourceName] = ..., + unit: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubmittedResourceRequestStatus(ProxyResource): + id: str + name: str + properties: Optional[SubmittedResourceRequestStatusProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SubmittedResourceRequestStatusProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubmittedResourceRequestStatusProperties(_Model): + fault_code: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + request_submit_time: Optional[datetime] + requested_resource: Optional[GroupQuotaRequestBase] + + @overload + def __init__( + self, + *, + requested_resource: Optional[GroupQuotaRequestBase] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaAllocations(_Model): + properties: Optional[SubscriptionQuotaAllocationsProperties] + + @overload + def __init__( + self, + *, + properties: Optional[SubscriptionQuotaAllocationsProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaAllocationsList(ExtensionResource): + id: str + name: str + properties: Optional[SubscriptionQuotaAllocationsListProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SubscriptionQuotaAllocationsListProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaAllocationsListProperties(_Model): + next_link: Optional[str] + provisioning_state: Optional[Union[str, RequestState]] + value: Optional[list[SubscriptionQuotaAllocations]] + + @overload + def __init__( + self, + *, + value: Optional[list[SubscriptionQuotaAllocations]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaAllocationsProperties(SubscriptionQuotaDetails): + limit: int + name: SubscriptionQuotaDetailsName + resource_name: str + shareable_quota: int + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + resource_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaDetails(_Model): + limit: Optional[int] + name: Optional[SubscriptionQuotaDetailsName] + resource_name: Optional[str] + shareable_quota: Optional[int] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + limit: Optional[int] = ..., + resource_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.quota.models.SubscriptionQuotaDetailsName(_Model): + localized_value: Optional[str] + value: Optional[str] + + + class azure.mgmt.quota.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.TransferProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.quota.models.TransferStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELLED = "Cancelled" + COMPLETED = "Completed" + EXPIRED = "Expired" + FAILED = "Failed" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.quota.models.UsagesObject(_Model): + usages_type: Optional[Union[str, UsagesTypes]] + value: int + + @overload + def __init__( + self, + *, + usages_type: Optional[Union[str, UsagesTypes]] = ..., + value: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.UsagesProperties(_Model): + is_quota_applicable: Optional[bool] + name: Optional[ResourceName] + properties: Optional[Any] + quota_period: Optional[str] + resource_type: Optional[str] + unit: Optional[str] + usages: Optional[UsagesObject] + + @overload + def __init__( + self, + *, + name: Optional[ResourceName] = ..., + properties: Optional[Any] = ..., + resource_type: Optional[str] = ..., + usages: Optional[UsagesObject] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.quota.models.UsagesTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMBINED = "Combined" + INDIVIDUAL = "Individual" + + +namespace azure.mgmt.quota.operations + + class azure.mgmt.quota.operations.GroupQuotaLimitsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> GroupQuotaLimitList: ... + + + class azure.mgmt.quota.operations.GroupQuotaLimitsRequestOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[GroupQuotaLimitList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotaLimitList]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[GroupQuotaLimitList] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotaLimitList]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + group_quota_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotaLimitList]: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + request_id_parameter: str, + **kwargs: Any + ) -> SubmittedResourceRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + *, + filter: str, + **kwargs: Any + ) -> ItemPaged[SubmittedResourceRequestStatus]: ... + + + class azure.mgmt.quota.operations.GroupQuotaLocationSettingsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[GroupQuotasEnforcementStatus] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + location_settings: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEnforcementStatus]: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> GroupQuotasEnforcementStatus: ... + + + class azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> SubscriptionQuotaAllocationsList: ... + + + class azure.mgmt.quota.operations.GroupQuotaSubscriptionAllocationRequestOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: SubscriptionQuotaAllocationsList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SubscriptionQuotaAllocationsList]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: SubscriptionQuotaAllocationsList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SubscriptionQuotaAllocationsList]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + allocate_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SubscriptionQuotaAllocationsList]: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + allocation_id: str, + **kwargs: Any + ) -> QuotaAllocationRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + *, + filter: str, + **kwargs: Any + ) -> ItemPaged[QuotaAllocationRequestStatus]: ... + + + class azure.mgmt.quota.operations.GroupQuotaSubscriptionRequestsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + request_id_parameter: str, + **kwargs: Any + ) -> GroupQuotaSubscriptionRequestStatus: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> ItemPaged[GroupQuotaSubscriptionRequestStatus]: ... + + + class azure.mgmt.quota.operations.GroupQuotaSubscriptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> LROPoller[GroupQuotaSubscriptionId]: ... + + @distributed_trace + def begin_delete( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> LROPoller[GroupQuotaSubscriptionId]: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> GroupQuotaSubscriptionId: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> ItemPaged[GroupQuotaSubscriptionId]: ... + + + class azure.mgmt.quota.operations.GroupQuotaUsagesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + management_group_id: str, + group_quota_name: str, + resource_provider_name: str, + location: str, + **kwargs: Any + ) -> ItemPaged[ResourceUsages]: ... + + + class azure.mgmt.quota.operations.GroupQuotasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[GroupQuotasEntity] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[GroupQuotasEntity] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @overload + def begin_create_or_update( + self, + management_group_id: str, + group_quota_name: str, + group_quota_put_request_body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @distributed_trace + def begin_delete( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[GroupQuotasEntityPatch] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[GroupQuotasEntityPatch] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @overload + def begin_update( + self, + management_group_id: str, + group_quota_name: str, + group_quotas_patch_request_body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[GroupQuotasEntity]: ... + + @distributed_trace + def get( + self, + management_group_id: str, + group_quota_name: str, + **kwargs: Any + ) -> GroupQuotasEntity: ... + + @distributed_trace + def list( + self, + management_group_id: str, + **kwargs: Any + ) -> ItemPaged[GroupQuotasEntity]: ... + + + class azure.mgmt.quota.operations.IncomingQuotaTransfersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferApproveRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[IncomingQuotaTransfer]: ... + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferApproveRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[IncomingQuotaTransfer]: ... + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[IncomingQuotaTransfer]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_id', 'accept']}, api_versions_list=['2026-09-01-preview']) + def get( + self, + target_provider: str, + region: str, + transfer_id: str, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list( + self, + target_provider: str, + region: str, + **kwargs: Any + ) -> ItemPaged[IncomingQuotaTransfer]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[IncomingQuotaTransfer]: ... + + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferRejectRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IncomingQuotaTransferRejectRequest] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> IncomingQuotaTransfer: ... + + + class azure.mgmt.quota.operations.QuotaOperationOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[OperationResponse]: ... + + + class azure.mgmt.quota.operations.QuotaOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @overload + def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @overload + def begin_create_or_update( + self, + resource_name: str, + scope: str, + create_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @overload + def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @overload + def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: CurrentQuotaLimitBase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @overload + def begin_update( + self, + resource_name: str, + scope: str, + create_quota_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CurrentQuotaLimitBase]: ... + + @distributed_trace + def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> CurrentQuotaLimitBase: ... + + @distributed_trace + def list( + self, + scope: str, + **kwargs: Any + ) -> ItemPaged[CurrentQuotaLimitBase]: ... + + + class azure.mgmt.quota.operations.QuotaRequestStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + id: str, + scope: str, + **kwargs: Any + ) -> QuotaRequestDetails: ... + + @distributed_trace + def list( + self, + scope: str, + *, + filter: Optional[str] = ..., + skiptoken: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[QuotaRequestDetails]: ... + + + class azure.mgmt.quota.operations.QuotaTransfersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[QuotaTransfer]: ... + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[QuotaTransfer]: ... + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[QuotaTransfer]: ... + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTransfer: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_name']}, api_versions_list=['2026-09-01-preview']) + def delete( + self, + target_provider: str, + region: str, + transfer_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'transfer_name', 'accept']}, api_versions_list=['2026-09-01-preview']) + def get( + self, + target_provider: str, + region: str, + transfer_name: str, + **kwargs: Any + ) -> QuotaTransfer: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-09-01-preview', params_added_on={'2026-09-01-preview': ['api_version', 'subscription_id', 'target_provider', 'region', 'accept']}, api_versions_list=['2026-09-01-preview']) + def list( + self, + target_provider: str, + region: str, + **kwargs: Any + ) -> ItemPaged[QuotaTransfer]: ... + + + class azure.mgmt.quota.operations.UsagesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_name: str, + scope: str, + **kwargs: Any + ) -> CurrentUsagesBase: ... + + @distributed_trace + def list( + self, + scope: str, + **kwargs: Any + ) -> ItemPaged[CurrentUsagesBase]: ... + + +namespace azure.mgmt.quota.types + + class azure.mgmt.quota.types.AllocatedQuotaToSubscriptionList(TypedDict, total=False): + value: list[AllocatedToSubscription] + + + class azure.mgmt.quota.types.AllocatedToSubscription(TypedDict, total=False): + key "quotaAllocated": int + key "subscriptionId": str + quotaAllocated: int + subscriptionId: str + + + class azure.mgmt.quota.types.ApprovalRecord(TypedDict, total=False): + key "actor": Required[str] + key "comment": str + key "occurredAt": Required[str] + actor: str + comment: str + occurredAt: str + + + class azure.mgmt.quota.types.CancellationRecord(TypedDict, total=False): + key "actor": Required[str] + key "occurredAt": Required[str] + key "reason": str + actor: str + occurredAt: str + reason: str + + + class azure.mgmt.quota.types.CurrentQuotaLimitBase(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('QuotaProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: QuotaProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.ExtensionResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.GroupQuotaDetails(TypedDict, total=False): + key "allocatedToSubscriptions": ForwardRef('AllocatedQuotaToSubscriptionList', module='types') + key "availableLimit": int + key "comment": str + key "limit": int + key "name": ForwardRef('GroupQuotaDetailsName', module='types') + key "resourceName": str + key "unit": str + allocatedToSubscriptions: AllocatedQuotaToSubscriptionList + availableLimit: int + comment: str + limit: int + name: GroupQuotaDetailsName + resourceName: str + unit: str + + + class azure.mgmt.quota.types.GroupQuotaDetailsName(TypedDict, total=False): + key "localizedValue": str + key "value": str + localizedValue: str + value: str + + + class azure.mgmt.quota.types.GroupQuotaLimit(TypedDict, total=False): + key "properties": ForwardRef('GroupQuotaLimitProperties', module='types') + properties: GroupQuotaLimitProperties + + + class azure.mgmt.quota.types.GroupQuotaLimitList(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('GroupQuotaLimitListProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: GroupQuotaLimitListProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.GroupQuotaLimitListProperties(TypedDict, total=False): + key "nextLink": str + key "provisioningState": Union[str, RequestState] + nextLink: str + provisioningState: Union[str, RequestState] + value: list[GroupQuotaLimit] + + + class azure.mgmt.quota.types.GroupQuotaLimitProperties(GroupQuotaDetails): + key "allocatedToSubscriptions": ForwardRef('AllocatedQuotaToSubscriptionList', module='types') + key "availableLimit": int + key "comment": str + key "limit": int + key "name": ForwardRef('GroupQuotaDetailsName', module='types') + key "resourceName": str + key "unit": str + allocatedToSubscriptions: AllocatedQuotaToSubscriptionList + availableLimit: int + comment: str + limit: int + name: GroupQuotaDetailsName + resourceName: str + unit: str + + + class azure.mgmt.quota.types.GroupQuotasEnforcementStatus(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('GroupQuotasEnforcementStatusProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: GroupQuotasEnforcementStatusProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.GroupQuotasEnforcementStatusProperties(TypedDict, total=False): + key "enforcedGroupName": str + key "enforcementEnabled": Union[str, EnforcementState] + key "faultCode": str + key "provisioningState": Union[str, RequestState] + enforcedGroupName: str + enforcementEnabled: Union[str, EnforcementState] + faultCode: str + provisioningState: Union[str, RequestState] + + + class azure.mgmt.quota.types.GroupQuotasEntity(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('GroupQuotasEntityProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: GroupQuotasEntityProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.GroupQuotasEntityBase(TypedDict, total=False): + key "displayName": str + key "groupType": Union[str, GroupType] + key "provisioningState": Union[str, RequestState] + displayName: str + groupType: Union[str, GroupType] + provisioningState: Union[str, RequestState] + + + class azure.mgmt.quota.types.GroupQuotasEntityBasePatch(TypedDict, total=False): + key "displayName": str + key "provisioningState": Union[str, RequestState] + displayName: str + provisioningState: Union[str, RequestState] + + + class azure.mgmt.quota.types.GroupQuotasEntityPatch(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('GroupQuotasEntityPatchProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: GroupQuotasEntityPatchProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.GroupQuotasEntityPatchProperties(GroupQuotasEntityBasePatch): + key "displayName": str + key "provisioningState": Union[str, RequestState] + displayName: str + provisioningState: Union[str, RequestState] + + + class azure.mgmt.quota.types.GroupQuotasEntityProperties(GroupQuotasEntityBase): + key "displayName": str + key "groupType": Union[str, GroupType] + key "provisioningState": Union[str, RequestState] + displayName: str + groupType: Union[str, GroupType] + provisioningState: Union[str, RequestState] + + + class azure.mgmt.quota.types.IncomingQuotaTransferApproveRequest(TypedDict, total=False): + key "comment": str + comment: str + + + class azure.mgmt.quota.types.IncomingQuotaTransferRejectRequest(TypedDict, total=False): + key "reason": str + reason: str + + + class azure.mgmt.quota.types.LimitJsonObject(TypedDict, total=False): + key "limitObjectType": Required[Literal[LimitType.LIMIT_VALUE]] + key "limitType": Union[str, QuotaLimitTypes] + key "value": Required[int] + limitObjectType: Literal[LimitType.LIMIT_VALUE] + limitType: Union[str, QuotaLimitTypes] + value: int + + + class azure.mgmt.quota.types.LimitObject(TypedDict, total=False): + key "limitObjectType": Required[Literal[LimitType.LIMIT_VALUE]] + key "limitType": Union[str, QuotaLimitTypes] + key "value": Required[int] + limitObjectType: Literal[LimitType.LIMIT_VALUE] + limitType: Union[str, QuotaLimitTypes] + value: int + + + class azure.mgmt.quota.types.LimitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LIMIT_VALUE = "LimitValue" + + + class azure.mgmt.quota.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.QuotaProperties(TypedDict, total=False): + key "isQuotaApplicable": bool + key "limit": ForwardRef('LimitJsonObject', module='types') + key "name": ForwardRef('ResourceName', module='types') + key "properties": Any + key "quotaPeriod": str + key "resourceType": str + key "unit": str + isQuotaApplicable: bool + limit: LimitJsonObject + name: ResourceName + properties: Any + quotaPeriod: str + resourceType: str + unit: str + + + class azure.mgmt.quota.types.QuotaTransfer(ProxyResource): + key "etag": str + key "id": str + key "name": str + key "properties": ForwardRef('QuotaTransferProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + etag: str + id: str + name: str + properties: QuotaTransferProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.QuotaTransferCancelRequest(TypedDict, total=False): + key "reason": str + reason: str + + + class azure.mgmt.quota.types.QuotaTransferProperties(TypedDict, total=False): + key "amount": Required[int] + key "approval": ForwardRef('ApprovalRecord', module='types') + key "autoApprove": bool + key "billingAccountId": Required[str] + key "cancellation": ForwardRef('CancellationRecord', module='types') + key "comment": str + key "createdAt": str + key "createdBy": str + key "destinationSubscriptionId": Required[str] + key "destinationTenantId": str + key "displayName": Required[str] + key "expiresAt": str + key "provisioningState": Union[str, TransferProvisioningState] + key "resourceName": Required[str] + key "transferId": str + key "transferStatus": Union[str, TransferStatus] + amount: int + approval: ApprovalRecord + autoApprove: bool + billingAccountId: str + cancellation: CancellationRecord + comment: str + createdAt: str + createdBy: str + destinationSubscriptionId: str + destinationTenantId: str + displayName: str + expiresAt: str + provisioningState: Union[str, TransferProvisioningState] + resourceName: str + transferId: str + transferStatus: Union[str, TransferStatus] + + + class azure.mgmt.quota.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.ResourceName(TypedDict, total=False): + key "localizedValue": str + key "value": str + localizedValue: str + value: str + + + class azure.mgmt.quota.types.SubscriptionQuotaAllocations(TypedDict, total=False): + key "properties": ForwardRef('SubscriptionQuotaAllocationsProperties', module='types') + properties: SubscriptionQuotaAllocationsProperties + + + class azure.mgmt.quota.types.SubscriptionQuotaAllocationsList(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('SubscriptionQuotaAllocationsListProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SubscriptionQuotaAllocationsListProperties + systemData: SystemData + type: str + + + class azure.mgmt.quota.types.SubscriptionQuotaAllocationsListProperties(TypedDict, total=False): + key "nextLink": str + key "provisioningState": Union[str, RequestState] + nextLink: str + provisioningState: Union[str, RequestState] + value: list[SubscriptionQuotaAllocations] + + + class azure.mgmt.quota.types.SubscriptionQuotaAllocationsProperties(SubscriptionQuotaDetails): + key "limit": int + key "name": ForwardRef('SubscriptionQuotaDetailsName', module='types') + key "resourceName": str + key "shareableQuota": int + limit: int + name: SubscriptionQuotaDetailsName + resourceName: str + shareableQuota: int + + + class azure.mgmt.quota.types.SubscriptionQuotaDetails(TypedDict, total=False): + key "limit": int + key "name": ForwardRef('SubscriptionQuotaDetailsName', module='types') + key "resourceName": str + key "shareableQuota": int + limit: int + name: SubscriptionQuotaDetailsName + resourceName: str + shareableQuota: int + + + class azure.mgmt.quota.types.SubscriptionQuotaDetailsName(TypedDict, total=False): + key "localizedValue": str + key "value": str + localizedValue: str + value: str + + + class azure.mgmt.quota.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + +``` \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/api.metadata.yml b/sdk/quota/azure-mgmt-quota/api.metadata.yml new file mode 100644 index 000000000000..8b5e02b59660 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: c84581184c390f4cf277bad39937d5482fd8449270dede3e6b9e8eb0ee099382 +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/quota/azure-mgmt-quota/apiview-properties.json b/sdk/quota/azure-mgmt-quota/apiview-properties.json index 56609d443b9b..43f2358f60e7 100644 --- a/sdk/quota/azure-mgmt-quota/apiview-properties.json +++ b/sdk/quota/azure-mgmt-quota/apiview-properties.json @@ -3,6 +3,8 @@ "CrossLanguageDefinitionId": { "azure.mgmt.quota.models.AllocatedQuotaToSubscriptionList": "Microsoft.Quota.AllocatedQuotaToSubscriptionList", "azure.mgmt.quota.models.AllocatedToSubscription": "Microsoft.Quota.AllocatedToSubscription", + "azure.mgmt.quota.models.ApprovalRecord": "Microsoft.Quota.ApprovalRecord", + "azure.mgmt.quota.models.CancellationRecord": "Microsoft.Quota.CancellationRecord", "azure.mgmt.quota.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.quota.models.ExtensionResource": "Azure.ResourceManager.CommonTypes.ExtensionResource", "azure.mgmt.quota.models.CurrentQuotaLimitBase": "Microsoft.Quota.CurrentQuotaLimitBase", @@ -35,6 +37,10 @@ "azure.mgmt.quota.models.GroupQuotaSubscriptionRequestStatusProperties": "Microsoft.Quota.GroupQuotaSubscriptionRequestStatusProperties", "azure.mgmt.quota.models.GroupQuotaUsagesBase": "Microsoft.Quota.GroupQuotaUsagesBase", "azure.mgmt.quota.models.GroupQuotaUsagesBaseName": "Microsoft.Quota.GroupQuotaUsagesBaseName", + "azure.mgmt.quota.models.IncomingQuotaTransfer": "Microsoft.Quota.IncomingQuotaTransfer", + "azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest": "Microsoft.Quota.IncomingQuotaTransferApproveRequest", + "azure.mgmt.quota.models.IncomingQuotaTransferProperties": "Microsoft.Quota.IncomingQuotaTransferProperties", + "azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest": "Microsoft.Quota.IncomingQuotaTransferRejectRequest", "azure.mgmt.quota.models.LimitJsonObject": "Microsoft.Quota.LimitJsonObject", "azure.mgmt.quota.models.LimitObject": "Microsoft.Quota.LimitObject", "azure.mgmt.quota.models.OperationDisplay": "Microsoft.Quota.OperationDisplay", @@ -47,6 +53,10 @@ "azure.mgmt.quota.models.QuotaProperties": "Microsoft.Quota.QuotaProperties", "azure.mgmt.quota.models.QuotaRequestDetails": "Microsoft.Quota.QuotaRequestDetails", "azure.mgmt.quota.models.QuotaRequestProperties": "Microsoft.Quota.QuotaRequestProperties", + "azure.mgmt.quota.models.QuotaTransfer": "Microsoft.Quota.QuotaTransfer", + "azure.mgmt.quota.models.QuotaTransferCancelRequest": "Microsoft.Quota.QuotaTransferCancelRequest", + "azure.mgmt.quota.models.QuotaTransferProperties": "Microsoft.Quota.QuotaTransferProperties", + "azure.mgmt.quota.models.RejectionRecord": "Microsoft.Quota.RejectionRecord", "azure.mgmt.quota.models.ResourceName": "Microsoft.Quota.ResourceName", "azure.mgmt.quota.models.ResourceUsages": "Microsoft.Quota.ResourceUsages", "azure.mgmt.quota.models.ServiceError": "Microsoft.Quota.ServiceError", @@ -67,6 +77,8 @@ "azure.mgmt.quota.models.QuotaRequestState": "Microsoft.Quota.QuotaRequestState", "azure.mgmt.quota.models.LimitType": "Microsoft.Quota.LimitType", "azure.mgmt.quota.models.QuotaLimitTypes": "Microsoft.Quota.QuotaLimitTypes", + "azure.mgmt.quota.models.TransferProvisioningState": "Microsoft.Quota.TransferProvisioningState", + "azure.mgmt.quota.models.TransferStatus": "Microsoft.Quota.TransferStatus", "azure.mgmt.quota.models.GroupType": "Microsoft.Quota.GroupType", "azure.mgmt.quota.models.RequestState": "Microsoft.Quota.RequestState", "azure.mgmt.quota.models.EnforcementState": "Microsoft.Quota.EnforcementState", @@ -77,6 +89,26 @@ "azure.mgmt.quota.aio.operations.QuotaRequestStatusOperations.get": "Microsoft.Quota.QuotaRequestStatus.get", "azure.mgmt.quota.operations.QuotaRequestStatusOperations.list": "Microsoft.Quota.QuotaRequestStatus.list", "azure.mgmt.quota.aio.operations.QuotaRequestStatusOperations.list": "Microsoft.Quota.QuotaRequestStatus.list", + "azure.mgmt.quota.operations.QuotaTransfersOperations.get": "Microsoft.Quota.QuotaTransfers.get", + "azure.mgmt.quota.aio.operations.QuotaTransfersOperations.get": "Microsoft.Quota.QuotaTransfers.get", + "azure.mgmt.quota.operations.QuotaTransfersOperations.begin_create_or_update": "Microsoft.Quota.QuotaTransfers.createOrUpdate", + "azure.mgmt.quota.aio.operations.QuotaTransfersOperations.begin_create_or_update": "Microsoft.Quota.QuotaTransfers.createOrUpdate", + "azure.mgmt.quota.operations.QuotaTransfersOperations.delete": "Microsoft.Quota.QuotaTransfers.delete", + "azure.mgmt.quota.aio.operations.QuotaTransfersOperations.delete": "Microsoft.Quota.QuotaTransfers.delete", + "azure.mgmt.quota.operations.QuotaTransfersOperations.list": "Microsoft.Quota.QuotaTransfers.list", + "azure.mgmt.quota.aio.operations.QuotaTransfersOperations.list": "Microsoft.Quota.QuotaTransfers.list", + "azure.mgmt.quota.operations.QuotaTransfersOperations.cancel": "Microsoft.Quota.QuotaTransfers.cancel", + "azure.mgmt.quota.aio.operations.QuotaTransfersOperations.cancel": "Microsoft.Quota.QuotaTransfers.cancel", + "azure.mgmt.quota.operations.IncomingQuotaTransfersOperations.get": "Microsoft.Quota.IncomingQuotaTransfers.get", + "azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations.get": "Microsoft.Quota.IncomingQuotaTransfers.get", + "azure.mgmt.quota.operations.IncomingQuotaTransfersOperations.list": "Microsoft.Quota.IncomingQuotaTransfers.list", + "azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations.list": "Microsoft.Quota.IncomingQuotaTransfers.list", + "azure.mgmt.quota.operations.IncomingQuotaTransfersOperations.list_by_subscription": "Microsoft.Quota.IncomingQuotaTransfers.listBySubscription", + "azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations.list_by_subscription": "Microsoft.Quota.IncomingQuotaTransfers.listBySubscription", + "azure.mgmt.quota.operations.IncomingQuotaTransfersOperations.begin_approve": "Microsoft.Quota.IncomingQuotaTransfers.approve", + "azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations.begin_approve": "Microsoft.Quota.IncomingQuotaTransfers.approve", + "azure.mgmt.quota.operations.IncomingQuotaTransfersOperations.reject": "Microsoft.Quota.IncomingQuotaTransfers.reject", + "azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations.reject": "Microsoft.Quota.IncomingQuotaTransfers.reject", "azure.mgmt.quota.operations.GroupQuotasOperations.get": "Microsoft.Quota.GroupQuotasEntities.get", "azure.mgmt.quota.aio.operations.GroupQuotasOperations.get": "Microsoft.Quota.GroupQuotasEntities.get", "azure.mgmt.quota.operations.GroupQuotasOperations.begin_create_or_update": "Microsoft.Quota.GroupQuotasEntities.createOrUpdate", @@ -137,5 +169,6 @@ "azure.mgmt.quota.aio.operations.QuotaOperations.begin_update": "Microsoft.Quota.CurrentQuotaLimitBases.update", "azure.mgmt.quota.operations.QuotaOperations.list": "Microsoft.Quota.CurrentQuotaLimitBases.list", "azure.mgmt.quota.aio.operations.QuotaOperations.list": "Microsoft.Quota.CurrentQuotaLimitBases.list" - } + }, + "CrossLanguageVersion": "b8461288658e" } \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_client.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_client.py index b5963b49d0fb..cf1912933fa4 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_client.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -29,24 +29,35 @@ GroupQuotaSubscriptionsOperations, GroupQuotaUsagesOperations, GroupQuotasOperations, + IncomingQuotaTransfersOperations, QuotaOperationOperations, QuotaOperations, QuotaRequestStatusOperations, + QuotaTransfersOperations, UsagesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes +class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Microsoft Azure Quota Resource Provider. :ivar quota_operation: QuotaOperationOperations operations :vartype quota_operation: azure.mgmt.quota.operations.QuotaOperationOperations :ivar quota_request_status: QuotaRequestStatusOperations operations :vartype quota_request_status: azure.mgmt.quota.operations.QuotaRequestStatusOperations + :ivar quota_transfers: QuotaTransfersOperations operations + :vartype quota_transfers: azure.mgmt.quota.operations.QuotaTransfersOperations + :ivar incoming_quota_transfers: IncomingQuotaTransfersOperations operations + :vartype incoming_quota_transfers: azure.mgmt.quota.operations.IncomingQuotaTransfersOperations :ivar group_quotas: GroupQuotasOperations operations :vartype group_quotas: azure.mgmt.quota.operations.GroupQuotasOperations :ivar group_quota_limits_request: GroupQuotaLimitsRequestOperations operations @@ -86,8 +97,10 @@ class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Default value is "2025-09-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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 Retry-After header is present. @@ -144,6 +157,10 @@ def __init__( self.quota_request_status = QuotaRequestStatusOperations( self._client, self._config, self._serialize, self._deserialize ) + self.quota_transfers = QuotaTransfersOperations(self._client, self._config, self._serialize, self._deserialize) + self.incoming_quota_transfers = IncomingQuotaTransfersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.group_quotas = GroupQuotasOperations(self._client, self._config, self._serialize, self._deserialize) self.group_quota_limits_request = GroupQuotaLimitsRequestOperations( 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 index 2dd0ec54f048..e147f24a6ded 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for QuotaMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,8 +34,10 @@ class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attribu :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Default value is "2025-09-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -46,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-09-01") + api_version: str = kwargs.pop("api_version", "2026-09-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_patch.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_patch.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/model_base.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/model_base.py index 12926fa98dcf..35d5fc024978 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/model_base.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/model_base.py @@ -23,20 +23,26 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -103,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -129,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -171,6 +208,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -202,7 +254,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -256,7 +308,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -280,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -292,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -309,12 +373,20 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -353,9 +425,39 @@ def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -372,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -396,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -431,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -456,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -467,6 +570,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -483,6 +588,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -507,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -533,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -543,59 +883,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -612,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -638,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -666,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -758,6 +1161,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -767,6 +1178,19 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) @@ -817,16 +1241,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -910,16 +1336,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -952,7 +1382,7 @@ def _failsafe_deserialize( ) -> typing.Any: try: return _deserialize(deserializer, response.json(), module, rf, format) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -965,13 +1395,14 @@ def _failsafe_deserialize_xml( ) -> typing.Any: try: return _deserialize_xml(deserializer, response.text()) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -984,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -991,14 +1423,20 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1009,14 +1447,44 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1046,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1055,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1079,6 +1549,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1090,10 +1610,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1115,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1127,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1141,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1148,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1157,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1175,8 +1702,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1184,7 +1712,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1197,9 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1210,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/serialization.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/serialization.py index e81921cbb011..ae08f9d89f74 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/serialization.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -476,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -516,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -787,7 +799,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -821,13 +833,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1098,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1370,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1382,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1394,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1404,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1757,7 +1860,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1783,7 +1886,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1918,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/utils.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/utils.py new file mode 100644 index 000000000000..cbaa624660e4 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_validation.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py index b1c9d3c95686..1e0a77b6acff 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.1" +VERSION = "3.1.0b1" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_client.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_client.py index da9bd4bf6d25..cfeb33f1fc78 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_client.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -29,24 +29,36 @@ GroupQuotaSubscriptionsOperations, GroupQuotaUsagesOperations, GroupQuotasOperations, + IncomingQuotaTransfersOperations, QuotaOperationOperations, QuotaOperations, QuotaRequestStatusOperations, + QuotaTransfersOperations, UsagesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes +class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Microsoft Azure Quota Resource Provider. :ivar quota_operation: QuotaOperationOperations operations :vartype quota_operation: azure.mgmt.quota.aio.operations.QuotaOperationOperations :ivar quota_request_status: QuotaRequestStatusOperations operations :vartype quota_request_status: azure.mgmt.quota.aio.operations.QuotaRequestStatusOperations + :ivar quota_transfers: QuotaTransfersOperations operations + :vartype quota_transfers: azure.mgmt.quota.aio.operations.QuotaTransfersOperations + :ivar incoming_quota_transfers: IncomingQuotaTransfersOperations operations + :vartype incoming_quota_transfers: + azure.mgmt.quota.aio.operations.IncomingQuotaTransfersOperations :ivar group_quotas: GroupQuotasOperations operations :vartype group_quotas: azure.mgmt.quota.aio.operations.GroupQuotasOperations :ivar group_quota_limits_request: GroupQuotaLimitsRequestOperations operations @@ -86,8 +98,10 @@ class QuotaMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Default value is "2025-09-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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 Retry-After header is present. @@ -146,6 +160,10 @@ def __init__( self.quota_request_status = QuotaRequestStatusOperations( self._client, self._config, self._serialize, self._deserialize ) + self.quota_transfers = QuotaTransfersOperations(self._client, self._config, self._serialize, self._deserialize) + self.incoming_quota_transfers = IncomingQuotaTransfersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.group_quotas = GroupQuotasOperations(self._client, self._config, self._serialize, self._deserialize) self.group_quota_limits_request = GroupQuotaLimitsRequestOperations( self._client, self._config, self._serialize, self._deserialize diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py index b0fe24191432..eb147a85e0a0 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for QuotaMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,8 +34,10 @@ class QuotaMgmtClientConfiguration: # pylint: disable=too-many-instance-attribu :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Default value is "2025-09-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-09-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -46,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-09-01") + api_version: str = kwargs.pop("api_version", "2026-09-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_patch.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_patch.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py index c2d50f3d9b8d..d7608052793e 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py @@ -14,6 +14,8 @@ from ._operations import QuotaOperationOperations # type: ignore from ._operations import QuotaRequestStatusOperations # type: ignore +from ._operations import QuotaTransfersOperations # type: ignore +from ._operations import IncomingQuotaTransfersOperations # type: ignore from ._operations import GroupQuotasOperations # type: ignore from ._operations import GroupQuotaLimitsRequestOperations # type: ignore from ._operations import GroupQuotaUsagesOperations # type: ignore @@ -33,6 +35,8 @@ __all__ = [ "QuotaOperationOperations", "QuotaRequestStatusOperations", + "QuotaTransfersOperations", + "IncomingQuotaTransfersOperations", "GroupQuotasOperations", "GroupQuotaLimitsRequestOperations", "GroupQuotaUsagesOperations", diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operations.py index 0627a63a16d5..d18c73151d89 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_operations.py @@ -12,12 +12,13 @@ from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import AsyncPipelineClient +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -33,9 +34,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( build_group_quota_limits_list_request, build_group_quota_limits_request_get_request, @@ -61,12 +63,22 @@ build_group_quotas_get_request, build_group_quotas_list_request, build_group_quotas_update_request, + build_incoming_quota_transfers_approve_request, + build_incoming_quota_transfers_get_request, + build_incoming_quota_transfers_list_by_subscription_request, + build_incoming_quota_transfers_list_request, + build_incoming_quota_transfers_reject_request, build_quota_create_or_update_request, build_quota_get_request, build_quota_list_request, build_quota_operation_list_request, build_quota_request_status_get_request, build_quota_request_status_list_request, + build_quota_transfers_cancel_request, + build_quota_transfers_create_or_update_request, + build_quota_transfers_delete_request, + build_quota_transfers_get_request, + build_quota_transfers_list_request, build_quota_update_request, build_usages_get_request, build_usages_list_request, @@ -75,11 +87,10 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class QuotaOperationOperations: +class QuotaOperationOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -143,7 +154,1356 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OperationResponse], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class QuotaRequestStatusOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s + :attr:`quota_request_status` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: + """Get the quota request details and status by quota request ID for the resources of the resource + provider at a specific location. The quota request ID **id** is returned in the response of the + PUT operation. + + :param id: Quota request ID. Required. + :type id: str + :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. + :type scope: str + :return: QuotaRequestDetails. The QuotaRequestDetails is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) + + _request = build_quota_request_status_get_request( + id=id, + scope=scope, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaRequestDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + scope: str, + *, + filter: Optional[str] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.QuotaRequestDetails"]: + """For the specified scope, get the current quota requests for a one year period ending at the + time is made. Use the **oData** filter to select quota requests. + + :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. + :type scope: str + :keyword filter: | Field | Supported operators + |---------------------|------------------------ + + |requestSubmitTime | ge, le, eq, gt, lt + |provisioningState eq {QuotaRequestState} + |resourceName eq {resourceName}. Default value is None. + :paramtype filter: str + :keyword top: Number of records to return. Default value is None. + :paramtype top: int + :keyword skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a + partial result. If a previous response contains a **nextLink** element, its value includes a + **skiptoken** parameter that specifies a starting point to use for subsequent calls. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of QuotaRequestDetails + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaRequestDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QuotaRequestDetails]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_quota_request_status_list_request( + scope=scope, + filter=filter, + top=top, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QuotaRequestDetails], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class QuotaTransfersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s + :attr:`quota_transfers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def get(self, target_provider: str, region: str, transfer_name: str, **kwargs: Any) -> _models.QuotaTransfer: + """Get a quota transfer. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + + _request = build_quota_transfers_get_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def _create_or_update_initial( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: Union[_models.QuotaTransfer, _types.QuotaTransfer, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_quota_transfers_create_or_update_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: _models.QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.quota.models.QuotaTransfer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns QuotaTransfer. The QuotaTransfer is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: _types.QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.quota.types.QuotaTransfer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns QuotaTransfer. The QuotaTransfer is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns QuotaTransfer. The QuotaTransfer is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: Union[_models.QuotaTransfer, _types.QuotaTransfer, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Is either a QuotaTransfer type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.quota.models.QuotaTransfer or ~azure.mgmt.quota.types.QuotaTransfer + or IO[bytes] + :return: An instance of AsyncLROPoller that returns QuotaTransfer. The QuotaTransfer is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.QuotaTransfer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.QuotaTransfer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "transfer_name"] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def delete(self, target_provider: str, region: str, transfer_name: str, **kwargs: Any) -> None: + """Delete a quota transfer record. Quota is not moved by delete; only the resource entry is + removed. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_quota_transfers_delete_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "accept"] + }, + api_versions_list=["2026-09-01-preview"], + ) + def list(self, target_provider: str, region: str, **kwargs: Any) -> AsyncItemPaged["_models.QuotaTransfer"]: + """List quota transfers at the (subscription, targetProvider, region) scope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :return: An iterator like instance of QuotaTransfer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_quota_transfers_list_request( + target_provider=target_provider, + region=region, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QuotaTransfer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[_models.QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.QuotaTransferCancelRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[_types.QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.QuotaTransferCancelRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[Union[_models.QuotaTransferCancelRequest, _types.QuotaTransferCancelRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Is either a QuotaTransferCancelRequest type or + a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.QuotaTransferCancelRequest or + ~azure.mgmt.quota.types.QuotaTransferCancelRequest or IO[bytes] + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_quota_transfers_cancel_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class IncomingQuotaTransfersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s + :attr:`incoming_quota_transfers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def get( + self, target_provider: str, region: str, transfer_id: str, **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Get an incoming quota transfer. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) + + _request = build_incoming_quota_transfers_get_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "accept"] + }, + api_versions_list=["2026-09-01-preview"], + ) + def list(self, target_provider: str, region: str, **kwargs: Any) -> AsyncItemPaged["_models.IncomingQuotaTransfer"]: + """List incoming quota transfers at the (subscription, targetProvider, region) scope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :return: An iterator like instance of IncomingQuotaTransfer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IncomingQuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_incoming_quota_transfers_list_request( + target_provider=target_provider, + region=region, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IncomingQuotaTransfer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={"2026-09-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2026-09-01-preview"], + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.IncomingQuotaTransfer"]: + """List incoming quota transfers across every targetProvider and region for the subscription. + + :return: An iterator like instance of IncomingQuotaTransfer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IncomingQuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_incoming_quota_transfers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -156,7 +1516,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OperationResponse], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.IncomingQuotaTransfer], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -172,43 +1535,539 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def _approve_initial( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferApproveRequest, _types.IncomingQuotaTransferApproveRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_incoming_quota_transfers_approve_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_models.IncomingQuotaTransferApproveRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IncomingQuotaTransfer. The + IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_types.IncomingQuotaTransferApproveRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.IncomingQuotaTransferApproveRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IncomingQuotaTransfer. The + IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IncomingQuotaTransfer. The + IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferApproveRequest, _types.IncomingQuotaTransferApproveRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> AsyncLROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Is either a IncomingQuotaTransferApproveRequest + type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest or + ~azure.mgmt.quota.types.IncomingQuotaTransferApproveRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns IncomingQuotaTransfer. The + IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._approve_initial( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + body=body, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IncomingQuotaTransfer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IncomingQuotaTransfer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class QuotaRequestStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_models.IncomingQuotaTransferRejectRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.quota.aio.QuotaMgmtClient`'s - :attr:`quota_request_status` attribute. - """ + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_types.IncomingQuotaTransferRejectRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.IncomingQuotaTransferRejectRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: - """Get the quota request details and status by quota request ID for the resources of the resource - provider at a specific location. The quota request ID **id** is returned in the response of the - PUT operation. - - :param id: Quota request ID. Required. - :type id: str - :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. - :type scope: str - :return: QuotaRequestDetails. The QuotaRequestDetails is compatible with MutableMapping - :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + async def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferRejectRequest, _types.IncomingQuotaTransferRejectRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Is either a IncomingQuotaTransferRejectRequest + type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest or + ~azure.mgmt.quota.types.IncomingQuotaTransferRejectRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -217,17 +2076,41 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) - _request = build_quota_request_status_get_request( - id=id, - scope=scope, + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_incoming_quota_transfers_reject_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -236,6 +2119,7 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -250,133 +2134,24 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QuotaRequestDetails, response.json()) + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, - scope: str, - *, - filter: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.QuotaRequestDetails"]: - """For the specified scope, get the current quota requests for a one year period ending at the - time is made. Use the **oData** filter to select quota requests. - - :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. - :type scope: str - :keyword filter: | Field | Supported operators - |---------------------|------------------------ - - |requestSubmitTime | ge, le, eq, gt, lt - |provisioningState eq {QuotaRequestState} - |resourceName eq {resourceName}. Default value is None. - :paramtype filter: str - :keyword top: Number of records to return. Default value is None. - :paramtype top: int - :keyword skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a - partial result. If a previous response contains a **nextLink** element, its value includes a - **skiptoken** parameter that specifies a starting point to use for subsequent calls. Default - value is None. - :paramtype skiptoken: str - :return: An iterator like instance of QuotaRequestDetails - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.quota.models.QuotaRequestDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.QuotaRequestDetails]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quota_request_status_list_request( - scope=scope, - filter=filter, - top=top, - skiptoken=skiptoken, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaRequestDetails], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class GroupQuotasOperations: +class GroupQuotasOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -432,6 +2207,7 @@ async def get(self, management_group_id: str, group_quota_name: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -446,11 +2222,14 @@ async def get(self, management_group_id: str, group_quota_name: str, **kwargs: A except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotasEntity, response.json()) @@ -463,7 +2242,9 @@ async def _create_or_update_initial( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, JSON, IO[bytes]]] = None, + group_quota_put_request_body: Optional[ + Union[_models.GroupQuotasEntity, _types.GroupQuotasEntity, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -505,6 +2286,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -518,7 +2300,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -529,7 +2314,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -576,7 +2361,7 @@ async def begin_create_or_update( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[JSON] = None, + group_quota_put_request_body: Optional[_types.GroupQuotasEntity] = None, *, content_type: str = "application/json", **kwargs: Any @@ -596,7 +2381,7 @@ async def begin_create_or_update( :type group_quota_name: str :param group_quota_put_request_body: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type group_quota_put_request_body: JSON + :type group_quota_put_request_body: ~azure.mgmt.quota.types.GroupQuotasEntity :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -646,7 +2431,9 @@ async def begin_create_or_update( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, JSON, IO[bytes]]] = None, + group_quota_put_request_body: Optional[ + Union[_models.GroupQuotasEntity, _types.GroupQuotasEntity, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotasEntity]: """Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The @@ -663,10 +2450,10 @@ async def begin_create_or_update( context tenantId/MgId. Required. :type group_quota_name: str :param group_quota_put_request_body: The GroupQuota body details for creation or update of a - GroupQuota entity. Is one of the following types: GroupQuotasEntity, JSON, IO[bytes] Default - value is None. - :type group_quota_put_request_body: ~azure.mgmt.quota.models.GroupQuotasEntity or JSON or - IO[bytes] + GroupQuota entity. Is either a GroupQuotasEntity type or a IO[bytes] type. Default value is + None. + :type group_quota_put_request_body: ~azure.mgmt.quota.models.GroupQuotasEntity or + ~azure.mgmt.quota.types.GroupQuotasEntity or IO[bytes] :return: An instance of AsyncLROPoller that returns GroupQuotasEntity. The GroupQuotasEntity is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEntity] @@ -729,7 +2516,9 @@ async def _update_initial( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, JSON, IO[bytes]]] = None, + group_quotas_patch_request_body: Optional[ + Union[_models.GroupQuotasEntityPatch, _types.GroupQuotasEntityPatch, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -771,6 +2560,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -784,7 +2574,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -795,7 +2588,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -819,9 +2612,9 @@ async def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -844,7 +2637,7 @@ async def begin_update( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[JSON] = None, + group_quotas_patch_request_body: Optional[_types.GroupQuotasEntityPatch] = None, *, content_type: str = "application/json", **kwargs: Any @@ -856,9 +2649,9 @@ async def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -866,7 +2659,7 @@ async def begin_update( context tenantId/MgId. Required. :type group_quota_name: str :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Default value is None. - :type group_quotas_patch_request_body: JSON + :type group_quotas_patch_request_body: ~azure.mgmt.quota.types.GroupQuotasEntityPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -893,9 +2686,9 @@ async def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -918,7 +2711,9 @@ async def begin_update( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, JSON, IO[bytes]]] = None, + group_quotas_patch_request_body: Optional[ + Union[_models.GroupQuotasEntityPatch, _types.GroupQuotasEntityPatch, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotasEntity]: """Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the @@ -928,19 +2723,19 @@ async def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str :param group_quota_name: The GroupQuota name. The name should be unique for the provided context tenantId/MgId. Required. :type group_quota_name: str - :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Is one of the following - types: GroupQuotasEntityPatch, JSON, IO[bytes] Default value is None. - :type group_quotas_patch_request_body: ~azure.mgmt.quota.models.GroupQuotasEntityPatch or JSON - or IO[bytes] + :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Is either a + GroupQuotasEntityPatch type or a IO[bytes] type. Default value is None. + :type group_quotas_patch_request_body: ~azure.mgmt.quota.models.GroupQuotasEntityPatch or + ~azure.mgmt.quota.types.GroupQuotasEntityPatch or IO[bytes] :return: An instance of AsyncLROPoller that returns GroupQuotasEntity. The GroupQuotasEntity is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotasEntity] @@ -1027,6 +2822,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1040,7 +2836,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1051,7 +2850,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1169,7 +2968,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1182,7 +2984,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.GroupQuotasEntity], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.GroupQuotasEntity], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1198,7 +3003,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1206,7 +3014,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GroupQuotaLimitsRequestOperations: +class GroupQuotaLimitsRequestOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1296,7 +3104,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1309,7 +3120,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SubmittedResourceRequestStatus], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SubmittedResourceRequestStatus], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1325,7 +3139,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1338,7 +3155,7 @@ async def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[Union[_models.GroupQuotaLimitList, JSON, IO[bytes]]] = None, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, _types.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1382,6 +3199,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1395,7 +3213,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1406,7 +3227,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1427,10 +3248,10 @@ async def begin_update( ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1461,17 +3282,17 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[JSON] = None, + group_quota_request: Optional[_types.GroupQuotaLimitList] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1485,7 +3306,7 @@ async def begin_update( :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. - :type group_quota_request: JSON + :type group_quota_request: ~azure.mgmt.quota.types.GroupQuotaLimitList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1509,10 +3330,10 @@ async def begin_update( ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1543,15 +3364,15 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[Union[_models.GroupQuotaLimitList, JSON, IO[bytes]]] = None, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, _types.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1564,9 +3385,10 @@ async def begin_update( :param location: The name of the Azure region. Required. :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is one of the following types: GroupQuotaLimitList, JSON, - IO[bytes] Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or JSON or IO[bytes] + resourceProvider/location/resources. Is either a GroupQuotaLimitList type or a IO[bytes] type. + Default value is None. + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or + ~azure.mgmt.quota.types.GroupQuotaLimitList or IO[bytes] :return: An instance of AsyncLROPoller that returns GroupQuotaLimitList. The GroupQuotaLimitList is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] @@ -1671,6 +3493,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1685,11 +3508,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SubmittedResourceRequestStatus, response.json()) @@ -1699,7 +3525,7 @@ async def get( return deserialized # type: ignore -class GroupQuotaUsagesOperations: +class GroupQuotaUsagesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1779,7 +3605,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1792,7 +3621,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ResourceUsages], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ResourceUsages], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1808,7 +3640,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1816,7 +3651,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GroupQuotaSubscriptionsOperations: +class GroupQuotaSubscriptionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1876,6 +3711,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1890,11 +3726,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaSubscriptionId, response.json()) @@ -1932,6 +3771,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1945,7 +3785,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1956,7 +3799,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2060,6 +3903,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2073,7 +3917,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2084,7 +3931,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2187,6 +4034,7 @@ async def _delete_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2200,7 +4048,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2211,7 +4062,7 @@ async def _delete_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2335,7 +4186,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2348,7 +4202,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.GroupQuotaSubscriptionId], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.GroupQuotaSubscriptionId], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2364,7 +4221,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2372,7 +4232,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GroupQuotaSubscriptionRequestsOperations: +class GroupQuotaSubscriptionRequestsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2436,6 +4296,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2450,11 +4311,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaSubscriptionRequestStatus, response.json()) @@ -2521,7 +4385,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2535,7 +4402,8 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.GroupQuotaSubscriptionRequestStatus], deserialized.get("value", []) + List[_models.GroupQuotaSubscriptionRequestStatus], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2552,7 +4420,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2560,7 +4431,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GroupQuotaLimitsOperations: +class GroupQuotaLimitsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2625,6 +4496,7 @@ async def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2639,11 +4511,14 @@ async def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaLimitList, response.json()) @@ -2653,7 +4528,7 @@ async def list( return deserialized # type: ignore -class GroupQuotaSubscriptionAllocationOperations: # pylint: disable=name-too-long +class GroupQuotaSubscriptionAllocationOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -2722,6 +4597,7 @@ async def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2736,11 +4612,14 @@ async def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SubscriptionQuotaAllocationsList, response.json()) @@ -2750,7 +4629,7 @@ async def list( return deserialized # type: ignore -class GroupQuotaSubscriptionAllocationRequestOperations: # pylint: disable=name-too-long +class GroupQuotaSubscriptionAllocationRequestOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -2773,7 +4652,9 @@ async def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, JSON, IO[bytes]], + allocate_quota_request: Union[ + _models.SubscriptionQuotaAllocationsList, _types.SubscriptionQuotaAllocationsList, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2814,6 +4695,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2827,7 +4709,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2838,7 +4723,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2893,7 +4778,7 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: JSON, + allocate_quota_request: _types.SubscriptionQuotaAllocationsList, *, content_type: str = "application/json", **kwargs: Any @@ -2916,7 +4801,7 @@ async def begin_update( :param location: The name of the Azure region. Required. :type location: str :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: JSON + :type allocate_quota_request: ~azure.mgmt.quota.types.SubscriptionQuotaAllocationsList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2975,7 +4860,9 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, JSON, IO[bytes]], + allocate_quota_request: Union[ + _models.SubscriptionQuotaAllocationsList, _types.SubscriptionQuotaAllocationsList, IO[bytes] + ], **kwargs: Any ) -> AsyncLROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to @@ -2995,10 +4882,10 @@ async def begin_update( :type resource_provider_name: str :param location: The name of the Azure region. Required. :type location: str - :param allocate_quota_request: Quota requests payload. Is one of the following types: - SubscriptionQuotaAllocationsList, JSON, IO[bytes] Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or JSON - or IO[bytes] + :param allocate_quota_request: Quota requests payload. Is either a + SubscriptionQuotaAllocationsList type or a IO[bytes] type. Required. + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or + ~azure.mgmt.quota.types.SubscriptionQuotaAllocationsList or IO[bytes] :return: An instance of AsyncLROPoller that returns SubscriptionQuotaAllocationsList. The SubscriptionQuotaAllocationsList is compatible with MutableMapping :rtype: @@ -3113,6 +5000,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3127,11 +5015,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.QuotaAllocationRequestStatus, response.json()) @@ -3216,7 +5107,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3229,7 +5123,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaAllocationRequestStatus], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.QuotaAllocationRequestStatus], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3245,7 +5142,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3253,7 +5153,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GroupQuotaLocationSettingsOperations: +class GroupQuotaLocationSettingsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3319,6 +5219,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3333,11 +5234,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotasEnforcementStatus, response.json()) @@ -3352,7 +5256,9 @@ async def _create_or_update_initial( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3396,6 +5302,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3409,7 +5316,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3420,7 +5330,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3483,7 +5393,7 @@ async def begin_create_or_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[JSON] = None, + location_settings: Optional[_types.GroupQuotasEnforcementStatus] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3514,7 +5424,7 @@ async def begin_create_or_update( :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type location_settings: JSON + :type location_settings: ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3581,7 +5491,9 @@ async def begin_create_or_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotasEnforcementStatus]: """Enables the GroupQuotas enforcement for the resource provider and the location specified. The @@ -3609,10 +5521,10 @@ async def begin_create_or_update( :param location: The name of the Azure region. Required. :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is one of the following types: GroupQuotasEnforcementStatus, JSON, IO[bytes] Default - value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or JSON or - IO[bytes] + entity. Is either a GroupQuotasEnforcementStatus type or a IO[bytes] type. Default value is + None. + :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or + ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus or IO[bytes] :return: An instance of AsyncLROPoller that returns GroupQuotasEnforcementStatus. The GroupQuotasEnforcementStatus is compatible with MutableMapping :rtype: @@ -3680,7 +5592,9 @@ async def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3724,6 +5638,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3737,7 +5652,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3748,7 +5666,7 @@ async def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3811,7 +5729,7 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[JSON] = None, + location_settings: Optional[_types.GroupQuotasEnforcementStatus] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3842,7 +5760,7 @@ async def begin_update( :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type location_settings: JSON + :type location_settings: ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3909,7 +5827,9 @@ async def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.GroupQuotasEnforcementStatus]: """Enables the GroupQuotas enforcement for the resource provider and the location specified. The @@ -3937,10 +5857,10 @@ async def begin_update( :param location: The name of the Azure region. Required. :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is one of the following types: GroupQuotasEnforcementStatus, JSON, IO[bytes] Default - value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or JSON or - IO[bytes] + entity. Is either a GroupQuotasEnforcementStatus type or a IO[bytes] type. Default value is + None. + :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or + ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus or IO[bytes] :return: An instance of AsyncLROPoller that returns GroupQuotasEnforcementStatus. The GroupQuotasEnforcementStatus is compatible with MutableMapping :rtype: @@ -4003,7 +5923,7 @@ def get_long_running_output(pipeline_response): ) -class UsagesOperations: +class UsagesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4045,14 +5965,15 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) cls: ClsType[_models.CurrentUsagesBase] = kwargs.pop("cls", None) _request = build_usages_get_request( resource_name=resource_name, scope=scope, - api_version=self._config.api_version, + api_version=api_version, headers=_headers, params=_params, ) @@ -4061,6 +5982,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4075,14 +5997,17 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.CurrentUsagesBase, response.json()) @@ -4141,7 +6066,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4154,7 +6082,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CurrentUsagesBase], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CurrentUsagesBase], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4170,7 +6101,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4178,7 +6112,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class QuotaOperations: +class QuotaOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4221,14 +6155,15 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) _request = build_quota_get_request( resource_name=resource_name, scope=scope, - api_version=self._config.api_version, + api_version=api_version, headers=_headers, params=_params, ) @@ -4237,6 +6172,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4251,14 +6187,17 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.CurrentQuotaLimitBase, response.json()) @@ -4271,7 +6210,7 @@ async def _create_or_update_initial( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4283,8 +6222,9 @@ async def _create_or_update_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -4298,8 +6238,8 @@ async def _create_or_update_initial( _request = build_quota_create_or_update_request( resource_name=resource_name, scope=scope, + api_version=api_version, content_type=content_type, - api_version=self._config.api_version, content=_content, headers=_headers, params=_params, @@ -4309,6 +6249,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4322,7 +6263,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4330,7 +6274,7 @@ async def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4380,7 +6324,7 @@ async def begin_create_or_update( self, resource_name: str, scope: str, - create_quota_request: JSON, + create_quota_request: _types.CurrentQuotaLimitBase, *, content_type: str = "application/json", **kwargs: Any @@ -4403,7 +6347,7 @@ async def begin_create_or_update( :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. - :type create_quota_request: JSON + :type create_quota_request: ~azure.mgmt.quota.types.CurrentQuotaLimitBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4456,7 +6400,7 @@ async def begin_create_or_update( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota limit for the specified resource with the requested value. To update @@ -4476,17 +6420,19 @@ async def begin_create_or_update( :type resource_name: str :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str - :param create_quota_request: Quota request payload. Is one of the following types: - CurrentQuotaLimitBase, JSON, IO[bytes] Required. - :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or JSON or IO[bytes] + :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a + IO[bytes] type. Required. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or + ~azure.mgmt.quota.types.CurrentQuotaLimitBase or IO[bytes] :return: An instance of AsyncLROPoller that returns CurrentQuotaLimitBase. The CurrentQuotaLimitBase is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4497,6 +6443,7 @@ async def begin_create_or_update( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, + api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4540,7 +6487,7 @@ async def _update_initial( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4552,8 +6499,9 @@ async def _update_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -4567,8 +6515,8 @@ async def _update_initial( _request = build_quota_update_request( resource_name=resource_name, scope=scope, + api_version=api_version, content_type=content_type, - api_version=self._config.api_version, content=_content, headers=_headers, params=_params, @@ -4578,6 +6526,7 @@ async def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4591,7 +6540,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4600,7 +6552,7 @@ async def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4649,7 +6601,7 @@ async def begin_update( self, resource_name: str, scope: str, - create_quota_request: JSON, + create_quota_request: _types.CurrentQuotaLimitBase, *, content_type: str = "application/json", **kwargs: Any @@ -4671,7 +6623,7 @@ async def begin_update( :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. - :type create_quota_request: JSON + :type create_quota_request: ~azure.mgmt.quota.types.CurrentQuotaLimitBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4723,7 +6675,7 @@ async def begin_update( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CurrentQuotaLimitBase]: """Update the quota limit for a specific resource to the specified value: @@ -4742,17 +6694,19 @@ async def begin_update( :type resource_name: str :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str - :param create_quota_request: Quota requests payload. Is one of the following types: - CurrentQuotaLimitBase, JSON, IO[bytes] Required. - :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or JSON or IO[bytes] + :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or + a IO[bytes] type. Required. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or + ~azure.mgmt.quota.types.CurrentQuotaLimitBase or IO[bytes] :return: An instance of AsyncLROPoller that returns CurrentQuotaLimitBase. The CurrentQuotaLimitBase is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4763,6 +6717,7 @@ async def begin_update( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, + api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4853,7 +6808,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4866,7 +6824,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CurrentQuotaLimitBase], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CurrentQuotaLimitBase], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4882,7 +6843,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_patch.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_patch.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level 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 index 13c5adac0425..233ca0f0a7cf 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -16,6 +16,8 @@ from ._models import ( # type: ignore AllocatedQuotaToSubscriptionList, AllocatedToSubscription, + ApprovalRecord, + CancellationRecord, CurrentQuotaLimitBase, CurrentUsagesBase, ErrorAdditionalInfo, @@ -46,6 +48,10 @@ GroupQuotasEntityPatch, GroupQuotasEntityPatchProperties, GroupQuotasEntityProperties, + IncomingQuotaTransfer, + IncomingQuotaTransferApproveRequest, + IncomingQuotaTransferProperties, + IncomingQuotaTransferRejectRequest, LimitJsonObject, LimitObject, OperationDisplay, @@ -59,6 +65,10 @@ QuotaProperties, QuotaRequestDetails, QuotaRequestProperties, + QuotaTransfer, + QuotaTransferCancelRequest, + QuotaTransferProperties, + RejectionRecord, Resource, ResourceName, ResourceUsages, @@ -86,6 +96,8 @@ QuotaLimitTypes, QuotaRequestState, RequestState, + TransferProvisioningState, + TransferStatus, UsagesTypes, ) from ._patch import __all__ as _patch_all @@ -95,6 +107,8 @@ __all__ = [ "AllocatedQuotaToSubscriptionList", "AllocatedToSubscription", + "ApprovalRecord", + "CancellationRecord", "CurrentQuotaLimitBase", "CurrentUsagesBase", "ErrorAdditionalInfo", @@ -125,6 +139,10 @@ "GroupQuotasEntityPatch", "GroupQuotasEntityPatchProperties", "GroupQuotasEntityProperties", + "IncomingQuotaTransfer", + "IncomingQuotaTransferApproveRequest", + "IncomingQuotaTransferProperties", + "IncomingQuotaTransferRejectRequest", "LimitJsonObject", "LimitObject", "OperationDisplay", @@ -138,6 +156,10 @@ "QuotaProperties", "QuotaRequestDetails", "QuotaRequestProperties", + "QuotaTransfer", + "QuotaTransferCancelRequest", + "QuotaTransferProperties", + "RejectionRecord", "Resource", "ResourceName", "ResourceUsages", @@ -162,6 +184,8 @@ "QuotaLimitTypes", "QuotaRequestState", "RequestState", + "TransferProvisioningState", + "TransferStatus", "UsagesTypes", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_enums.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_enums.py index da255b49fc37..0f48100aba08 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_enums.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_enums.py @@ -27,8 +27,11 @@ class EnforcementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enforcement status.""" ENABLED = "Enabled" + """ENABLED.""" DISABLED = "Disabled" + """DISABLED.""" NOT_AVAILABLE = "NotAvailable" + """NOT_AVAILABLE.""" class GroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -37,30 +40,38 @@ class GroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ALLOCATION_GROUP = "AllocationGroup" """The group is used for subscription group quota allocations.""" ENFORCED_GROUP = "EnforcedGroup" - """The group is used for the enforced shared limit scenario""" + """The group is used for the enforced shared limit scenario.""" class LimitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The limit object type.""" LIMIT_VALUE = "LimitValue" + """LIMIT_VALUE.""" class QuotaLimitTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The quota or usages limit types.""" INDEPENDENT = "Independent" + """INDEPENDENT.""" SHARED = "Shared" + """SHARED.""" class QuotaRequestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Quota request status.""" ACCEPTED = "Accepted" + """ACCEPTED.""" INVALID = "Invalid" + """INVALID.""" SUCCEEDED = "Succeeded" + """SUCCEEDED.""" FAILED = "Failed" + """FAILED.""" IN_PROGRESS = "InProgress" + """IN_PROGRESS.""" class RequestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -85,8 +96,46 @@ class RequestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The quota request has been canceled.""" +class TransferProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the ARM long-running operation that last wrote to a quota transfer + resource (the donor PUT, or the recipient approve / reject actions). Reflects the + infrastructure outcome of that call only; the business outcome of the transfer itself is + reported separately on ``transferStatus``. + """ + + SUCCEEDED = "Succeeded" + """The LRO completed successfully.""" + FAILED = "Failed" + """The LRO terminated with a failure.""" + CANCELED = "Canceled" + """The LRO was canceled before it reached a terminal state.""" + + +class TransferStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Business status of a quota transfer. Distinct from ``provisioningState``, which only reports + the ARM LRO outcome of the most recent call. + """ + + PENDING = "Pending" + """The transfer has been created on the donor side and is awaiting recipient action.""" + ACCEPTED = "Accepted" + """The recipient has approved the transfer; quota commit is in progress.""" + COMPLETED = "Completed" + """The transfer has been applied and quota is committed at the recipient.""" + CANCELLED = "Cancelled" + """The donor cancelled the transfer before it was approved.""" + REJECTED = "Rejected" + """The recipient rejected the transfer.""" + EXPIRED = "Expired" + """The transfer aged out before the recipient approved or rejected it.""" + FAILED = "Failed" + """The transfer terminated with a failure.""" + + class UsagesTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The quota or usages limit types.""" INDIVIDUAL = "Individual" + """INDIVIDUAL.""" COMBINED = "Combined" + """COMBINED.""" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py index d9aa44c64a0d..3dcfb90b2d32 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models.py @@ -18,7 +18,7 @@ from .. import models as _models -class AllocatedQuotaToSubscriptionList(_Model): +class AllocatedQuotaToSubscriptionList(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota allocated to subscriptions. :ivar value: List of Group Quota Limit allocated to subscriptions. @@ -48,7 +48,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AllocatedToSubscription(_Model): +class AllocatedToSubscription(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """SubscriptionIds and quota allocated to subscriptions from the GroupQuota. :ivar subscription_id: An Azure subscriptionId. @@ -86,6 +86,87 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ApprovalRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Record of an approval action on a transfer. + + :ivar comment: Optional free-text comment supplied by the approver. + :vartype comment: str + :ivar actor: Principal that performed the approval (typically a UPN or service principal id). + Required. + :vartype actor: str + :ivar occurred_at: Timestamp at which the approval was recorded. Required. + :vartype occurred_at: ~datetime.datetime + """ + + comment: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text comment supplied by the approver.""" + actor: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Principal that performed the approval (typically a UPN or service principal id). Required.""" + occurred_at: datetime.datetime = rest_field( + name="occurredAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp at which the approval was recorded. Required.""" + + @overload + def __init__( + self, + *, + actor: str, + occurred_at: datetime.datetime, + comment: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CancellationRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Record of a cancellation action on a transfer. + + :ivar reason: Optional free-text reason supplied by the donor when cancelling. + :vartype reason: str + :ivar actor: Principal that performed the cancellation. Required. + :vartype actor: str + :ivar occurred_at: Timestamp at which the cancellation was recorded. Required. + :vartype occurred_at: ~datetime.datetime + """ + + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text reason supplied by the donor when cancelling.""" + actor: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Principal that performed the cancellation. Required.""" + occurred_at: datetime.datetime = rest_field( + name="occurredAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp at which the cancellation was recorded. Required.""" + + @overload + def __init__( + self, + *, + actor: str, + occurred_at: datetime.datetime, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Resource(_Model): """Resource. @@ -131,7 +212,7 @@ class ExtensionResource(Resource): """ -class CurrentQuotaLimitBase(ExtensionResource): +class CurrentQuotaLimitBase(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota limit. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -173,7 +254,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CurrentUsagesBase(ExtensionResource): +class CurrentUsagesBase(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Resource usage. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -258,7 +339,7 @@ class ErrorDetail(_Model): """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -286,7 +367,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExceptionResponse(_Model): +class ExceptionResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error. :ivar error: API error details. @@ -314,7 +395,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaDetails(_Model): +class GroupQuotaDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Group Quota details. :ivar resource_name: The resource name, such as SKU name. @@ -393,7 +474,7 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) @@ -414,7 +495,7 @@ class GroupQuotaDetailsName(_Model): """Resource display name.""" -class GroupQuotaLimit(_Model): +class GroupQuotaLimit(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Group Quota limit. :ivar properties: Group Quota properties for the specified resource. @@ -461,7 +542,7 @@ class ProxyResource(Resource): """ -class GroupQuotaLimitList(ProxyResource): +class GroupQuotaLimitList(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """List of Group Quota Limit details. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -501,7 +582,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaLimitListProperties(_Model): +class GroupQuotaLimitListProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """GroupQuotaLimitListProperties. :ivar provisioning_state: Request status. Known values are: "Accepted", "Created", "Invalid", @@ -543,7 +624,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaLimitProperties(GroupQuotaDetails): +class GroupQuotaLimitProperties(GroupQuotaDetails): # pylint: disable=docstring-keyword-should-match-keyword-only """Group Quota properties for the specified resource. :ivar resource_name: The resource name, such as SKU name. @@ -600,12 +681,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) -class GroupQuotaRequestBase(_Model): +class GroupQuotaRequestBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The new GroupQuota limit requested. :ivar properties: @@ -634,7 +715,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaRequestBaseProperties(_Model): +class GroupQuotaRequestBaseProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """GroupQuotaRequestBaseProperties. :ivar limit: The new quota limit for the subscription. The incremental quota will be allocated @@ -697,7 +778,7 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) @@ -718,7 +799,7 @@ class GroupQuotaRequestBasePropertiesName(_Model): """Resource display name.""" -class GroupQuotasEnforcementStatus(ProxyResource): +class GroupQuotasEnforcementStatus(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The GroupQuota Enforcement status for a Azure Location/Region. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -758,7 +839,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEnforcementStatusProperties(_Model): +class GroupQuotasEnforcementStatusProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """GroupQuotasEnforcementStatusProperties. :ivar enforcement_enabled: Is the GroupQuota Enforcement enabled for the Azure region. Known @@ -806,7 +887,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntity(ProxyResource): +class GroupQuotasEntity(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. @@ -848,7 +929,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntityBase(_Model): +class GroupQuotasEntityBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. @@ -891,7 +972,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntityBasePatch(_Model): +class GroupQuotasEntityBasePatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. @@ -930,7 +1011,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntityPatch(ProxyResource): +class GroupQuotasEntityPatch(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. @@ -972,7 +1053,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntityPatchProperties(GroupQuotasEntityBasePatch): +class GroupQuotasEntityPatchProperties( + GroupQuotasEntityBasePatch +): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties. :ivar display_name: Display name of the GroupQuota entity. @@ -1000,7 +1083,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotasEntityProperties(GroupQuotasEntityBase): +class GroupQuotasEntityProperties(GroupQuotasEntityBase): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties. :ivar display_name: Display name of the GroupQuota entity. @@ -1030,7 +1113,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaSubscriptionId(ProxyResource): +class GroupQuotaSubscriptionId(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """This represents a Azure subscriptionId that is associated with a GroupQuotasEntity. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1070,7 +1153,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaSubscriptionIdProperties(_Model): +class GroupQuotaSubscriptionIdProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """GroupQuotaSubscriptionIdProperties. :ivar subscription_id: An Azure subscriptionId. @@ -1110,7 +1193,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaSubscriptionRequestStatus(ProxyResource): +class GroupQuotaSubscriptionRequestStatus(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The new quota limit request status. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1150,7 +1233,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaSubscriptionRequestStatusProperties(_Model): # pylint: disable=name-too-long +class GroupQuotaSubscriptionRequestStatusProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """GroupQuotaSubscriptionRequestStatusProperties. :ivar subscription_id: The subscription Id. @@ -1199,7 +1284,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GroupQuotaUsagesBase(_Model): +class GroupQuotaUsagesBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Resource details with usages and GroupQuota. :ivar name: Name of the resource provided by the resource provider. This property is already @@ -1268,12 +1353,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) -class GroupQuotaUsagesBaseName(_Model): +class GroupQuotaUsagesBaseName(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. @@ -1306,7 +1391,187 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LimitJsonObject(_Model): +class IncomingQuotaTransfer(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Recipient-side projection of a quota transfer. The URI key ``{transferId}`` is the + server-generated GUID returned to the donor in the PUT response under + ``properties.transferId``. The resource is read-only from the recipient side; state changes + occur through the approve and reject actions. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.quota.models.SystemData + :ivar properties: Properties of the incoming quota transfer. + :vartype properties: ~azure.mgmt.quota.models.IncomingQuotaTransferProperties + :ivar etag: "If etag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). + :vartype etag: str + """ + + properties: Optional["_models.IncomingQuotaTransferProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the incoming quota transfer.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """\"If etag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.IncomingQuotaTransferProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IncomingQuotaTransferApproveRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for the recipient approve action. + + :ivar comment: Optional free-text comment recorded on the transfer. + :vartype comment: str + """ + + comment: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text comment recorded on the transfer.""" + + @overload + def __init__( + self, + *, + comment: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IncomingQuotaTransferProperties(_Model): + """Recipient-side projection properties of a quota transfer. + + :ivar provisioning_state: The status of the underlying ARM resource operation. Known values + are: "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.TransferProvisioningState + :ivar transfer_status: The business status of the transfer. Known values are: "Pending", + "Accepted", "Completed", "Cancelled", "Rejected", "Expired", and "Failed". + :vartype transfer_status: str or ~azure.mgmt.quota.models.TransferStatus + :ivar transfer_id: Server-generated identifier of the transfer (matches the URI key). + :vartype transfer_id: str + :ivar transfer_ref: Fully qualified ARM resource id of the donor-side quotaTransfers resource. + :vartype transfer_ref: str + :ivar source_subscription_id: Donor subscription id. The recipient subscription is the one in + the request URI. + :vartype source_subscription_id: str + :ivar source_tenant_id: Donor tenant id, resolved by the service from the donor subscription. + :vartype source_tenant_id: str + :ivar billing_account_id: Billing account id both donor and recipient subscriptions roll up to. + :vartype billing_account_id: str + :ivar resource_name: The quota dimension being moved. + :vartype resource_name: str + :ivar amount: Amount being transferred in the resource's native unit. + :vartype amount: int + :ivar source_etag: ETag of the donor-side source document at the time the inbox entry was + projected. Used as the If-Match value on approve and reject requests. + :vartype source_etag: str + :ivar approval: Approval record. Populated when ``transferStatus`` is ``Accepted`` or + ``Completed``. Mutually exclusive with ``rejection``. + :vartype approval: ~azure.mgmt.quota.models.ApprovalRecord + :ivar rejection: Rejection record. Populated when ``transferStatus`` is ``Rejected``. Mutually + exclusive with ``approval``. + :vartype rejection: ~azure.mgmt.quota.models.RejectionRecord + """ + + provisioning_state: Optional[Union[str, "_models.TransferProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the underlying ARM resource operation. Known values are: \"Succeeded\", + \"Failed\", and \"Canceled\".""" + transfer_status: Optional[Union[str, "_models.TransferStatus"]] = rest_field( + name="transferStatus", visibility=["read"] + ) + """The business status of the transfer. Known values are: \"Pending\", \"Accepted\", + \"Completed\", \"Cancelled\", \"Rejected\", \"Expired\", and \"Failed\".""" + transfer_id: Optional[str] = rest_field(name="transferId", visibility=["read"]) + """Server-generated identifier of the transfer (matches the URI key).""" + transfer_ref: Optional[str] = rest_field(name="transferRef", visibility=["read"]) + """Fully qualified ARM resource id of the donor-side quotaTransfers resource.""" + source_subscription_id: Optional[str] = rest_field(name="sourceSubscriptionId", visibility=["read"]) + """Donor subscription id. The recipient subscription is the one in the request URI.""" + source_tenant_id: Optional[str] = rest_field(name="sourceTenantId", visibility=["read"]) + """Donor tenant id, resolved by the service from the donor subscription.""" + billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"]) + """Billing account id both donor and recipient subscriptions roll up to.""" + resource_name: Optional[str] = rest_field(name="resourceName", visibility=["read"]) + """The quota dimension being moved.""" + amount: Optional[int] = rest_field(visibility=["read"]) + """Amount being transferred in the resource's native unit.""" + source_etag: Optional[str] = rest_field(name="sourceEtag", visibility=["read"]) + """ETag of the donor-side source document at the time the inbox entry was projected. Used as the + If-Match value on approve and reject requests.""" + approval: Optional["_models.ApprovalRecord"] = rest_field(visibility=["read"]) + """Approval record. Populated when ``transferStatus`` is ``Accepted`` or ``Completed``. Mutually + exclusive with ``rejection``.""" + rejection: Optional["_models.RejectionRecord"] = rest_field(visibility=["read"]) + """Rejection record. Populated when ``transferStatus`` is ``Rejected``. Mutually exclusive with + ``approval``.""" + + +class IncomingQuotaTransferRejectRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for the recipient reject action. + + :ivar reason: Optional free-text reason recorded on the transfer. + :vartype reason: str + """ + + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text reason recorded on the transfer.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LimitJsonObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """LimitJson abstract class. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1340,7 +1605,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LimitObject(LimitJsonObject, discriminator="LimitValue"): +class LimitObject( + LimitJsonObject, discriminator="LimitValue" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The resource quota limit value. :ivar value: The quota/limit value. Required. @@ -1348,7 +1615,7 @@ class LimitObject(LimitJsonObject, discriminator="LimitValue"): :ivar limit_type: The quota or usages limit types. Known values are: "Independent" and "Shared". :vartype limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes - :ivar limit_object_type: The limit object type. Required. + :ivar limit_object_type: The limit object type. Required. LIMIT_VALUE. :vartype limit_object_type: str or ~azure.mgmt.quota.models.LIMIT_VALUE """ @@ -1359,7 +1626,7 @@ class LimitObject(LimitJsonObject, discriminator="LimitValue"): ) """The quota or usages limit types. Known values are: \"Independent\" and \"Shared\".""" limit_object_type: Literal[LimitType.LIMIT_VALUE] = rest_discriminator(name="limitObjectType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The limit object type. Required.""" + """The limit object type. Required. LIMIT_VALUE.""" @overload def __init__( @@ -1381,7 +1648,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.limit_object_type = LimitType.LIMIT_VALUE # type: ignore -class OperationDisplay(_Model): +class OperationDisplay(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """OperationDisplay. :ivar provider: Provider name. @@ -1424,7 +1691,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationResponse(_Model): +class OperationResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """OperationResponse. :ivar name: @@ -1461,7 +1728,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaAllocationRequestBase(_Model): +class QuotaAllocationRequestBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The new quota request allocated to subscription. :ivar properties: @@ -1490,7 +1757,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaAllocationRequestBaseProperties(_Model): +class QuotaAllocationRequestBaseProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """QuotaAllocationRequestBaseProperties. :ivar limit: The new quota limit for the subscription. The incremental quota will be allocated @@ -1546,7 +1813,7 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) @@ -1567,7 +1834,7 @@ class QuotaAllocationRequestBasePropertiesName(_Model): """Resource display name.""" -class QuotaAllocationRequestStatus(ProxyResource): +class QuotaAllocationRequestStatus(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The subscription quota allocation status. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1627,7 +1894,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class QuotaAllocationRequestStatusProperties(_Model): +class QuotaAllocationRequestStatusProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """QuotaAllocationRequestStatusProperties. :ivar requested_resource: The new quota request allocated to subscription. @@ -1677,7 +1944,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaProperties(_Model): +class QuotaProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota properties for the specified resource. :ivar limit: Resource quota limit properties. @@ -1691,11 +1958,8 @@ class QuotaProperties(_Model): :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For - example: - *P1D (per one day) - *PT1M (per one minute) - *PT1S (per one second). - This parameter is optional because, for some resources like compute, the period is irrelevant. + 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 @@ -1715,11 +1979,9 @@ class QuotaProperties(_Model): ) """The name of the resource type. Optional field.""" quota_period: Optional[str] = rest_field(name="quotaPeriod", visibility=["read"]) - """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.""" + """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.""" is_quota_applicable: Optional[bool] = rest_field(name="isQuotaApplicable", visibility=["read"]) """States if quota can be requested for this resource.""" properties: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1746,7 +2008,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaRequestDetails(ExtensionResource): +class QuotaRequestDetails(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """List of quota requests with details. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1807,7 +2069,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class QuotaRequestProperties(_Model): +class QuotaRequestProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota request properties. :ivar provisioning_state: The quota request status. Known values are: "Accepted", "Invalid", @@ -1862,7 +2124,257 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResourceName(_Model): +class QuotaTransfer(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A quota transfer authored on the donor side. The donor selects the URI segment + ``{transferName}``; the recipient addresses the same logical transfer via the server-generated + ``properties.transferId`` GUID on the ``incomingQuotaTransfers`` URI. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.quota.models.SystemData + :ivar properties: Properties of the quota transfer. + :vartype properties: ~azure.mgmt.quota.models.QuotaTransferProperties + :ivar etag: "If etag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). + :vartype etag: str + """ + + properties: Optional["_models.QuotaTransferProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the quota transfer.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """\"If etag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.QuotaTransferProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QuotaTransferCancelRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request body for the donor cancel action. + + :ivar reason: Optional free-text reason recorded on the transfer. + :vartype reason: str + """ + + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text reason recorded on the transfer.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QuotaTransferProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Donor-side properties of a quota transfer. + + :ivar provisioning_state: The status of the underlying ARM resource operation. Known values + are: "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.quota.models.TransferProvisioningState + :ivar transfer_status: The business status of the transfer. Known values are: "Pending", + "Accepted", "Completed", "Cancelled", "Rejected", "Expired", and "Failed". + :vartype transfer_status: str or ~azure.mgmt.quota.models.TransferStatus + :ivar transfer_id: Server-generated identifier the recipient uses to address the transfer on + the incomingQuotaTransfers URI. + :vartype transfer_id: str + :ivar display_name: Human-friendly label surfaced on customer GET responses and recipient inbox + listings. Required. + :vartype display_name: str + :ivar comment: Donor-supplied free-text rationale captured at submit time. + :vartype comment: str + :ivar destination_subscription_id: Recipient subscription id. Must differ from the donor + subscription. Required. + :vartype destination_subscription_id: str + :ivar destination_tenant_id: Recipient tenant id, resolved by the service from the recipient + subscription. + :vartype destination_tenant_id: str + :ivar billing_account_id: Billing account id both donor and recipient subscriptions must roll + up to. Required. + :vartype billing_account_id: str + :ivar resource_name: The quota dimension being moved, scoped by the URI's target provider (for + example, ``standardDv5Family`` under Microsoft.Compute). Required. + :vartype resource_name: str + :ivar amount: Amount to transfer in the resource's native unit (e.g. vCPU count). Required. + :vartype amount: int + :ivar auto_approve: Same-tenant one-shot opt-in. When true, the donor PUT admission-checks + recipient-side RBAC and cap at submit time and drives the transfer to terminal Completed within + the same LRO, with no recipient approve required. The outcome is reflected by + ``transferStatus``: ``Completed`` means the auto path committed; ``Pending`` means it did not + (e.g. cross-tenant, missing RBAC, cap exceeded) and the recipient must approve. + :vartype auto_approve: bool + :ivar created_at: Time the transfer was created. + :vartype created_at: ~datetime.datetime + :ivar expires_at: Time at which a Pending transfer expires if the recipient has not approved or + rejected it. + :vartype expires_at: ~datetime.datetime + :ivar created_by: Principal that created the transfer. + :vartype created_by: str + :ivar approval: Approval record. Populated when ``transferStatus`` is ``Accepted`` or + ``Completed``. Mutually exclusive with ``cancellation``. + :vartype approval: ~azure.mgmt.quota.models.ApprovalRecord + :ivar cancellation: Cancellation record. Populated when ``transferStatus`` is ``Cancelled``. + Mutually exclusive with ``approval``. + :vartype cancellation: ~azure.mgmt.quota.models.CancellationRecord + """ + + provisioning_state: Optional[Union[str, "_models.TransferProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the underlying ARM resource operation. Known values are: \"Succeeded\", + \"Failed\", and \"Canceled\".""" + transfer_status: Optional[Union[str, "_models.TransferStatus"]] = rest_field( + name="transferStatus", visibility=["read"] + ) + """The business status of the transfer. Known values are: \"Pending\", \"Accepted\", + \"Completed\", \"Cancelled\", \"Rejected\", \"Expired\", and \"Failed\".""" + transfer_id: Optional[str] = rest_field(name="transferId", visibility=["read"]) + """Server-generated identifier the recipient uses to address the transfer on the + incomingQuotaTransfers URI.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """Human-friendly label surfaced on customer GET responses and recipient inbox listings. Required.""" + comment: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Donor-supplied free-text rationale captured at submit time.""" + destination_subscription_id: str = rest_field( + name="destinationSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Recipient subscription id. Must differ from the donor subscription. Required.""" + destination_tenant_id: Optional[str] = rest_field(name="destinationTenantId", visibility=["read"]) + """Recipient tenant id, resolved by the service from the recipient subscription.""" + billing_account_id: str = rest_field( + name="billingAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Billing account id both donor and recipient subscriptions must roll up to. Required.""" + resource_name: str = rest_field(name="resourceName", visibility=["read", "create", "update", "delete", "query"]) + """The quota dimension being moved, scoped by the URI's target provider (for example, + ``standardDv5Family`` under Microsoft.Compute). Required.""" + amount: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Amount to transfer in the resource's native unit (e.g. vCPU count). Required.""" + auto_approve: Optional[bool] = rest_field( + name="autoApprove", visibility=["read", "create", "update", "delete", "query"] + ) + """Same-tenant one-shot opt-in. When true, the donor PUT admission-checks recipient-side RBAC and + cap at submit time and drives the transfer to terminal Completed within the same LRO, with no + recipient approve required. The outcome is reflected by ``transferStatus``: ``Completed`` means + the auto path committed; ``Pending`` means it did not (e.g. cross-tenant, missing RBAC, cap + exceeded) and the recipient must approve.""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + """Time the transfer was created.""" + expires_at: Optional[datetime.datetime] = rest_field(name="expiresAt", visibility=["read"], format="rfc3339") + """Time at which a Pending transfer expires if the recipient has not approved or rejected it.""" + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read"]) + """Principal that created the transfer.""" + approval: Optional["_models.ApprovalRecord"] = rest_field(visibility=["read"]) + """Approval record. Populated when ``transferStatus`` is ``Accepted`` or ``Completed``. Mutually + exclusive with ``cancellation``.""" + cancellation: Optional["_models.CancellationRecord"] = rest_field(visibility=["read"]) + """Cancellation record. Populated when ``transferStatus`` is ``Cancelled``. Mutually exclusive + with ``approval``.""" + + @overload + def __init__( + self, + *, + display_name: str, + destination_subscription_id: str, + billing_account_id: str, + resource_name: str, + amount: int, + comment: Optional[str] = None, + auto_approve: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RejectionRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Record of a rejection action on a transfer. + + :ivar reason: Optional free-text reason supplied by the recipient when rejecting. + :vartype reason: str + :ivar actor: Principal that performed the rejection. Required. + :vartype actor: str + :ivar occurred_at: Timestamp at which the rejection was recorded. Required. + :vartype occurred_at: ~datetime.datetime + """ + + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional free-text reason supplied by the recipient when rejecting.""" + actor: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Principal that performed the rejection. Required.""" + occurred_at: datetime.datetime = rest_field( + name="occurredAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp at which the rejection was recorded. Required.""" + + @overload + def __init__( + self, + *, + actor: str, + occurred_at: datetime.datetime, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceName(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Name of the resource provided by the resource Provider. When requesting quota, use this property name. @@ -1895,7 +2407,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResourceUsages(ProxyResource): +class ResourceUsages(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Resource details with usages and GroupQuota. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1936,7 +2448,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceError(_Model): +class ServiceError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """API error details. :ivar code: Error code. @@ -1988,7 +2500,7 @@ class ServiceErrorDetail(_Model): """Error message.""" -class SubmittedResourceRequestStatus(ProxyResource): +class SubmittedResourceRequestStatus(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Status of a single GroupQuota request. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2028,7 +2540,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubmittedResourceRequestStatusProperties(_Model): +class SubmittedResourceRequestStatusProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """SubmittedResourceRequestStatusProperties. :ivar requested_resource: Requested Resource. @@ -2078,7 +2590,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubRequest(_Model): +class SubRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Request property. :ivar name: Resource name. @@ -2138,7 +2650,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubscriptionQuotaAllocations(_Model): +class SubscriptionQuotaAllocations(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. @@ -2170,7 +2682,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubscriptionQuotaAllocationsList(ProxyResource): +class SubscriptionQuotaAllocationsList( + ExtensionResource +): # pylint: disable=docstring-keyword-should-match-keyword-only """Subscription quota list. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2210,7 +2724,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubscriptionQuotaAllocationsListProperties(_Model): # pylint: disable=name-too-long +class SubscriptionQuotaAllocationsListProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """SubscriptionQuotaAllocationsListProperties. :ivar provisioning_state: Request status. Known values are: "Accepted", "Created", "Invalid", @@ -2252,7 +2768,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SubscriptionQuotaDetails(_Model): +class SubscriptionQuotaDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Subscription Quota details. :ivar resource_name: The resource name, such as SKU name. @@ -2312,12 +2828,14 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) -class SubscriptionQuotaAllocationsProperties(SubscriptionQuotaDetails): +class SubscriptionQuotaAllocationsProperties( + SubscriptionQuotaDetails +): # pylint: disable=docstring-keyword-should-match-keyword-only """Quota properties for the specified resource. :ivar resource_name: The resource name, such as SKU name. @@ -2365,7 +2883,7 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.name is None: self.name = self._attr_to_rest_field["name"]._class_type() - setattr(self.properties, key, value) + setattr(self.name, key, value) else: super().__setattr__(key, value) @@ -2386,7 +2904,7 @@ class SubscriptionQuotaDetailsName(_Model): """Resource display name.""" -class SystemData(_Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -2453,7 +2971,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UsagesObject(_Model): +class UsagesObject(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The resource usages value. :ivar value: The usages value. Required. @@ -2489,7 +3007,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UsagesProperties(_Model): +class UsagesProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Usage properties for the specified resource. :ivar usages: The quota limit properties for this resource. @@ -2503,10 +3021,8 @@ class UsagesProperties(_Model): :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period for the summary of the quota usage values. For example: - *P1D (per one day) - *PT1M (per one minute) - *PT1S (per one second). - This parameter is optional because it is not relevant for all resources such as compute. + *P1D (per one day) *PT1M (per one minute) *PT1S (per one second). This parameter is optional + because it is not relevant for all resources such as compute. :vartype quota_period: str :ivar is_quota_applicable: States if quota can be requested for this resource. :vartype is_quota_applicable: bool @@ -2526,11 +3042,9 @@ class UsagesProperties(_Model): ) """The name of the resource type. Optional field.""" quota_period: Optional[str] = rest_field(name="quotaPeriod", visibility=["read"]) - """The time period for the summary of the quota usage values. For example: - *P1D (per one day) - *PT1M (per one minute) - *PT1S (per one second). - This parameter is optional because it is not relevant for all resources such as compute.""" + """The time period for the summary of the quota usage values. For example: *P1D (per one day) + *PT1M (per one minute) *PT1S (per one second). This parameter is optional because it is not + relevant for all resources such as compute.""" is_quota_applicable: Optional[bool] = rest_field(name="isQuotaApplicable", visibility=["read"]) """States if quota can be requested for this resource.""" properties: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_patch.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_patch.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level 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 index c2d50f3d9b8d..d7608052793e 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py @@ -14,6 +14,8 @@ from ._operations import QuotaOperationOperations # type: ignore from ._operations import QuotaRequestStatusOperations # type: ignore +from ._operations import QuotaTransfersOperations # type: ignore +from ._operations import IncomingQuotaTransfersOperations # type: ignore from ._operations import GroupQuotasOperations # type: ignore from ._operations import GroupQuotaLimitsRequestOperations # type: ignore from ._operations import GroupQuotaUsagesOperations # type: ignore @@ -33,6 +35,8 @@ __all__ = [ "QuotaOperationOperations", "QuotaRequestStatusOperations", + "QuotaTransfersOperations", + "IncomingQuotaTransfersOperations", "GroupQuotasOperations", "GroupQuotaLimitsRequestOperations", "GroupQuotaUsagesOperations", diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operations.py index f6f0ff56f4b4..72c904d82682 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_operations.py @@ -7,16 +7,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping +import datetime from io import IOBase import json from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +import uuid -from azure.core import PipelineClient +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -32,14 +35,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import QuotaMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import prep_if_match, prep_if_none_match +from .._validation import api_version_validation T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -50,7 +54,7 @@ def build_quota_operation_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +73,7 @@ def build_quota_request_status_get_request(id: str, scope: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +105,7 @@ def build_quota_request_status_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,11 +131,346 @@ def build_quota_request_status_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_quota_transfers_get_request( + target_provider: str, region: str, transfer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferName": _SERIALIZER.url("transfer_name", transfer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_quota_transfers_create_or_update_request( # pylint: disable=name-too-long + target_provider: str, region: str, transfer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferName": _SERIALIZER.url("transfer_name", transfer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_quota_transfers_delete_request( + target_provider: str, region: str, transfer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferName": _SERIALIZER.url("transfer_name", transfer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_quota_transfers_list_request( + target_provider: str, region: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_quota_transfers_cancel_request( + target_provider: str, region: str, transfer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferName": _SERIALIZER.url("transfer_name", transfer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_incoming_quota_transfers_get_request( # pylint: disable=name-too-long + target_provider: str, region: str, transfer_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferId": _SERIALIZER.url("transfer_id", transfer_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_incoming_quota_transfers_list_request( # pylint: disable=name-too-long + target_provider: str, region: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_incoming_quota_transfers_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Quota/incomingQuotaTransfers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_incoming_quota_transfers_approve_request( # pylint: disable=name-too-long + target_provider: str, + region: str, + transfer_id: str, + subscription_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/approve" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferId": _SERIALIZER.url("transfer_id", transfer_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_incoming_quota_transfers_reject_request( # pylint: disable=name-too-long + target_provider: str, + region: str, + transfer_id: str, + subscription_id: str, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/reject" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "targetProvider": _SERIALIZER.url("target_provider", target_provider, "str"), + "region": _SERIALIZER.url("region", region, "str"), + "transferId": _SERIALIZER.url("transfer_id", transfer_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if "Repeatability-Request-ID" not in _headers: + _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) + if "Repeatability-First-Sent" not in _headers: + _headers["Repeatability-First-Sent"] = _SERIALIZER.serialize_data( + datetime.datetime.now(datetime.timezone.utc), "rfc-1123" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_group_quotas_get_request(management_group_id: str, group_quota_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +498,7 @@ def build_group_quotas_create_or_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +526,7 @@ def build_group_quotas_update_request(management_group_id: str, group_quota_name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +552,7 @@ def build_group_quotas_update_request(management_group_id: str, group_quota_name def build_group_quotas_delete_request(management_group_id: str, group_quota_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) # Construct URL _url = "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}" path_format_arguments = { @@ -233,7 +572,7 @@ def build_group_quotas_list_request(management_group_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +598,7 @@ def build_group_quota_limits_request_list_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -289,7 +628,7 @@ def build_group_quota_limits_request_update_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +659,7 @@ def build_group_quota_limits_request_get_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +687,7 @@ def build_group_quota_usages_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +716,7 @@ def build_group_quota_subscriptions_get_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -405,7 +744,7 @@ def build_group_quota_subscriptions_create_or_update_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -433,7 +772,7 @@ def build_group_quota_subscriptions_update_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -460,7 +799,7 @@ def build_group_quota_subscriptions_delete_request( # pylint: disable=name-too- ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) # Construct URL _url = "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}" path_format_arguments = { @@ -483,7 +822,7 @@ def build_group_quota_subscriptions_list_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -510,7 +849,7 @@ def build_group_quota_subscription_requests_get_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -538,7 +877,7 @@ def build_group_quota_subscription_requests_list_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -565,7 +904,7 @@ def build_group_quota_limits_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -599,7 +938,7 @@ def build_group_quota_subscription_allocation_list_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -635,7 +974,7 @@ def build_group_quota_subscription_allocation_request_update_request( # pylint: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -672,7 +1011,7 @@ def build_group_quota_subscription_allocation_request_get_request( # pylint: di _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -708,7 +1047,7 @@ def build_group_quota_subscription_allocation_request_list_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -738,7 +1077,7 @@ def build_group_quota_location_settings_get_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -768,7 +1107,7 @@ def build_group_quota_location_settings_create_or_update_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -800,7 +1139,7 @@ def build_group_quota_location_settings_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -829,7 +1168,7 @@ def build_usages_get_request(resource_name: str, scope: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -854,7 +1193,7 @@ def build_usages_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -878,7 +1217,7 @@ def build_quota_get_request(resource_name: str, scope: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -903,8 +1242,8 @@ def build_quota_create_or_update_request(resource_name: str, scope: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -931,8 +1270,8 @@ def build_quota_update_request(resource_name: str, scope: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -959,7 +1298,7 @@ def build_quota_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -979,7 +1318,7 @@ def build_quota_list_request(scope: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class QuotaOperationOperations: +class QuotaOperationOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1043,7 +1382,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1056,7 +1398,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OperationResponse], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.OperationResponse], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1072,7 +1417,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1080,35 +1428,1874 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class QuotaRequestStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. +class QuotaRequestStatusOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.QuotaMgmtClient`'s + :attr:`quota_request_status` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: + """Get the quota request details and status by quota request ID for the resources of the resource + provider at a specific location. The quota request ID **id** is returned in the response of the + PUT operation. + + :param id: Quota request ID. Required. + :type id: str + :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. + :type scope: str + :return: QuotaRequestDetails. The QuotaRequestDetails is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) + cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) + + _request = build_quota_request_status_get_request( + id=id, + scope=scope, + api_version=api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaRequestDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, + scope: str, + *, + filter: Optional[str] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.QuotaRequestDetails"]: + """For the specified scope, get the current quota requests for a one year period ending at the + time is made. Use the **oData** filter to select quota requests. + + :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. + :type scope: str + :keyword filter: | Field | Supported operators + |---------------------|------------------------ + + |requestSubmitTime | ge, le, eq, gt, lt + |provisioningState eq {QuotaRequestState} + |resourceName eq {resourceName}. Default value is None. + :paramtype filter: str + :keyword top: Number of records to return. Default value is None. + :paramtype top: int + :keyword skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a + partial result. If a previous response contains a **nextLink** element, its value includes a + **skiptoken** parameter that specifies a starting point to use for subsequent calls. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of QuotaRequestDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaRequestDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QuotaRequestDetails]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_quota_request_status_list_request( + scope=scope, + filter=filter, + top=top, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QuotaRequestDetails], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class QuotaTransfersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.QuotaMgmtClient`'s + :attr:`quota_transfers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def get(self, target_provider: str, region: str, transfer_name: str, **kwargs: Any) -> _models.QuotaTransfer: + """Get a quota transfer. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + + _request = build_quota_transfers_get_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def _create_or_update_initial( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: Union[_models.QuotaTransfer, _types.QuotaTransfer, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_quota_transfers_create_or_update_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: _models.QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.quota.models.QuotaTransfer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns QuotaTransfer. The QuotaTransfer is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: _types.QuotaTransfer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.quota.types.QuotaTransfer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns QuotaTransfer. The QuotaTransfer is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns QuotaTransfer. The QuotaTransfer is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def begin_create_or_update( + self, + target_provider: str, + region: str, + transfer_name: str, + resource: Union[_models.QuotaTransfer, _types.QuotaTransfer, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.QuotaTransfer]: + """Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the cached + outcome and the same ``transferId``; a retry with a different financial body returns 409 + BodyMismatch. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param resource: Resource create parameters. Is either a QuotaTransfer type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.quota.models.QuotaTransfer or ~azure.mgmt.quota.types.QuotaTransfer + or IO[bytes] + :return: An instance of LROPoller that returns QuotaTransfer. The QuotaTransfer is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.QuotaTransfer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.QuotaTransfer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "transfer_name"] + }, + api_versions_list=["2026-09-01-preview"], + ) + def delete( # pylint: disable=inconsistent-return-statements + self, target_provider: str, region: str, transfer_name: str, **kwargs: Any + ) -> None: + """Delete a quota transfer record. Quota is not moved by delete; only the resource entry is + removed. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_quota_transfers_delete_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "accept"] + }, + api_versions_list=["2026-09-01-preview"], + ) + def list(self, target_provider: str, region: str, **kwargs: Any) -> ItemPaged["_models.QuotaTransfer"]: + """List quota transfers at the (subscription, targetProvider, region) scope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :return: An iterator like instance of QuotaTransfer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_quota_transfers_list_request( + target_provider=target_provider, + region=region, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QuotaTransfer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[_models.QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.QuotaTransferCancelRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[_types.QuotaTransferCancelRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.QuotaTransferCancelRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_name", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def cancel( + self, + target_provider: str, + region: str, + transfer_name: str, + body: Optional[Union[_models.QuotaTransferCancelRequest, _types.QuotaTransferCancelRequest, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.QuotaTransfer: + """Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled and returns + the refreshed resource envelope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. A transfer URI is + region-singular. Required. + :type region: str + :param transfer_name: The donor-chosen name segment of the quota transfer. Used as the + idempotency key + for retries on the donor side. Required. + :type transfer_name: str + :param body: The content of the action request. Is either a QuotaTransferCancelRequest type or + a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.QuotaTransferCancelRequest or + ~azure.mgmt.quota.types.QuotaTransferCancelRequest or IO[bytes] + :return: QuotaTransfer. The QuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.QuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.QuotaTransfer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_quota_transfers_cancel_request( + target_provider=target_provider, + region=region, + transfer_name=transfer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class IncomingQuotaTransfersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.quota.QuotaMgmtClient`'s + :attr:`incoming_quota_transfers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "accept", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def get(self, target_provider: str, region: str, transfer_id: str, **kwargs: Any) -> _models.IncomingQuotaTransfer: + """Get an incoming quota transfer. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) + + _request = build_incoming_quota_transfers_get_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": ["api_version", "subscription_id", "target_provider", "region", "accept"] + }, + api_versions_list=["2026-09-01-preview"], + ) + def list(self, target_provider: str, region: str, **kwargs: Any) -> ItemPaged["_models.IncomingQuotaTransfer"]: + """List incoming quota transfers at the (subscription, targetProvider, region) scope. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :return: An iterator like instance of IncomingQuotaTransfer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IncomingQuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_incoming_quota_transfers_list_request( + target_provider=target_provider, + region=region, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IncomingQuotaTransfer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={"2026-09-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2026-09-01-preview"], + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.IncomingQuotaTransfer"]: + """List incoming quota transfers across every targetProvider and region for the subscription. + + :return: An iterator like instance of IncomingQuotaTransfer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IncomingQuotaTransfer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_incoming_quota_transfers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IncomingQuotaTransfer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def _approve_initial( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferApproveRequest, _types.IncomingQuotaTransferApproveRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_incoming_quota_transfers_approve_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_models.IncomingQuotaTransferApproveRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IncomingQuotaTransfer. The IncomingQuotaTransfer + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_types.IncomingQuotaTransferApproveRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.IncomingQuotaTransferApproveRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IncomingQuotaTransfer. The IncomingQuotaTransfer + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IncomingQuotaTransfer. The IncomingQuotaTransfer + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def begin_approve( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferApproveRequest, _types.IncomingQuotaTransferApproveRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> LROPoller[_models.IncomingQuotaTransfer]: + """Approve a Pending incoming quota transfer. Long-running. The ``If-Match`` header value must + equal ``properties.sourceEtag`` returned on a prior GET; a stale value yields 412 + SourceResourceModified. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Is either a IncomingQuotaTransferApproveRequest + type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferApproveRequest or + ~azure.mgmt.quota.types.IncomingQuotaTransferApproveRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns IncomingQuotaTransfer. The IncomingQuotaTransfer + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.IncomingQuotaTransfer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._approve_initial( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + body=body, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IncomingQuotaTransfer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IncomingQuotaTransfer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_models.IncomingQuotaTransferRejectRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.quota.QuotaMgmtClient`'s - :attr:`quota_request_status` attribute. - """ + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[_types.IncomingQuotaTransferRejectRequest] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.quota.types.IncomingQuotaTransferRejectRequest + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: QuotaMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[IO[bytes]] = None, + *, + etag: str, + match_condition: MatchConditions, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Default value is None. + :type body: IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails: - """Get the quota request details and status by quota request ID for the resources of the resource - provider at a specific location. The quota request ID **id** is returned in the response of the - PUT operation. - - :param id: Quota request ID. Required. - :type id: str - :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. - :type scope: str - :return: QuotaRequestDetails. The QuotaRequestDetails is compatible with MutableMapping - :rtype: ~azure.mgmt.quota.models.QuotaRequestDetails + @api_version_validation( + method_added_on="2026-09-01-preview", + params_added_on={ + "2026-09-01-preview": [ + "api_version", + "subscription_id", + "target_provider", + "region", + "transfer_id", + "repeatability_request_id", + "repeatability_first_sent", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-09-01-preview"], + ) + def reject( + self, + target_provider: str, + region: str, + transfer_id: str, + body: Optional[ + Union[_models.IncomingQuotaTransferRejectRequest, _types.IncomingQuotaTransferRejectRequest, IO[bytes]] + ] = None, + *, + etag: str, + match_condition: MatchConditions, + **kwargs: Any + ) -> _models.IncomingQuotaTransfer: + """Reject a Pending incoming quota transfer. Synchronous. The ``If-Match`` header value must equal + ``properties.sourceEtag`` returned on a prior GET. + + :param target_provider: The ARM provider namespace whose quota is being transferred (for + example, + ``Microsoft.Compute``). Required. + :type target_provider: str + :param region: The Azure region the quota transfer applies to. Required. + :type region: str + :param transfer_id: Server-generated identifier of the transfer (matches + ``properties.transferId``). Required. + :type transfer_id: str + :param body: The content of the action request. Is either a IncomingQuotaTransferRejectRequest + type or a IO[bytes] type. Default value is None. + :type body: ~azure.mgmt.quota.models.IncomingQuotaTransferRejectRequest or + ~azure.mgmt.quota.types.IncomingQuotaTransferRejectRequest or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Required. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Required. + :paramtype match_condition: ~azure.core.MatchConditions + :return: IncomingQuotaTransfer. The IncomingQuotaTransfer is compatible with MutableMapping + :rtype: ~azure.mgmt.quota.models.IncomingQuotaTransfer :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1117,17 +3304,41 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.IncomingQuotaTransfer] = kwargs.pop("cls", None) - _request = build_quota_request_status_get_request( - id=id, - scope=scope, + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_incoming_quota_transfers_reject_request( + target_provider=target_provider, + region=region, + transfer_id=transfer_id, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -1136,6 +3347,7 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1150,133 +3362,24 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QuotaRequestDetails, response.json()) + deserialized = _deserialize(_models.IncomingQuotaTransfer, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, - scope: str, - *, - filter: Optional[str] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.QuotaRequestDetails"]: - """For the specified scope, get the current quota requests for a one year period ending at the - time is made. Use the **oData** filter to select quota requests. - - :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. - :type scope: str - :keyword filter: | Field | Supported operators - |---------------------|------------------------ - - |requestSubmitTime | ge, le, eq, gt, lt - |provisioningState eq {QuotaRequestState} - |resourceName eq {resourceName}. Default value is None. - :paramtype filter: str - :keyword top: Number of records to return. Default value is None. - :paramtype top: int - :keyword skiptoken: The **Skiptoken** parameter is used only if a previous operation returned a - partial result. If a previous response contains a **nextLink** element, its value includes a - **skiptoken** parameter that specifies a starting point to use for subsequent calls. Default - value is None. - :paramtype skiptoken: str - :return: An iterator like instance of QuotaRequestDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.quota.models.QuotaRequestDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.QuotaRequestDetails]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quota_request_status_list_request( - scope=scope, - filter=filter, - top=top, - skiptoken=skiptoken, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaRequestDetails], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class GroupQuotasOperations: +class GroupQuotasOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1332,6 +3435,7 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1346,11 +3450,14 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotasEntity, response.json()) @@ -1363,7 +3470,9 @@ def _create_or_update_initial( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, JSON, IO[bytes]]] = None, + group_quota_put_request_body: Optional[ + Union[_models.GroupQuotasEntity, _types.GroupQuotasEntity, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1405,6 +3514,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1418,7 +3528,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1429,7 +3542,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1476,7 +3589,7 @@ def begin_create_or_update( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[JSON] = None, + group_quota_put_request_body: Optional[_types.GroupQuotasEntity] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1496,7 +3609,7 @@ def begin_create_or_update( :type group_quota_name: str :param group_quota_put_request_body: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type group_quota_put_request_body: JSON + :type group_quota_put_request_body: ~azure.mgmt.quota.types.GroupQuotasEntity :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1546,7 +3659,9 @@ def begin_create_or_update( self, management_group_id: str, group_quota_name: str, - group_quota_put_request_body: Optional[Union[_models.GroupQuotasEntity, JSON, IO[bytes]]] = None, + group_quota_put_request_body: Optional[ + Union[_models.GroupQuotasEntity, _types.GroupQuotasEntity, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.GroupQuotasEntity]: """Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The @@ -1563,10 +3678,10 @@ def begin_create_or_update( context tenantId/MgId. Required. :type group_quota_name: str :param group_quota_put_request_body: The GroupQuota body details for creation or update of a - GroupQuota entity. Is one of the following types: GroupQuotasEntity, JSON, IO[bytes] Default - value is None. - :type group_quota_put_request_body: ~azure.mgmt.quota.models.GroupQuotasEntity or JSON or - IO[bytes] + GroupQuota entity. Is either a GroupQuotasEntity type or a IO[bytes] type. Default value is + None. + :type group_quota_put_request_body: ~azure.mgmt.quota.models.GroupQuotasEntity or + ~azure.mgmt.quota.types.GroupQuotasEntity or IO[bytes] :return: An instance of LROPoller that returns GroupQuotasEntity. The GroupQuotasEntity is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEntity] @@ -1629,7 +3744,9 @@ def _update_initial( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, JSON, IO[bytes]]] = None, + group_quotas_patch_request_body: Optional[ + Union[_models.GroupQuotasEntityPatch, _types.GroupQuotasEntityPatch, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1671,6 +3788,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1684,7 +3802,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1695,7 +3816,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1719,9 +3840,9 @@ def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1744,7 +3865,7 @@ def begin_update( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[JSON] = None, + group_quotas_patch_request_body: Optional[_types.GroupQuotasEntityPatch] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1756,9 +3877,9 @@ def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1766,7 +3887,7 @@ def begin_update( context tenantId/MgId. Required. :type group_quota_name: str :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Default value is None. - :type group_quotas_patch_request_body: JSON + :type group_quotas_patch_request_body: ~azure.mgmt.quota.types.GroupQuotasEntityPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1793,9 +3914,9 @@ def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -1818,7 +3939,9 @@ def begin_update( self, management_group_id: str, group_quota_name: str, - group_quotas_patch_request_body: Optional[Union[_models.GroupQuotasEntityPatch, JSON, IO[bytes]]] = None, + group_quotas_patch_request_body: Optional[ + Union[_models.GroupQuotasEntityPatch, _types.GroupQuotasEntityPatch, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.GroupQuotasEntity]: """Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the @@ -1828,19 +3951,19 @@ def begin_update( `_. Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in retry-after header. Once the operation gets to terminal state - Succeeded | - Failed, then the URI will change to Get URI and full details can be checked. - Any change in the filters will be applicable to the future quota assignments, existing quota - allocated to subscriptions from the GroupQuotas remains unchanged. + Failed, then the URI will change to Get URI and full details can be checked. Any change in the + filters will be applicable to the future quota assignments, existing quota allocated to + subscriptions from the GroupQuotas remains unchanged. :param management_group_id: The management group ID. Required. :type management_group_id: str :param group_quota_name: The GroupQuota name. The name should be unique for the provided context tenantId/MgId. Required. :type group_quota_name: str - :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Is one of the following - types: GroupQuotasEntityPatch, JSON, IO[bytes] Default value is None. - :type group_quotas_patch_request_body: ~azure.mgmt.quota.models.GroupQuotasEntityPatch or JSON - or IO[bytes] + :param group_quotas_patch_request_body: The GroupQuotas Patch Request. Is either a + GroupQuotasEntityPatch type or a IO[bytes] type. Default value is None. + :type group_quotas_patch_request_body: ~azure.mgmt.quota.models.GroupQuotasEntityPatch or + ~azure.mgmt.quota.types.GroupQuotasEntityPatch or IO[bytes] :return: An instance of LROPoller that returns GroupQuotasEntity. The GroupQuotasEntity is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEntity] @@ -1925,6 +4048,7 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1938,7 +4062,10 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1949,7 +4076,7 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2065,7 +4192,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2078,7 +4208,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.GroupQuotasEntity], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.GroupQuotasEntity], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2094,7 +4227,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2102,7 +4238,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GroupQuotaLimitsRequestOperations: +class GroupQuotaLimitsRequestOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2191,7 +4327,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2204,7 +4343,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SubmittedResourceRequestStatus], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SubmittedResourceRequestStatus], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2220,7 +4362,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2233,7 +4378,7 @@ def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[Union[_models.GroupQuotaLimitList, JSON, IO[bytes]]] = None, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, _types.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2277,6 +4422,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2290,7 +4436,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2301,7 +4450,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2322,10 +4471,10 @@ def begin_update( ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -2356,17 +4505,17 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[JSON] = None, + group_quota_request: Optional[_types.GroupQuotaLimitList] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -2380,7 +4529,7 @@ def begin_update( :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific resourceProvider/location/resources. Default value is None. - :type group_quota_request: JSON + :type group_quota_request: ~azure.mgmt.quota.types.GroupQuotaLimitList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2404,10 +4553,10 @@ def begin_update( ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -2438,15 +4587,15 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - group_quota_request: Optional[Union[_models.GroupQuotaLimitList, JSON, IO[bytes]]] = None, + group_quota_request: Optional[Union[_models.GroupQuotaLimitList, _types.GroupQuotaLimitList, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.GroupQuotaLimitList]: """Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are specified in the request body. Only 1 resource quota can be - requested. Please note that patch request creates a new groupQuota request. - Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - retry-after duration in seconds to check the intermediate status. This API provides the finals - status with the request details and status. + requested. Please note that patch request creates a new groupQuota request. Use the polling API + - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after + duration in seconds to check the intermediate status. This API provides the finals status with + the request details and status. :param management_group_id: The management group ID. Required. :type management_group_id: str @@ -2459,9 +4608,10 @@ def begin_update( :param location: The name of the Azure region. Required. :type location: str :param group_quota_request: The GroupQuotaRequest body details for specific - resourceProvider/location/resources. Is one of the following types: GroupQuotaLimitList, JSON, - IO[bytes] Default value is None. - :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or JSON or IO[bytes] + resourceProvider/location/resources. Is either a GroupQuotaLimitList type or a IO[bytes] type. + Default value is None. + :type group_quota_request: ~azure.mgmt.quota.models.GroupQuotaLimitList or + ~azure.mgmt.quota.types.GroupQuotaLimitList or IO[bytes] :return: An instance of LROPoller that returns GroupQuotaLimitList. The GroupQuotaLimitList is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotaLimitList] @@ -2566,6 +4716,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2580,11 +4731,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SubmittedResourceRequestStatus, response.json()) @@ -2594,7 +4748,7 @@ def get( return deserialized # type: ignore -class GroupQuotaUsagesOperations: +class GroupQuotaUsagesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2674,7 +4828,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2687,7 +4844,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ResourceUsages], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ResourceUsages], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2703,7 +4863,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2711,7 +4874,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GroupQuotaSubscriptionsOperations: +class GroupQuotaSubscriptionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2769,6 +4932,7 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2783,11 +4947,14 @@ def get(self, management_group_id: str, group_quota_name: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaSubscriptionId, response.json()) @@ -2825,6 +4992,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2838,7 +5006,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2849,7 +5020,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2951,6 +5122,7 @@ def _update_initial(self, management_group_id: str, group_quota_name: str, **kwa } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2964,7 +5136,10 @@ def _update_initial(self, management_group_id: str, group_quota_name: str, **kwa except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2975,7 +5150,7 @@ def _update_initial(self, management_group_id: str, group_quota_name: str, **kwa response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3076,6 +5251,7 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3089,7 +5265,10 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3100,7 +5279,7 @@ def _delete_initial(self, management_group_id: str, group_quota_name: str, **kwa response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3221,7 +5400,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3234,7 +5416,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.GroupQuotaSubscriptionId], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.GroupQuotaSubscriptionId], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3250,7 +5435,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3258,7 +5446,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GroupQuotaSubscriptionRequestsOperations: +class GroupQuotaSubscriptionRequestsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3322,6 +5510,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3336,11 +5525,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaSubscriptionRequestStatus, response.json()) @@ -3407,7 +5599,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3421,7 +5616,8 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.GroupQuotaSubscriptionRequestStatus], deserialized.get("value", []) + List[_models.GroupQuotaSubscriptionRequestStatus], + deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -3438,7 +5634,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3446,7 +5645,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GroupQuotaLimitsOperations: +class GroupQuotaLimitsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3511,6 +5710,7 @@ def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3525,11 +5725,14 @@ def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotaLimitList, response.json()) @@ -3539,7 +5742,7 @@ def list( return deserialized # type: ignore -class GroupQuotaSubscriptionAllocationOperations: # pylint: disable=name-too-long +class GroupQuotaSubscriptionAllocationOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3608,6 +5811,7 @@ def list( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3622,11 +5826,14 @@ def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SubscriptionQuotaAllocationsList, response.json()) @@ -3636,7 +5843,7 @@ def list( return deserialized # type: ignore -class GroupQuotaSubscriptionAllocationRequestOperations: # pylint: disable=name-too-long +class GroupQuotaSubscriptionAllocationRequestOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3659,7 +5866,9 @@ def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, JSON, IO[bytes]], + allocate_quota_request: Union[ + _models.SubscriptionQuotaAllocationsList, _types.SubscriptionQuotaAllocationsList, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3700,6 +5909,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3713,7 +5923,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3724,7 +5937,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3779,7 +5992,7 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: JSON, + allocate_quota_request: _types.SubscriptionQuotaAllocationsList, *, content_type: str = "application/json", **kwargs: Any @@ -3802,7 +6015,7 @@ def begin_update( :param location: The name of the Azure region. Required. :type location: str :param allocate_quota_request: Quota requests payload. Required. - :type allocate_quota_request: JSON + :type allocate_quota_request: ~azure.mgmt.quota.types.SubscriptionQuotaAllocationsList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3861,7 +6074,9 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - allocate_quota_request: Union[_models.SubscriptionQuotaAllocationsList, JSON, IO[bytes]], + allocate_quota_request: Union[ + _models.SubscriptionQuotaAllocationsList, _types.SubscriptionQuotaAllocationsList, IO[bytes] + ], **kwargs: Any ) -> LROPoller[_models.SubscriptionQuotaAllocationsList]: """Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to @@ -3881,10 +6096,10 @@ def begin_update( :type resource_provider_name: str :param location: The name of the Azure region. Required. :type location: str - :param allocate_quota_request: Quota requests payload. Is one of the following types: - SubscriptionQuotaAllocationsList, JSON, IO[bytes] Required. - :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or JSON - or IO[bytes] + :param allocate_quota_request: Quota requests payload. Is either a + SubscriptionQuotaAllocationsList type or a IO[bytes] type. Required. + :type allocate_quota_request: ~azure.mgmt.quota.models.SubscriptionQuotaAllocationsList or + ~azure.mgmt.quota.types.SubscriptionQuotaAllocationsList or IO[bytes] :return: An instance of LROPoller that returns SubscriptionQuotaAllocationsList. The SubscriptionQuotaAllocationsList is compatible with MutableMapping :rtype: @@ -3999,6 +6214,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4013,11 +6229,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.QuotaAllocationRequestStatus, response.json()) @@ -4101,7 +6320,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4114,7 +6336,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.QuotaAllocationRequestStatus], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.QuotaAllocationRequestStatus], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4130,7 +6355,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4138,7 +6366,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GroupQuotaLocationSettingsOperations: +class GroupQuotaLocationSettingsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4204,6 +6432,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4218,11 +6447,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.GroupQuotasEnforcementStatus, response.json()) @@ -4237,7 +6469,9 @@ def _create_or_update_initial( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4281,6 +6515,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4294,7 +6529,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4305,7 +6543,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4367,7 +6605,7 @@ def begin_create_or_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[JSON] = None, + location_settings: Optional[_types.GroupQuotasEnforcementStatus] = None, *, content_type: str = "application/json", **kwargs: Any @@ -4398,7 +6636,7 @@ def begin_create_or_update( :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type location_settings: JSON + :type location_settings: ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4463,7 +6701,9 @@ def begin_create_or_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.GroupQuotasEnforcementStatus]: """Enables the GroupQuotas enforcement for the resource provider and the location specified. The @@ -4491,10 +6731,10 @@ def begin_create_or_update( :param location: The name of the Azure region. Required. :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is one of the following types: GroupQuotasEnforcementStatus, JSON, IO[bytes] Default - value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or JSON or - IO[bytes] + entity. Is either a GroupQuotasEnforcementStatus type or a IO[bytes] type. Default value is + None. + :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or + ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus or IO[bytes] :return: An instance of LROPoller that returns GroupQuotasEnforcementStatus. The GroupQuotasEnforcementStatus is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementStatus] @@ -4561,7 +6801,9 @@ def _update_initial( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4605,6 +6847,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4618,7 +6861,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4629,7 +6875,7 @@ def _update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4691,7 +6937,7 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[JSON] = None, + location_settings: Optional[_types.GroupQuotasEnforcementStatus] = None, *, content_type: str = "application/json", **kwargs: Any @@ -4722,7 +6968,7 @@ def begin_update( :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota entity. Default value is None. - :type location_settings: JSON + :type location_settings: ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4787,7 +7033,9 @@ def begin_update( group_quota_name: str, resource_provider_name: str, location: str, - location_settings: Optional[Union[_models.GroupQuotasEnforcementStatus, JSON, IO[bytes]]] = None, + location_settings: Optional[ + Union[_models.GroupQuotasEnforcementStatus, _types.GroupQuotasEnforcementStatus, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.GroupQuotasEnforcementStatus]: """Enables the GroupQuotas enforcement for the resource provider and the location specified. The @@ -4815,10 +7063,10 @@ def begin_update( :param location: The name of the Azure region. Required. :type location: str :param location_settings: The GroupQuota body details for creation or update of a GroupQuota - entity. Is one of the following types: GroupQuotasEnforcementStatus, JSON, IO[bytes] Default - value is None. - :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or JSON or - IO[bytes] + entity. Is either a GroupQuotasEnforcementStatus type or a IO[bytes] type. Default value is + None. + :type location_settings: ~azure.mgmt.quota.models.GroupQuotasEnforcementStatus or + ~azure.mgmt.quota.types.GroupQuotasEnforcementStatus or IO[bytes] :return: An instance of LROPoller that returns GroupQuotasEnforcementStatus. The GroupQuotasEnforcementStatus is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.GroupQuotasEnforcementStatus] @@ -4880,7 +7128,7 @@ def get_long_running_output(pipeline_response): ) -class UsagesOperations: +class UsagesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4922,14 +7170,15 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) cls: ClsType[_models.CurrentUsagesBase] = kwargs.pop("cls", None) _request = build_usages_get_request( resource_name=resource_name, scope=scope, - api_version=self._config.api_version, + api_version=api_version, headers=_headers, params=_params, ) @@ -4938,6 +7187,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4952,14 +7202,17 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.CurrentUsagesBase, response.json()) @@ -5018,7 +7271,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5031,7 +7287,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CurrentUsagesBase], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CurrentUsagesBase], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5047,7 +7306,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5055,7 +7317,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class QuotaOperations: +class QuotaOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -5098,14 +7360,15 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) _request = build_quota_get_request( resource_name=resource_name, scope=scope, - api_version=self._config.api_version, + api_version=api_version, headers=_headers, params=_params, ) @@ -5114,6 +7377,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5128,14 +7392,17 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.CurrentQuotaLimitBase, response.json()) @@ -5148,7 +7415,7 @@ def _create_or_update_initial( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5160,8 +7427,9 @@ def _create_or_update_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -5175,8 +7443,8 @@ def _create_or_update_initial( _request = build_quota_create_or_update_request( resource_name=resource_name, scope=scope, + api_version=api_version, content_type=content_type, - api_version=self._config.api_version, content=_content, headers=_headers, params=_params, @@ -5186,6 +7454,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5199,7 +7468,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5207,7 +7479,7 @@ def _create_or_update_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5257,7 +7529,7 @@ def begin_create_or_update( self, resource_name: str, scope: str, - create_quota_request: JSON, + create_quota_request: _types.CurrentQuotaLimitBase, *, content_type: str = "application/json", **kwargs: Any @@ -5280,7 +7552,7 @@ def begin_create_or_update( :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str :param create_quota_request: Quota request payload. Required. - :type create_quota_request: JSON + :type create_quota_request: ~azure.mgmt.quota.types.CurrentQuotaLimitBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5333,7 +7605,7 @@ def begin_create_or_update( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Create or update the quota limit for the specified resource with the requested value. To update @@ -5353,17 +7625,19 @@ def begin_create_or_update( :type resource_name: str :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str - :param create_quota_request: Quota request payload. Is one of the following types: - CurrentQuotaLimitBase, JSON, IO[bytes] Required. - :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or JSON or IO[bytes] + :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a + IO[bytes] type. Required. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or + ~azure.mgmt.quota.types.CurrentQuotaLimitBase or IO[bytes] :return: An instance of LROPoller that returns CurrentQuotaLimitBase. The CurrentQuotaLimitBase is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5374,6 +7648,7 @@ def begin_create_or_update( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, + api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5417,7 +7692,7 @@ def _update_initial( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5429,8 +7704,9 @@ def _update_initial( error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -5444,8 +7720,8 @@ def _update_initial( _request = build_quota_update_request( resource_name=resource_name, scope=scope, + api_version=api_version, content_type=content_type, - api_version=self._config.api_version, content=_content, headers=_headers, params=_params, @@ -5455,6 +7731,7 @@ def _update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5468,7 +7745,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5477,7 +7757,7 @@ def _update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5526,7 +7806,7 @@ def begin_update( self, resource_name: str, scope: str, - create_quota_request: JSON, + create_quota_request: _types.CurrentQuotaLimitBase, *, content_type: str = "application/json", **kwargs: Any @@ -5548,7 +7828,7 @@ def begin_update( :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str :param create_quota_request: Quota requests payload. Required. - :type create_quota_request: JSON + :type create_quota_request: ~azure.mgmt.quota.types.CurrentQuotaLimitBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5600,7 +7880,7 @@ def begin_update( self, resource_name: str, scope: str, - create_quota_request: Union[_models.CurrentQuotaLimitBase, JSON, IO[bytes]], + create_quota_request: Union[_models.CurrentQuotaLimitBase, _types.CurrentQuotaLimitBase, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.CurrentQuotaLimitBase]: """Update the quota limit for a specific resource to the specified value: @@ -5619,17 +7899,19 @@ def begin_update( :type resource_name: str :param scope: The fully qualified Azure Resource manager identifier of the resource. Required. :type scope: str - :param create_quota_request: Quota requests payload. Is one of the following types: - CurrentQuotaLimitBase, JSON, IO[bytes] Required. - :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or JSON or IO[bytes] + :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or + a IO[bytes] type. Required. + :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or + ~azure.mgmt.quota.types.CurrentQuotaLimitBase or IO[bytes] :return: An instance of LROPoller that returns CurrentQuotaLimitBase. The CurrentQuotaLimitBase is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.quota.models.CurrentQuotaLimitBase] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5640,6 +7922,7 @@ def begin_update( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, + api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5730,7 +8013,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5743,7 +8029,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CurrentQuotaLimitBase], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CurrentQuotaLimitBase], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5759,7 +8048,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ExceptionResponse, response) + error = _failsafe_deserialize( + _models.ExceptionResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_patch.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_patch.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/types.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/types.py new file mode 100644 index 000000000000..a1c31fe110c2 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/types.py @@ -0,0 +1,855 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import LimitType + +if TYPE_CHECKING: + from .models import ( + CreatedByType, + EnforcementState, + GroupType, + QuotaLimitTypes, + RequestState, + TransferProvisioningState, + TransferStatus, + ) + + +class AllocatedQuotaToSubscriptionList(TypedDict, total=False): + """Quota allocated to subscriptions. + + :ivar value: List of Group Quota Limit allocated to subscriptions. + :vartype value: list["AllocatedToSubscription"] + """ + + value: list["AllocatedToSubscription"] + """List of Group Quota Limit allocated to subscriptions.""" + + +class AllocatedToSubscription(TypedDict, total=False): + """SubscriptionIds and quota allocated to subscriptions from the GroupQuota. + + :ivar subscriptionId: An Azure subscriptionId. + :vartype subscriptionId: str + :ivar quotaAllocated: The amount of quota allocated to this subscriptionId from the + GroupQuotasEntity. + :vartype quotaAllocated: int + """ + + subscriptionId: str + """An Azure subscriptionId.""" + quotaAllocated: int + """The amount of quota allocated to this subscriptionId from the GroupQuotasEntity.""" + + +class ApprovalRecord(TypedDict, total=False): + """Record of an approval action on a transfer. + + :ivar comment: Optional free-text comment supplied by the approver. + :vartype comment: str + :ivar actor: Principal that performed the approval (typically a UPN or service principal id). + Required. + :vartype actor: str + :ivar occurredAt: Timestamp at which the approval was recorded. Required. + :vartype occurredAt: str + """ + + comment: str + """Optional free-text comment supplied by the approver.""" + actor: Required[str] + """Principal that performed the approval (typically a UPN or service principal id). Required.""" + occurredAt: Required[str] + """Timestamp at which the approval was recorded. Required.""" + + +class CancellationRecord(TypedDict, total=False): + """Record of a cancellation action on a transfer. + + :ivar reason: Optional free-text reason supplied by the donor when cancelling. + :vartype reason: str + :ivar actor: Principal that performed the cancellation. Required. + :vartype actor: str + :ivar occurredAt: Timestamp at which the cancellation was recorded. Required. + :vartype occurredAt: str + """ + + reason: str + """Optional free-text reason supplied by the donor when cancelling.""" + actor: Required[str] + """Principal that performed the cancellation. Required.""" + occurredAt: Required[str] + """Timestamp at which the cancellation was recorded. Required.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ExtensionResource(Resource): + """The base extension resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class CurrentQuotaLimitBase(ExtensionResource): + """Quota limit. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Quota properties for the specified resource, based on the API called, Quotas + or Usages. + :vartype properties: "QuotaProperties" + """ + + properties: "QuotaProperties" + """Quota properties for the specified resource, based on the API called, Quotas or Usages.""" + + +class GroupQuotaDetails(TypedDict, total=False): + """Group Quota details. + + :ivar resourceName: The resource name, such as SKU name. + :vartype resourceName: str + :ivar limit: The current Group Quota Limit at the parentId level. + :vartype limit: int + :ivar comment: Any comment related to quota request. + :vartype comment: str + :ivar unit: The usages 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 + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: "GroupQuotaDetailsName" + :ivar availableLimit: The available Group Quota Limit at the MG level. This Group quota can be + allocated to subscription(s). + :vartype availableLimit: int + :ivar allocatedToSubscriptions: Quota allocated to subscriptions. + :vartype allocatedToSubscriptions: "AllocatedQuotaToSubscriptionList" + """ + + resourceName: str + """The resource name, such as SKU name.""" + limit: int + """The current Group Quota Limit at the parentId level.""" + comment: str + """Any comment related to quota request.""" + unit: str + """The usages 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.""" + name: "GroupQuotaDetailsName" + """Name of the resource provided by the resource provider. This property is already included in + the request URI, so it is a readonly property returned in the response.""" + availableLimit: int + """The available Group Quota Limit at the MG level. This Group quota can be allocated to + subscription(s).""" + allocatedToSubscriptions: "AllocatedQuotaToSubscriptionList" + """Quota allocated to subscriptions.""" + + +class GroupQuotaDetailsName(TypedDict, total=False): + """Name of the resource provided by the resource provider. This property is already included in + the request URI, so it is a readonly property returned in the response. + + :ivar value: Resource name. + :vartype value: str + :ivar localizedValue: Resource display name. + :vartype localizedValue: str + """ + + value: str + """Resource name.""" + localizedValue: str + """Resource display name.""" + + +class GroupQuotaLimit(TypedDict, total=False): + """Group Quota limit. + + :ivar properties: Group Quota properties for the specified resource. + :vartype properties: "GroupQuotaLimitProperties" + """ + + properties: "GroupQuotaLimitProperties" + """Group Quota properties for the specified resource.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class GroupQuotaLimitList(ProxyResource): + """List of Group Quota Limit details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: + :vartype properties: "GroupQuotaLimitListProperties" + """ + + properties: "GroupQuotaLimitListProperties" + + +class GroupQuotaLimitListProperties(TypedDict, total=False): + """GroupQuotaLimitListProperties. + + :ivar provisioningState: Request status. Known values are: "Accepted", "Created", "Invalid", + "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + :ivar value: List of Group Quota Limit details. + :vartype value: list["GroupQuotaLimit"] + :ivar nextLink: The URL to use for getting the next set of results. + :vartype nextLink: str + """ + + provisioningState: Union[str, "RequestState"] + """Request status. Known values are: \"Accepted\", \"Created\", \"Invalid\", \"Succeeded\", + \"Escalated\", \"Failed\", \"InProgress\", and \"Canceled\".""" + value: list["GroupQuotaLimit"] + """List of Group Quota Limit details.""" + nextLink: str + """The URL to use for getting the next set of results.""" + + +class GroupQuotaLimitProperties(GroupQuotaDetails): + """Group Quota properties for the specified resource. + + :ivar resourceName: The resource name, such as SKU name. + :vartype resourceName: str + :ivar limit: The current Group Quota Limit at the parentId level. + :vartype limit: int + :ivar comment: Any comment related to quota request. + :vartype comment: str + :ivar unit: The usages 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 + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: "GroupQuotaDetailsName" + :ivar availableLimit: The available Group Quota Limit at the MG level. This Group quota can be + allocated to subscription(s). + :vartype availableLimit: int + :ivar allocatedToSubscriptions: Quota allocated to subscriptions. + :vartype allocatedToSubscriptions: "AllocatedQuotaToSubscriptionList" + """ + + +class GroupQuotasEnforcementStatus(ProxyResource): + """The GroupQuota Enforcement status for a Azure Location/Region. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: + :vartype properties: "GroupQuotasEnforcementStatusProperties" + """ + + properties: "GroupQuotasEnforcementStatusProperties" + + +class GroupQuotasEnforcementStatusProperties(TypedDict, total=False): + """GroupQuotasEnforcementStatusProperties. + + :ivar enforcementEnabled: Is the GroupQuota Enforcement enabled for the Azure region. Known + values are: "Enabled", "Disabled", and "NotAvailable". + :vartype enforcementEnabled: Union[str, "EnforcementState"] + :ivar enforcedGroupName: The name of the group that is enforced. + :vartype enforcedGroupName: str + :ivar provisioningState: Request status. Known values are: "Accepted", "Created", "Invalid", + "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + :ivar faultCode: Details of the failure. + :vartype faultCode: str + """ + + enforcementEnabled: Union[str, "EnforcementState"] + """Is the GroupQuota Enforcement enabled for the Azure region. Known values are: \"Enabled\", + \"Disabled\", and \"NotAvailable\".""" + enforcedGroupName: str + """The name of the group that is enforced.""" + provisioningState: Union[str, "RequestState"] + """Request status. Known values are: \"Accepted\", \"Created\", \"Invalid\", \"Succeeded\", + \"Escalated\", \"Failed\", \"InProgress\", and \"Canceled\".""" + faultCode: str + """Details of the failure.""" + + +class GroupQuotasEntity(ExtensionResource): + """Properties and filters for ShareQuota. The request parameter is optional, if there are no + filters specified. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Properties. + :vartype properties: "GroupQuotasEntityProperties" + """ + + properties: "GroupQuotasEntityProperties" + """Properties.""" + + +class GroupQuotasEntityBase(TypedDict, total=False): + """Properties and filters for ShareQuota. The request parameter is optional, if there are no + filters specified. + + :ivar displayName: Display name of the GroupQuota entity. + :vartype displayName: str + :ivar groupType: Type of the group. Known values are: "AllocationGroup" and "EnforcedGroup". + :vartype groupType: Union[str, "GroupType"] + :ivar provisioningState: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + """ + + displayName: str + """Display name of the GroupQuota entity.""" + groupType: Union[str, "GroupType"] + """Type of the group. Known values are: \"AllocationGroup\" and \"EnforcedGroup\".""" + provisioningState: Union[str, "RequestState"] + """Provisioning state of the operation. Known values are: \"Accepted\", \"Created\", \"Invalid\", + \"Succeeded\", \"Escalated\", \"Failed\", \"InProgress\", and \"Canceled\".""" + + +class GroupQuotasEntityBasePatch(TypedDict, total=False): + """Properties and filters for ShareQuota. The request parameter is optional, if there are no + filters specified. + + :ivar displayName: Display name of the GroupQuota entity. + :vartype displayName: str + :ivar provisioningState: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + """ + + displayName: str + """Display name of the GroupQuota entity.""" + provisioningState: Union[str, "RequestState"] + """Provisioning state of the operation. Known values are: \"Accepted\", \"Created\", \"Invalid\", + \"Succeeded\", \"Escalated\", \"Failed\", \"InProgress\", and \"Canceled\".""" + + +class GroupQuotasEntityPatch(ProxyResource): + """Properties and filters for ShareQuota. The request parameter is optional, if there are no + filters specified. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Properties. + :vartype properties: "GroupQuotasEntityPatchProperties" + """ + + properties: "GroupQuotasEntityPatchProperties" + """Properties.""" + + +class GroupQuotasEntityPatchProperties(GroupQuotasEntityBasePatch): + """Properties. + + :ivar displayName: Display name of the GroupQuota entity. + :vartype displayName: str + :ivar provisioningState: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + """ + + +class GroupQuotasEntityProperties(GroupQuotasEntityBase): + """Properties. + + :ivar displayName: Display name of the GroupQuota entity. + :vartype displayName: str + :ivar groupType: Type of the group. Known values are: "AllocationGroup" and "EnforcedGroup". + :vartype groupType: Union[str, "GroupType"] + :ivar provisioningState: Provisioning state of the operation. Known values are: "Accepted", + "Created", "Invalid", "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + """ + + +class IncomingQuotaTransferApproveRequest(TypedDict, total=False): + """Request body for the recipient approve action. + + :ivar comment: Optional free-text comment recorded on the transfer. + :vartype comment: str + """ + + comment: str + """Optional free-text comment recorded on the transfer.""" + + +class IncomingQuotaTransferRejectRequest(TypedDict, total=False): + """Request body for the recipient reject action. + + :ivar reason: Optional free-text reason recorded on the transfer. + :vartype reason: str + """ + + reason: str + """Optional free-text reason recorded on the transfer.""" + + +class LimitObject(TypedDict, total=False): + """The resource quota limit value. + + :ivar value: The quota/limit value. Required. + :vartype value: int + :ivar limitType: The quota or usages limit types. Known values are: "Independent" and "Shared". + :vartype limitType: Union[str, "QuotaLimitTypes"] + :ivar limitObjectType: The limit object type. Required. LIMIT_VALUE. + :vartype limitObjectType: Literal[LimitType.LIMIT_VALUE] + """ + + value: Required[int] + """The quota/limit value. Required.""" + limitType: Union[str, "QuotaLimitTypes"] + """The quota or usages limit types. Known values are: \"Independent\" and \"Shared\".""" + limitObjectType: Required[Literal[LimitType.LIMIT_VALUE]] + """The limit object type. Required. LIMIT_VALUE.""" + + +class QuotaProperties(TypedDict, total=False): + """Quota properties for the specified resource. + + :ivar limit: Resource quota limit properties. + :vartype limit: "LimitJsonObject" + :ivar unit: The quota units, such as Count and Bytes. When requesting quota, use the **unit** + value returned in the GET response in the request body of your PUT operation. + :vartype unit: str + :ivar name: Resource name provided by the resource provider. Use this property name when + requesting quota. + :vartype name: "ResourceName" + :ivar resourceType: The name of the resource type. Optional field. + :vartype resourceType: str + :ivar quotaPeriod: 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 quotaPeriod: str + :ivar isQuotaApplicable: States if quota can be requested for this resource. + :vartype isQuotaApplicable: bool + :ivar properties: Additional properties for the specific resource provider. + :vartype properties: Any + """ + + limit: "LimitJsonObject" + """Resource quota limit properties.""" + unit: str + """The quota units, such as Count and Bytes. When requesting quota, use the **unit** value + returned in the GET response in the request body of your PUT operation.""" + name: "ResourceName" + """Resource name provided by the resource provider. Use this property name when requesting quota.""" + resourceType: str + """The name of the resource type. Optional field.""" + quotaPeriod: str + """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.""" + isQuotaApplicable: bool + """States if quota can be requested for this resource.""" + properties: Any + """Additional properties for the specific resource provider.""" + + +class QuotaTransfer(ProxyResource): + """A quota transfer authored on the donor side. The donor selects the URI segment + ``{transferName}``; the recipient addresses the same logical transfer via the server-generated + ``properties.transferId`` GUID on the ``incomingQuotaTransfers`` URI. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: Properties of the quota transfer. + :vartype properties: "QuotaTransferProperties" + :ivar etag: "If etag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). + :vartype etag: str + """ + + properties: "QuotaTransferProperties" + """Properties of the quota transfer.""" + etag: str + """\"If etag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" + + +class QuotaTransferCancelRequest(TypedDict, total=False): + """Request body for the donor cancel action. + + :ivar reason: Optional free-text reason recorded on the transfer. + :vartype reason: str + """ + + reason: str + """Optional free-text reason recorded on the transfer.""" + + +class QuotaTransferProperties(TypedDict, total=False): + """Donor-side properties of a quota transfer. + + :ivar provisioningState: The status of the underlying ARM resource operation. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype provisioningState: Union[str, "TransferProvisioningState"] + :ivar transferStatus: The business status of the transfer. Known values are: "Pending", + "Accepted", "Completed", "Cancelled", "Rejected", "Expired", and "Failed". + :vartype transferStatus: Union[str, "TransferStatus"] + :ivar transferId: Server-generated identifier the recipient uses to address the transfer on the + incomingQuotaTransfers URI. + :vartype transferId: str + :ivar displayName: Human-friendly label surfaced on customer GET responses and recipient inbox + listings. Required. + :vartype displayName: str + :ivar comment: Donor-supplied free-text rationale captured at submit time. + :vartype comment: str + :ivar destinationSubscriptionId: Recipient subscription id. Must differ from the donor + subscription. Required. + :vartype destinationSubscriptionId: str + :ivar destinationTenantId: Recipient tenant id, resolved by the service from the recipient + subscription. + :vartype destinationTenantId: str + :ivar billingAccountId: Billing account id both donor and recipient subscriptions must roll up + to. Required. + :vartype billingAccountId: str + :ivar resourceName: The quota dimension being moved, scoped by the URI's target provider (for + example, ``standardDv5Family`` under Microsoft.Compute). Required. + :vartype resourceName: str + :ivar amount: Amount to transfer in the resource's native unit (e.g. vCPU count). Required. + :vartype amount: int + :ivar autoApprove: Same-tenant one-shot opt-in. When true, the donor PUT admission-checks + recipient-side RBAC and cap at submit time and drives the transfer to terminal Completed within + the same LRO, with no recipient approve required. The outcome is reflected by + ``transferStatus``: ``Completed`` means the auto path committed; ``Pending`` means it did not + (e.g. cross-tenant, missing RBAC, cap exceeded) and the recipient must approve. + :vartype autoApprove: bool + :ivar createdAt: Time the transfer was created. + :vartype createdAt: str + :ivar expiresAt: Time at which a Pending transfer expires if the recipient has not approved or + rejected it. + :vartype expiresAt: str + :ivar createdBy: Principal that created the transfer. + :vartype createdBy: str + :ivar approval: Approval record. Populated when ``transferStatus`` is ``Accepted`` or + ``Completed``. Mutually exclusive with ``cancellation``. + :vartype approval: "ApprovalRecord" + :ivar cancellation: Cancellation record. Populated when ``transferStatus`` is ``Cancelled``. + Mutually exclusive with ``approval``. + :vartype cancellation: "CancellationRecord" + """ + + provisioningState: Union[str, "TransferProvisioningState"] + """The status of the underlying ARM resource operation. Known values are: \"Succeeded\", + \"Failed\", and \"Canceled\".""" + transferStatus: Union[str, "TransferStatus"] + """The business status of the transfer. Known values are: \"Pending\", \"Accepted\", + \"Completed\", \"Cancelled\", \"Rejected\", \"Expired\", and \"Failed\".""" + transferId: str + """Server-generated identifier the recipient uses to address the transfer on the + incomingQuotaTransfers URI.""" + displayName: Required[str] + """Human-friendly label surfaced on customer GET responses and recipient inbox listings. Required.""" + comment: str + """Donor-supplied free-text rationale captured at submit time.""" + destinationSubscriptionId: Required[str] + """Recipient subscription id. Must differ from the donor subscription. Required.""" + destinationTenantId: str + """Recipient tenant id, resolved by the service from the recipient subscription.""" + billingAccountId: Required[str] + """Billing account id both donor and recipient subscriptions must roll up to. Required.""" + resourceName: Required[str] + """The quota dimension being moved, scoped by the URI's target provider (for example, + ``standardDv5Family`` under Microsoft.Compute). Required.""" + amount: Required[int] + """Amount to transfer in the resource's native unit (e.g. vCPU count). Required.""" + autoApprove: bool + """Same-tenant one-shot opt-in. When true, the donor PUT admission-checks recipient-side RBAC and + cap at submit time and drives the transfer to terminal Completed within the same LRO, with no + recipient approve required. The outcome is reflected by ``transferStatus``: ``Completed`` means + the auto path committed; ``Pending`` means it did not (e.g. cross-tenant, missing RBAC, cap + exceeded) and the recipient must approve.""" + createdAt: str + """Time the transfer was created.""" + expiresAt: str + """Time at which a Pending transfer expires if the recipient has not approved or rejected it.""" + createdBy: str + """Principal that created the transfer.""" + approval: "ApprovalRecord" + """Approval record. Populated when ``transferStatus`` is ``Accepted`` or ``Completed``. Mutually + exclusive with ``cancellation``.""" + cancellation: "CancellationRecord" + """Cancellation record. Populated when ``transferStatus`` is ``Cancelled``. Mutually exclusive + with ``approval``.""" + + +class ResourceName(TypedDict, total=False): + """Name of the resource provided by the resource Provider. When requesting quota, use this + property name. + + :ivar value: Resource name. + :vartype value: str + :ivar localizedValue: Resource display name. + :vartype localizedValue: str + """ + + value: str + """Resource name.""" + localizedValue: str + """Resource display name.""" + + +class SubscriptionQuotaAllocations(TypedDict, total=False): + """Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + This will include the GroupQuota and total quota allocated to the subscription. Only the Group + quota allocated to the subscription can be allocated back to the MG Group Quota. + + :ivar properties: Quota properties for the specified resource. + :vartype properties: "SubscriptionQuotaAllocationsProperties" + """ + + properties: "SubscriptionQuotaAllocationsProperties" + """Quota properties for the specified resource.""" + + +class SubscriptionQuotaAllocationsList(ExtensionResource): + """Subscription quota list. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: + :vartype properties: "SubscriptionQuotaAllocationsListProperties" + """ + + properties: "SubscriptionQuotaAllocationsListProperties" + + +class SubscriptionQuotaAllocationsListProperties(TypedDict, total=False): # pylint: disable=name-too-long + """SubscriptionQuotaAllocationsListProperties. + + :ivar provisioningState: Request status. Known values are: "Accepted", "Created", "Invalid", + "Succeeded", "Escalated", "Failed", "InProgress", and "Canceled". + :vartype provisioningState: Union[str, "RequestState"] + :ivar value: Subscription quota list. + :vartype value: list["SubscriptionQuotaAllocations"] + :ivar nextLink: The URL to use for getting the next set of results. + :vartype nextLink: str + """ + + provisioningState: Union[str, "RequestState"] + """Request status. Known values are: \"Accepted\", \"Created\", \"Invalid\", \"Succeeded\", + \"Escalated\", \"Failed\", \"InProgress\", and \"Canceled\".""" + value: list["SubscriptionQuotaAllocations"] + """Subscription quota list.""" + nextLink: str + """The URL to use for getting the next set of results.""" + + +class SubscriptionQuotaDetails(TypedDict, total=False): + """Subscription Quota details. + + :ivar resourceName: The resource name, such as SKU name. + :vartype resourceName: str + :ivar limit: The total quota limit for the subscription. + :vartype limit: int + :ivar shareableQuota: The shareable quota for the subscription. + :vartype shareableQuota: int + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: "SubscriptionQuotaDetailsName" + """ + + resourceName: str + """The resource name, such as SKU name.""" + limit: int + """The total quota limit for the subscription.""" + shareableQuota: int + """The shareable quota for the subscription.""" + name: "SubscriptionQuotaDetailsName" + """Name of the resource provided by the resource provider. This property is already included in + the request URI, so it is a readonly property returned in the response.""" + + +class SubscriptionQuotaAllocationsProperties(SubscriptionQuotaDetails): + """Quota properties for the specified resource. + + :ivar resourceName: The resource name, such as SKU name. + :vartype resourceName: str + :ivar limit: The total quota limit for the subscription. + :vartype limit: int + :ivar shareableQuota: The shareable quota for the subscription. + :vartype shareableQuota: int + :ivar name: Name of the resource provided by the resource provider. This property is already + included in the request URI, so it is a readonly property returned in the response. + :vartype name: "SubscriptionQuotaDetailsName" + """ + + +class SubscriptionQuotaDetailsName(TypedDict, total=False): + """Name of the resource provided by the resource provider. This property is already included in + the request URI, so it is a readonly property returned in the response. + + :ivar value: Resource name. + :vartype value: str + :ivar localizedValue: Resource display name. + :vartype localizedValue: str + """ + + value: str + """Resource name.""" + localizedValue: str + """Resource display name.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +LimitJsonObject = Union[LimitObject] diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quota_subscriptions.py index b99b1fc7d22d..006c4b791ccf 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quota_subscriptions.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quotas.py index 080462ee357e..fc2b71bb80f4 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/delete_group_quotas.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-09-01/GroupQuotas/DeleteGroupQuotas.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotas/DeleteGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py index b7d02e8bc4cf..60db1b13f500 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getComputeOneSkuQuotaLimit.json +# x-ms-original-file: 2026-09-01-preview/getComputeOneSkuQuotaLimit.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py index 489917f8709f..2aa8858351af 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getComputeOneSkuUsages.json +# x-ms-original-file: 2026-09-01-preview/getComputeOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py index 12e5932067c6..0ed0588cf4e9 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getComputeQuotaLimits.json +# x-ms-original-file: 2026-09-01-preview/getComputeQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py index 172fab2b025e..f1c67b58e285 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getComputeUsages.json +# x-ms-original-file: 2026-09-01-preview/getComputeUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_enforcement.py index c9477cc71abd..3f7cb17184af 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_enforcement.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/GetGroupQuotaEnforcement.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/GetGroupQuotaEnforcement.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_subscriptions.py index a923cfdfab4a..124723504195 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_subscriptions.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_usages.py index 4c66989259fe..f8e7ce9f5f39 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quota_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/GroupQuotaUsages/GetGroupQuotaUsages.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotaUsages/GetGroupQuotaUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quotas.py index cacebaa35cda..d6744ab1ce00 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotas/GetGroupQuotas.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotas/GetGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py index 3cfa8747c659..86bd116db7ad 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getMachineLearningServicesQuotaLimits.json +# x-ms-original-file: 2026-09-01-preview/getMachineLearningServicesQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py index 918b6859944f..9f037440122e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getMachineLearningServicesUsages.json +# x-ms-original-file: 2026-09-01-preview/getMachineLearningServicesUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py index 410ec11487c9..4d4dcc9789ac 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getNetworkOneSkuQuotaLimit.json +# x-ms-original-file: 2026-09-01-preview/getNetworkOneSkuQuotaLimit.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py index 895197366f0c..416de3c0bc39 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getNetworkOneSkuUsages.json +# x-ms-original-file: 2026-09-01-preview/getNetworkOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py index 204e1800aeef..2867cbb66dc5 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getNetworkQuotaLimits.json +# x-ms-original-file: 2026-09-01-preview/getNetworkQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py index 889720eb123e..a58d0fdeddcc 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getNetworkUsages.json +# x-ms-original-file: 2026-09-01-preview/getNetworkUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py new file mode 100644 index 000000000000..7466e3c9abb8 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python get_operations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_operation.list() + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/GetOperations.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py index adf6e3585596..f159dbad734a 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getQuotaRequestStatusById.json +# x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusById.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py index ac4fe6906c69..9eca075b1dac 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getQuotaRequestStatusFailed.json +# x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusFailed.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py index a4fe2f3cdb74..b15dda9b0e17 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/getQuotaRequestStatusInProgress.json +# x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusInProgress.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py index 953e5266f412..8d24084b31ea 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/getQuotaRequestsHistory.json +# x-ms-original-file: 2026-09-01-preview/getQuotaRequestsHistory.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_get.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_get.py index acd90bcdbf33..caef78568fcf 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_get.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_list.py index b4d6dbdc24cd..f588e218bfd4 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_list.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/group_quota_limits_requests_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_approve.py b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_approve.py new file mode 100644 index 000000000000..ff55bb3e7f16 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_approve.py @@ -0,0 +1,45 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python incoming_quota_transfers_approve.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.incoming_quota_transfers.begin_approve( + target_provider="Microsoft.Compute", + region="eastus", + transfer_id="12345678-1234-1234-1234-1234567890ab", + etag="abc123", + match_condition=~azure.core.MatchConditions, + ).result() + print(response) + + +# x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Approve.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_get.py b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_get.py new file mode 100644 index 000000000000..8fc48953635e --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_get.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python incoming_quota_transfers_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.incoming_quota_transfers.get( + target_provider="Microsoft.Compute", + region="eastus", + transfer_id="12345678-1234-1234-1234-1234567890ab", + ) + print(response) + + +# x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list.py new file mode 100644 index 000000000000..c951743a6317 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python incoming_quota_transfers_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.incoming_quota_transfers.list( + target_provider="Microsoft.Compute", + region="eastus", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_List.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list_by_subscription.py b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list_by_subscription.py new file mode 100644 index 000000000000..b4c2a3b4f9e2 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python incoming_quota_transfers_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.incoming_quota_transfers.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_reject.py b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_reject.py new file mode 100644 index 000000000000..aaa8516367bd --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/incoming_quota_transfers_reject.py @@ -0,0 +1,45 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python incoming_quota_transfers_reject.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.incoming_quota_transfers.reject( + target_provider="Microsoft.Compute", + region="eastus", + transfer_id="12345678-1234-1234-1234-1234567890ab", + etag="abc123", + match_condition=~azure.core.MatchConditions, + ) + print(response) + + +# x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Reject.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_limits_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_limits_compute.py index 9f490d1cf53d..9e4dadd5e096 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_limits_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_limits_compute.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotaLimits/ListGroupQuotaLimits-Compute.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotaLimits/ListGroupQuotaLimits-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_subscriptions.py b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_subscriptions.py index b4f76b67201a..bf7032e34953 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_subscriptions.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quota_subscriptions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quotas.py index 49f6426c3709..ebc29a39a1dd 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/list_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/GroupQuotas/ListGroupQuotas.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotas/ListGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py index 207619d8ddd8..3ead965f3ada 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/patchComputeQuotaRequest.json +# x-ms-original-file: 2026-09-01-preview/patchComputeQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_enforcement.py index e685a2e86504..ee0bd468af38 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_enforcement.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PatchGroupQuotaEnforcement.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PatchGroupQuotaEnforcement.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_limits_requests_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_limits_requests_compute.py index 9cda2f86fdb9..b136ec4da9c8 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_limits_requests_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quota_limits_requests_compute.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas.py index 93bda586e5b2..1815bfce237e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotas/PatchGroupQuotas.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotas/PatchGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas_subscription.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas_subscription.py index 2fbc0d3cef8b..59c4a61dc915 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas_subscription.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_group_quotas_subscription.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py index 4569e9380088..5ab092ce2b03 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/patchNetworkOneSkuQuotaRequest.json +# x-ms-original-file: 2026-09-01-preview/patchNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/patch_subscription_quota_allocation_request_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_subscription_quota_allocation_request_compute.py index cf8bff35dbd9..b21b53af5219 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/patch_subscription_quota_allocation_request_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_subscription_quota_allocation_request_compute.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py index 5e761974da00..6add007f2791 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/putComputeOneSkuQuotaRequest.json +# x-ms-original-file: 2026-09-01-preview/putComputeOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement.py index 0b4e89c8bb28..844eb647e5ab 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PutGroupQuotaEnforcement.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PutGroupQuotaEnforcement.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement_failed.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement_failed.py index e1d6f73c2306..cc9a41977fbe 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement_failed.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quota_enforcement_failed.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PutGroupQuotaEnforcementFailed.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PutGroupQuotaEnforcementFailed.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas.py index 4f789e13c591..5845b4237e99 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotas/PutGroupQuotas.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotas/PutGroupQuotas.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas_subscription.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas_subscription.py index d7e332560be5..3bab20ca3990 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas_subscription.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_group_quotas_subscription.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json +# x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py index a2b09e83e500..d903f37bfa13 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/putMachineLearningServicesQuotaRequestLowPriority.json +# x-ms-original-file: 2026-09-01-preview/putMachineLearningServicesQuotaRequestLowPriority.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py index 2908f47c7a18..0e8f3abf50b7 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/putNetworkOneSkuQuotaRequest.json +# x-ms-original-file: 2026-09-01-preview/putNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py index 29f238d379fd..8759aaa4b121 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json +# x-ms-original-file: 2026-09-01-preview/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_cancel.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_cancel.py new file mode 100644 index 000000000000..a02cb7d5339a --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_cancel.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_cancel.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_transfers.cancel( + target_provider="Microsoft.Compute", + region="eastus", + transfer_name="compute-stdDv5-uplift-101", + ) + print(response) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Cancel.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update.py new file mode 100644 index 000000000000..026233884a36 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update.py @@ -0,0 +1,54 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_transfers.begin_create_or_update( + target_provider="Microsoft.Compute", + region="eastus", + transfer_name="compute-stdDv5-uplift-101", + resource={ + "properties": { + "amount": 50, + "autoApprove": False, + "billingAccountId": "1234567890", + "comment": "Backfill for new prod fleet rollout.", + "destinationSubscriptionId": "aaaaaaaa-bbbb-cccc-dddd-000000000002", + "displayName": "Move 50 Dv5 vCPU to recipient", + "resourceName": "standardDv5Family", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update_auto_approve.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update_auto_approve.py new file mode 100644 index 000000000000..e16b8058079b --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_create_or_update_auto_approve.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_create_or_update_auto_approve.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_transfers.begin_create_or_update( + target_provider="Microsoft.Compute", + region="eastus", + transfer_name="compute-stdDv5-autoapprove-202", + resource={ + "properties": { + "amount": 25, + "autoApprove": True, + "billingAccountId": "1234567890", + "destinationSubscriptionId": "aaaaaaaa-bbbb-cccc-dddd-000000000002", + "displayName": "Move 25 Dv5 vCPU - auto approved", + "resourceName": "standardDv5Family", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_CreateOrUpdate_AutoApprove.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_delete.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_delete.py new file mode 100644 index 000000000000..d68079874756 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_delete.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.quota_transfers.delete( + target_provider="Microsoft.Compute", + region="eastus", + transfer_name="compute-stdDv5-uplift-101", + ) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_get.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_get.py new file mode 100644 index 000000000000..ed5f27e11c3d --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_get.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_transfers.get( + target_provider="Microsoft.Compute", + region="eastus", + transfer_name="compute-stdDv5-uplift-101", + ) + print(response) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_list.py new file mode 100644 index 000000000000..29274067371f --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/quota_transfers_list.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.quota import QuotaMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python quota_transfers_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = QuotaMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.quota_transfers.list( + target_provider="Microsoft.Compute", + region="eastus", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_List.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_list_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_list_compute.py index 4b5b1072cc9c..1b3ef42d9c80 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_list_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_list_compute.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_get_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_get_compute.py index a28ce95abfc7..9696fb6aed58 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_get_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_get_compute.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_list_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_list_compute.py index ee926efc80f6..9ef1cbfda52c 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_list_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_quota_allocation_requests_list_compute.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_get.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_get.py index 600f4dea870a..a025df2a47eb 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_get.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/SubscriptionRequests/SubscriptionRequests_Get.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionRequests/SubscriptionRequests_Get.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_list.py b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_list.py index 899cd3849668..62fd1819b439 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_list.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/subscription_requests_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/SubscriptionRequests/SubscriptionRequests_List.json +# x-ms-original-file: 2026-09-01-preview/SubscriptionRequests/SubscriptionRequests_List.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations.py new file mode 100644 index 000000000000..d8e846955ed7 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations.py @@ -0,0 +1,78 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtIncomingQuotaTransfersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_incoming_quota_transfers_get(self, resource_group): + response = self.client.incoming_quota_transfers.get( + target_provider="str", + region="str", + transfer_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_incoming_quota_transfers_list(self, resource_group): + response = self.client.incoming_quota_transfers.list( + target_provider="str", + region="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_incoming_quota_transfers_list_by_subscription(self, resource_group): + response = self.client.incoming_quota_transfers.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_incoming_quota_transfers_begin_approve(self, resource_group): + response = self.client.incoming_quota_transfers.begin_approve( + target_provider="str", + region="str", + transfer_id="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_incoming_quota_transfers_reject(self, resource_group): + response = self.client.incoming_quota_transfers.reject( + target_provider="str", + region="str", + transfer_id="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations_async.py new file mode 100644 index 000000000000..01cc7c0dfc43 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_incoming_quota_transfers_operations_async.py @@ -0,0 +1,81 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtIncomingQuotaTransfersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_incoming_quota_transfers_get(self, resource_group): + response = await self.client.incoming_quota_transfers.get( + target_provider="str", + region="str", + transfer_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_incoming_quota_transfers_list(self, resource_group): + response = self.client.incoming_quota_transfers.list( + target_provider="str", + region="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_incoming_quota_transfers_list_by_subscription(self, resource_group): + response = self.client.incoming_quota_transfers.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_incoming_quota_transfers_begin_approve(self, resource_group): + response = await ( + await self.client.incoming_quota_transfers.begin_approve( + target_provider="str", + region="str", + transfer_id="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_incoming_quota_transfers_reject(self, resource_group): + response = await self.client.incoming_quota_transfers.reject( + target_provider="str", + region="str", + transfer_id="str", + etag="str", + match_condition=~azure.core.MatchConditions, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py index 6f46d7b57eab..57f1d356e948 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations.py @@ -24,6 +24,7 @@ def test_quota_get(self, resource_group): response = self.client.quota.get( resource_name="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself @@ -57,6 +58,7 @@ def test_quota_begin_create_or_update(self, resource_group): }, "type": "str", }, + api_version="2026-09-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,6 +92,7 @@ def test_quota_begin_update(self, resource_group): }, "type": "str", }, + api_version="2026-09-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py index 7bf8feff3add..c24ca5a4e44b 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_operations_async.py @@ -25,6 +25,7 @@ async def test_quota_get(self, resource_group): response = await self.client.quota.get( resource_name="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself @@ -59,6 +60,7 @@ async def test_quota_begin_create_or_update(self, resource_group): }, "type": "str", }, + api_version="2026-09-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -94,6 +96,7 @@ async def test_quota_begin_update(self, resource_group): }, "type": "str", }, + api_version="2026-09-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py index 71d9012b9da8..82b0500af064 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations.py @@ -24,6 +24,7 @@ def test_quota_request_status_get(self, resource_group): response = self.client.quota_request_status.get( id="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py index 59a1c0c2d952..b249ac6d8186 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_request_status_operations_async.py @@ -25,6 +25,7 @@ async def test_quota_request_status_get(self, resource_group): response = await self.client.quota_request_status.get( id="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations.py new file mode 100644 index 000000000000..fed6af8917fa --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations.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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaTransfersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_transfers_get(self, resource_group): + response = self.client.quota_transfers.get( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_transfers_begin_create_or_update(self, resource_group): + response = self.client.quota_transfers.begin_create_or_update( + target_provider="str", + region="str", + transfer_name="str", + resource={ + "etag": "str", + "id": "str", + "name": "str", + "properties": { + "amount": 0, + "billingAccountId": "str", + "destinationSubscriptionId": "str", + "displayName": "str", + "resourceName": "str", + "approval": {"actor": "str", "occurredAt": "2020-02-20 00:00:00", "comment": "str"}, + "autoApprove": bool, + "cancellation": {"actor": "str", "occurredAt": "2020-02-20 00:00:00", "reason": "str"}, + "comment": "str", + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "destinationTenantId": "str", + "expiresAt": "2020-02-20 00:00:00", + "provisioningState": "str", + "transferId": "str", + "transferStatus": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_transfers_delete(self, resource_group): + response = self.client.quota_transfers.delete( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_transfers_list(self, resource_group): + response = self.client.quota_transfers.list( + target_provider="str", + region="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_quota_transfers_cancel(self, resource_group): + response = self.client.quota_transfers.cancel( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations_async.py new file mode 100644 index 000000000000..5302a80b7a41 --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_quota_transfers_operations_async.py @@ -0,0 +1,113 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.quota.aio import QuotaMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestQuotaMgmtQuotaTransfersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(QuotaMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_transfers_get(self, resource_group): + response = await self.client.quota_transfers.get( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_transfers_begin_create_or_update(self, resource_group): + response = await ( + await self.client.quota_transfers.begin_create_or_update( + target_provider="str", + region="str", + transfer_name="str", + resource={ + "etag": "str", + "id": "str", + "name": "str", + "properties": { + "amount": 0, + "billingAccountId": "str", + "destinationSubscriptionId": "str", + "displayName": "str", + "resourceName": "str", + "approval": {"actor": "str", "occurredAt": "2020-02-20 00:00:00", "comment": "str"}, + "autoApprove": bool, + "cancellation": {"actor": "str", "occurredAt": "2020-02-20 00:00:00", "reason": "str"}, + "comment": "str", + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "destinationTenantId": "str", + "expiresAt": "2020-02-20 00:00:00", + "provisioningState": "str", + "transferId": "str", + "transferStatus": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_transfers_delete(self, resource_group): + response = await self.client.quota_transfers.delete( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_transfers_list(self, resource_group): + response = self.client.quota_transfers.list( + target_provider="str", + region="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_quota_transfers_cancel(self, resource_group): + response = await self.client.quota_transfers.cancel( + target_provider="str", + region="str", + transfer_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py index e1795efd6276..b89c020d2603 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations.py @@ -24,6 +24,7 @@ def test_usages_get(self, resource_group): response = self.client.usages.get( resource_name="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py index 62f1c92e1a42..97ef0ef7ef92 100644 --- a/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py +++ b/sdk/quota/azure-mgmt-quota/generated_tests/test_quota_mgmt_usages_operations_async.py @@ -25,6 +25,7 @@ async def test_usages_get(self, resource_group): response = await self.client.usages.get( resource_name="str", scope="str", + api_version="2026-09-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/quota/azure-mgmt-quota/pyproject.toml b/sdk/quota/azure-mgmt-quota/pyproject.toml index 0b37da49b9cc..c37d2f9d02d6 100644 --- a/sdk/quota/azure-mgmt-quota/pyproject.toml +++ b/sdk/quota/azure-mgmt-quota/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Quota Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -54,8 +54,8 @@ content-type = "text/markdown" [tool.setuptools.packages.find] exclude = [ "tests*", - "samples*", "generated_tests*", + "samples*", "generated_samples*", "doc*", "azure", @@ -79,7 +79,7 @@ package_name = "azure-mgmt-quota" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Quota Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/quota/azure-mgmt-quota/tsp-location.yaml b/sdk/quota/azure-mgmt-quota/tsp-location.yaml index e1236cb62f6c..ed6be77c82b5 100644 --- a/sdk/quota/azure-mgmt-quota/tsp-location.yaml +++ b/sdk/quota/azure-mgmt-quota/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/quota/Quota.Management -commit: f4d79a1a326481435d1240987885204b57ae5129 +directory: specification/quota/resource-manager/Microsoft.Quota/Quota +commit: 409cf0ef77aaa992195b41e6b8a46b2c5f54f448 repo: Azure/azure-rest-api-specs additionalDirectories: