From 3969d01117d5da0765ae22ba3c420b17d03707e6 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 24 Dec 2025 00:45:49 +0000 Subject: [PATCH] Configurations: 'specification/connectedcache/ConnectedCache.Management/tspconfig.yaml', API Version: 2024-11-30-preview, SDK Release Type: beta, and CommitSHA: 'be46becafeb29aa993898709e35759d3643b2809' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5699159 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-connectedcache/CHANGELOG.md | 43 + .../azure-mgmt-connectedcache/MANIFEST.in | 9 +- .../azure-mgmt-connectedcache/README.md | 6 +- .../{_meta.json => _metadata.json} | 5 +- .../apiview-properties.json | 112 + .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/connectedcache/_client.py | 49 +- .../mgmt/connectedcache/_configuration.py | 12 +- .../azure/mgmt/connectedcache/_patch.py | 13 +- .../mgmt/connectedcache/_utils/__init__.py | 6 + .../{_model_base.py => _utils/model_base.py} | 257 +- .../serialization.py} | 235 +- .../azure/mgmt/connectedcache/_validation.py | 66 + .../azure/mgmt/connectedcache/_version.py | 2 +- .../azure/mgmt/connectedcache/aio/_client.py | 51 +- .../mgmt/connectedcache/aio/_configuration.py | 12 +- .../azure/mgmt/connectedcache/aio/_patch.py | 13 +- .../connectedcache/aio/operations/__init__.py | 4 - .../aio/operations/_operations.py | 2180 ++++--------- .../connectedcache/aio/operations/_patch.py | 13 +- .../mgmt/connectedcache/models/__init__.py | 26 +- .../mgmt/connectedcache/models/_enums.py | 11 - .../mgmt/connectedcache/models/_models.py | 1213 ++++--- .../mgmt/connectedcache/models/_patch.py | 13 +- .../connectedcache/operations/__init__.py | 4 - .../connectedcache/operations/_operations.py | 2883 +++++------------ .../mgmt/connectedcache/operations/_patch.py | 13 +- ...rations_createor_update_maximum_set_gen.py | 52 - ...nodes_operations_delete_maximum_set_gen.py | 41 - ..._list_by_resource_group_maximum_set_gen.py | 42 - ...ns_list_by_subscription_maximum_set_gen.py | 40 - ...ations_create_or_update_maximum_set_gen.py | 52 - ...tomer_operations_delete_maximum_set_gen.py | 41 - ..._list_by_resource_group_maximum_set_gen.py | 42 - ...ns_list_by_subscription_maximum_set_gen.py | 40 - ...ations_create_or_update_maximum_set_gen.py | 4 +- ...nodes_operations_delete_maximum_set_gen.py | 2 +- ...de_auto_update_history_maximum_set_gen.py} | 11 +- ...he_node_install_details_maximum_set_gen.py | 3 +- ...c_issue_details_history_maximum_set_gen.py | 44 + ...ls_certificate_history_maximum_set_gen.py} | 11 +- ...he_nodes_operations_get_maximum_set_gen.py | 2 +- ...e_mcc_customer_resource_maximum_set_gen.py | 3 +- ...nodes_operations_update_maximum_set_gen.py | 2 +- ...tomers_create_or_update_maximum_set_gen.py | 2 +- ...se_mcc_customers_delete_maximum_set_gen.py | 2 +- ...prise_mcc_customers_get_maximum_set_gen.py | 2 +- ..._list_by_resource_group_maximum_set_gen.py | 2 +- ...rs_list_by_subscription_maximum_set_gen.py | 2 +- ...se_mcc_customers_update_maximum_set_gen.py | 2 +- ...ations_create_or_update_maximum_set_gen.py | 3 +- ...nodes_operations_delete_maximum_set_gen.py | 2 +- ...perations_get_bgp_cidrs_maximum_set_gen.py | 2 +- ...de_auto_update_history_maximum_set_gen.py} | 9 +- ...he_node_install_details_maximum_set_gen.py | 2 +- ..._issue_details_history_maximum_set_gen.py} | 9 +- ...he_nodes_operations_get_maximum_set_gen.py | 2 +- ...y_isp_customer_resource_maximum_set_gen.py | 2 +- ...nodes_operations_update_maximum_set_gen.py | 2 +- ...tomers_create_or_update_maximum_set_gen.py | 2 +- .../isp_customers_delete_maximum_set_gen.py | 2 +- .../isp_customers_get_maximum_set_gen.py | 2 +- ..._list_by_resource_group_maximum_set_gen.py | 2 +- ...rs_list_by_subscription_maximum_set_gen.py | 2 +- .../isp_customers_update_maximum_set_gen.py | 2 +- .../operations_list_maximum_set_gen.py | 2 +- ..._mgmt_cache_nodes_operations_operations.py | 111 - ...cache_nodes_operations_operations_async.py | 114 - ...terprise_customer_operations_operations.py | 111 - ...se_customer_operations_operations_async.py | 114 - ...e_mcc_cache_nodes_operations_operations.py | 70 +- ...cache_nodes_operations_operations_async.py | 70 +- ...gmt_enterprise_mcc_customers_operations.py | 1 - ...terprise_mcc_customers_operations_async.py | 1 - ...t_isp_cache_nodes_operations_operations.py | 58 +- ...cache_nodes_operations_operations_async.py | 58 +- ...ted_cache_mgmt_isp_customers_operations.py | 1 - ...che_mgmt_isp_customers_operations_async.py | 1 - .../azure-mgmt-connectedcache/pyproject.toml | 82 + .../sdk_packaging.toml | 12 - .../azure-mgmt-connectedcache/setup.py | 85 - .../tsp-location.yaml | 2 +- 83 files changed, 3387 insertions(+), 5250 deletions(-) rename sdk/connectedcache/azure-mgmt-connectedcache/{_meta.json => _metadata.json} (54%) create mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/apiview-properties.json create mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/__init__.py rename sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/{_model_base.py => _utils/model_base.py} (81%) rename sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/{_serialization.py => _utils/serialization.py} (92%) create mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_validation.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_createor_update_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_delete_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_resource_group_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_subscription_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_create_or_update_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_delete_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_resource_group_maximum_set_gen.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_subscription_maximum_set_gen.py rename sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/{enterprise_customer_operations_update_maximum_set_gen.py => enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py} (73%) create mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py rename sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/{cache_nodes_operations_update_maximum_set_gen.py => enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_maximum_set_gen.py} (73%) rename sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/{enterprise_customer_operations_get_maximum_set_gen.py => isp_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py} (77%) rename sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/{cache_nodes_operations_get_maximum_set_gen.py => isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py} (76%) delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations_async.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations_async.py delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/sdk_packaging.toml delete mode 100644 sdk/connectedcache/azure-mgmt-connectedcache/setup.py diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/CHANGELOG.md b/sdk/connectedcache/azure-mgmt-connectedcache/CHANGELOG.md index 37753eb037f7..eec2feb49e7b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/CHANGELOG.md +++ b/sdk/connectedcache/azure-mgmt-connectedcache/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 1.0.0b2 (2025-12-24) + +### Features Added + + - Model `ConnectedCacheMgmtClient` added parameter `cloud_setting` in method `__init__` + - Model `AdditionalCacheNodeProperties` added property `issues_list` + - Model `AdditionalCacheNodeProperties` added property `issues_count` + - Model `AdditionalCacheNodeProperties` added property `current_tls_certificate` + - Model `AdditionalCacheNodeProperties` added property `last_auto_update_info` + - Model `AdditionalCacheNodeProperties` added property `creation_method` + - Model `AdditionalCacheNodeProperties` added property `tls_status` + - Model `CacheNodeInstallProperties` added property `tls_certificate_provisioning_key` + - Model `CacheNodeInstallProperties` added property `drive_configuration` + - Model `CacheNodeInstallProperties` added property `proxy_url_configuration` + - Added model `MccCacheNodeAutoUpdateHistory` + - Added model `MccCacheNodeAutoUpdateHistoryProperties` + - Added model `MccCacheNodeAutoUpdateInfo` + - Added model `MccCacheNodeIssueHistory` + - Added model `MccCacheNodeIssueHistoryProperties` + - Added model `MccCacheNodeTlsCertificate` + - Added model `MccCacheNodeTlsCertificateHistory` + - Added model `MccCacheNodeTlsCertificateProperties` + - Added model `MccIssue` + - Model `EnterpriseMccCacheNodesOperationsOperations` added method `get_cache_node_auto_update_history` + - Model `EnterpriseMccCacheNodesOperationsOperations` added method `get_cache_node_mcc_issue_details_history` + - Model `EnterpriseMccCacheNodesOperationsOperations` added method `get_cache_node_tls_certificate_history` + - Model `IspCacheNodesOperationsOperations` added method `get_cache_node_auto_update_history` + - Model `IspCacheNodesOperationsOperations` added method `get_cache_node_mcc_issue_details_history` + +### Breaking Changes + + - Deleted or renamed client operation group `ConnectedCacheMgmtClient.enterprise_customer_operations` + - Deleted or renamed client operation group `ConnectedCacheMgmtClient.cache_nodes_operations` + - Model `AdditionalCacheNodeProperties` deleted or renamed its instance variable `proxy_url` + - Model `AdditionalCacheNodeProperties` deleted or renamed its instance variable `update_cycle_type` + - Model `AdditionalCustomerProperties` deleted or renamed its instance variable `peering_db_last_update_time` + - Deleted or renamed model `CacheNodeOldResponse` + - Deleted or renamed model `CacheNodePreviewResource` + - Deleted or renamed model `CycleType` + - Deleted or renamed model `EnterprisePreviewResource` + - Deleted or renamed model `CacheNodesOperationsOperations` + - Deleted or renamed model `EnterpriseCustomerOperationsOperations` + ## 1.0.0b1 (2024-11-21) ### Other Changes diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/MANIFEST.in b/sdk/connectedcache/azure-mgmt-connectedcache/MANIFEST.in index ca7d61fe4c23..a53d4aefeb06 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/MANIFEST.in +++ b/sdk/connectedcache/azure-mgmt-connectedcache/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/connectedcache/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/README.md b/sdk/connectedcache/azure-mgmt-connectedcache/README.md index 79307778f62a..f90866e50802 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/README.md +++ b/sdk/connectedcache/azure-mgmt-connectedcache/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Connectedcache Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. 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.8+ is required to use this package. +- Python 3.9+ 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 configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) 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/connectedcache/azure-mgmt-connectedcache/_meta.json b/sdk/connectedcache/azure-mgmt-connectedcache/_metadata.json similarity index 54% rename from sdk/connectedcache/azure-mgmt-connectedcache/_meta.json rename to sdk/connectedcache/azure-mgmt-connectedcache/_metadata.json index b4a21ddfeacf..8a6a03cca4b6 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/_meta.json +++ b/sdk/connectedcache/azure-mgmt-connectedcache/_metadata.json @@ -1,6 +1,7 @@ { - "commit": "14f4f6b25fe74f90f4ee74fdac5cd7e05d419245", + "apiVersion": "2024-11-30-preview", + "commit": "be46becafeb29aa993898709e35759d3643b2809", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/connectedcache/ConnectedCache.Management", - "@azure-tools/typespec-python": "0.36.4" + "emitterVersion": "0.56.1" } \ No newline at end of file diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/apiview-properties.json b/sdk/connectedcache/azure-mgmt-connectedcache/apiview-properties.json new file mode 100644 index 000000000000..98821d2d6a55 --- /dev/null +++ b/sdk/connectedcache/azure-mgmt-connectedcache/apiview-properties.json @@ -0,0 +1,112 @@ +{ + "CrossLanguagePackageId": "Microsoft.ConnectedCache", + "CrossLanguageDefinitionId": { + "azure.mgmt.connectedcache.models.AdditionalCacheNodeProperties": "Microsoft.ConnectedCache.AdditionalCacheNodeProperties", + "azure.mgmt.connectedcache.models.AdditionalCustomerProperties": "Microsoft.ConnectedCache.AdditionalCustomerProperties", + "azure.mgmt.connectedcache.models.BgpCidrsConfiguration": "Microsoft.ConnectedCache.BgpCidrsConfiguration", + "azure.mgmt.connectedcache.models.BgpConfiguration": "Microsoft.ConnectedCache.BgpConfiguration", + "azure.mgmt.connectedcache.models.CacheNodeDriveConfiguration": "Microsoft.ConnectedCache.CacheNodeDriveConfiguration", + "azure.mgmt.connectedcache.models.CacheNodeEntity": "Microsoft.ConnectedCache.CacheNodeEntity", + "azure.mgmt.connectedcache.models.CacheNodeInstallProperties": "Microsoft.ConnectedCache.CacheNodeInstallProperties", + "azure.mgmt.connectedcache.models.CacheNodeProperty": "Microsoft.ConnectedCache.CacheNodeProperty", + "azure.mgmt.connectedcache.models.ConnectedCachePatchResource": "Microsoft.ConnectedCache.ConnectedCachePatchResource", + "azure.mgmt.connectedcache.models.CustomerEntity": "Microsoft.ConnectedCache.CustomerEntity", + "azure.mgmt.connectedcache.models.CustomerProperty": "Microsoft.ConnectedCache.CustomerProperty", + "azure.mgmt.connectedcache.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.connectedcache.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.connectedcache.models.EnterpriseMccCacheNodeResource": "Microsoft.ConnectedCache.EnterpriseMccCacheNodeResource", + "azure.mgmt.connectedcache.models.EnterpriseMccCustomerResource": "Microsoft.ConnectedCache.EnterpriseMccCustomerResource", + "azure.mgmt.connectedcache.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.connectedcache.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.connectedcache.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.connectedcache.models.IspCacheNodeResource": "Microsoft.ConnectedCache.IspCacheNodeResource", + "azure.mgmt.connectedcache.models.IspCustomerResource": "Microsoft.ConnectedCache.IspCustomerResource", + "azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistory": "Microsoft.ConnectedCache.MccCacheNodeAutoUpdateHistory", + "azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistoryProperties": "Microsoft.ConnectedCache.MccCacheNodeAutoUpdateHistoryProperties", + "azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateInfo": "Microsoft.ConnectedCache.MccCacheNodeAutoUpdateInfo", + "azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails": "Microsoft.ConnectedCache.MccCacheNodeBgpCidrDetails", + "azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails": "Microsoft.ConnectedCache.MccCacheNodeInstallDetails", + "azure.mgmt.connectedcache.models.MccCacheNodeIssueHistory": "Microsoft.ConnectedCache.MccCacheNodeIssueHistory", + "azure.mgmt.connectedcache.models.MccCacheNodeIssueHistoryProperties": "Microsoft.ConnectedCache.MccCacheNodeIssueHistoryProperties", + "azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificate": "Microsoft.ConnectedCache.MccCacheNodeTlsCertificate", + "azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificateHistory": "Microsoft.ConnectedCache.MccCacheNodeTlsCertificateHistory", + "azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificateProperties": "Microsoft.ConnectedCache.MccCacheNodeTlsCertificateProperties", + "azure.mgmt.connectedcache.models.MccIssue": "Microsoft.ConnectedCache.MccIssue", + "azure.mgmt.connectedcache.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.connectedcache.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.connectedcache.models.ProxyUrlConfiguration": "Microsoft.ConnectedCache.ProxyUrlConfiguration", + "azure.mgmt.connectedcache.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.connectedcache.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.connectedcache.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.connectedcache.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.connectedcache.models.ProvisioningState": "Microsoft.ConnectedCache.ProvisioningState", + "azure.mgmt.connectedcache.models.CustomerTransitState": "Microsoft.ConnectedCache.CustomerTransitState", + "azure.mgmt.connectedcache.models.BgpReviewStateEnum": "Microsoft.ConnectedCache.BgpReviewStateEnum", + "azure.mgmt.connectedcache.models.ConfigurationState": "Microsoft.ConnectedCache.ConfigurationState", + "azure.mgmt.connectedcache.models.AutoUpdateRingType": "Microsoft.ConnectedCache.autoUpdateRingType", + "azure.mgmt.connectedcache.models.ProxyRequired": "Microsoft.ConnectedCache.ProxyRequired", + "azure.mgmt.connectedcache.models.OsType": "Microsoft.ConnectedCache.OsType", + "azure.mgmt.connectedcache.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.connectedcache.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.get": "Microsoft.ConnectedCache.IspCustomers.get", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.get": "Microsoft.ConnectedCache.IspCustomers.get", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.begin_create_or_update": "Microsoft.ConnectedCache.IspCustomers.createOrUpdate", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.begin_create_or_update": "Microsoft.ConnectedCache.IspCustomers.createOrUpdate", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.update": "Microsoft.ConnectedCache.IspCustomers.update", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.update": "Microsoft.ConnectedCache.IspCustomers.update", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.begin_delete": "Microsoft.ConnectedCache.IspCustomers.delete", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.begin_delete": "Microsoft.ConnectedCache.IspCustomers.delete", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.list_by_resource_group": "Microsoft.ConnectedCache.IspCustomers.listByResourceGroup", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.list_by_resource_group": "Microsoft.ConnectedCache.IspCustomers.listByResourceGroup", + "azure.mgmt.connectedcache.operations.IspCustomersOperations.list_by_subscription": "Microsoft.ConnectedCache.IspCustomers.listBySubscription", + "azure.mgmt.connectedcache.aio.operations.IspCustomersOperations.list_by_subscription": "Microsoft.ConnectedCache.IspCustomers.listBySubscription", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.get": "Microsoft.ConnectedCache.IspCacheNodesOperations.get", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.get": "Microsoft.ConnectedCache.IspCacheNodesOperations.get", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.begin_create_or_update": "Microsoft.ConnectedCache.IspCacheNodesOperations.createOrUpdate", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.begin_create_or_update": "Microsoft.ConnectedCache.IspCacheNodesOperations.createOrUpdate", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.update": "Microsoft.ConnectedCache.IspCacheNodesOperations.update", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.update": "Microsoft.ConnectedCache.IspCacheNodesOperations.update", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.begin_delete": "Microsoft.ConnectedCache.IspCacheNodesOperations.delete", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.begin_delete": "Microsoft.ConnectedCache.IspCacheNodesOperations.delete", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.list_by_isp_customer_resource": "Microsoft.ConnectedCache.IspCacheNodesOperations.listByIspCustomerResource", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.list_by_isp_customer_resource": "Microsoft.ConnectedCache.IspCacheNodesOperations.listByIspCustomerResource", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.get_bgp_cidrs": "Microsoft.ConnectedCache.IspCacheNodesOperations.getBgpCidrs", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.get_bgp_cidrs": "Microsoft.ConnectedCache.IspCacheNodesOperations.getBgpCidrs", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.get_cache_node_install_details": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeInstallDetails", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.get_cache_node_install_details": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeInstallDetails", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.get_cache_node_auto_update_history": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeAutoUpdateHistory", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.get_cache_node_auto_update_history": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeAutoUpdateHistory", + "azure.mgmt.connectedcache.operations.IspCacheNodesOperationsOperations.get_cache_node_mcc_issue_details_history": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeMccIssueDetailsHistory", + "azure.mgmt.connectedcache.aio.operations.IspCacheNodesOperationsOperations.get_cache_node_mcc_issue_details_history": "Microsoft.ConnectedCache.IspCacheNodesOperations.getCacheNodeMccIssueDetailsHistory", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.get": "Microsoft.ConnectedCache.EnterpriseMccCustomers.get", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.get": "Microsoft.ConnectedCache.EnterpriseMccCustomers.get", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.createOrUpdate", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.createOrUpdate", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.update", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.update": "Microsoft.ConnectedCache.EnterpriseMccCustomers.update", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCustomers.delete", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCustomers.delete", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.list_by_resource_group": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listByResourceGroup", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.list_by_resource_group": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listByResourceGroup", + "azure.mgmt.connectedcache.operations.EnterpriseMccCustomersOperations.list_by_subscription": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listBySubscription", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCustomersOperations.list_by_subscription": "Microsoft.ConnectedCache.EnterpriseMccCustomers.listBySubscription", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.get": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.get", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.get": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.get", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.createOrUpdate", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.begin_create_or_update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.createOrUpdate", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.update", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.update": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.update", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.delete", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.begin_delete": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.delete", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.list_by_enterprise_mcc_customer_resource": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.list_by_enterprise_mcc_customer_resource": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.listByEnterpriseMccCustomerResource", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_install_details": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeInstallDetails", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_install_details": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeInstallDetails", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_auto_update_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeAutoUpdateHistory", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_auto_update_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeAutoUpdateHistory", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_mcc_issue_details_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeMccIssueDetailsHistory", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_mcc_issue_details_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeMccIssueDetailsHistory", + "azure.mgmt.connectedcache.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_tls_certificate_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeTlsCertificateHistory", + "azure.mgmt.connectedcache.aio.operations.EnterpriseMccCacheNodesOperationsOperations.get_cache_node_tls_certificate_history": "Microsoft.ConnectedCache.EnterpriseMccCacheNodesOperations.getCacheNodeTlsCertificateHistory" + } +} \ No newline at end of file diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/__init__.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/__init__.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_client.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_client.py index 9b387fe4e557..b34b97e181a5 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_client.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_client.py @@ -7,19 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import ConnectedCacheMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( - CacheNodesOperationsOperations, - EnterpriseCustomerOperationsOperations, EnterpriseMccCacheNodesOperationsOperations, EnterpriseMccCustomersOperations, IspCacheNodesOperationsOperations, @@ -28,20 +28,15 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class ConnectedCacheMgmtClient: # pylint: disable=too-many-instance-attributes +class ConnectedCacheMgmtClient: """Microsoft Connected Cache Rest Api version 2023-05-01-preview. :ivar operations: Operations operations :vartype operations: azure.mgmt.connectedcache.operations.Operations - :ivar enterprise_customer_operations: EnterpriseCustomerOperationsOperations operations - :vartype enterprise_customer_operations: - azure.mgmt.connectedcache.operations.EnterpriseCustomerOperationsOperations - :ivar cache_nodes_operations: CacheNodesOperationsOperations operations - :vartype cache_nodes_operations: - azure.mgmt.connectedcache.operations.CacheNodesOperationsOperations :ivar isp_customers: IspCustomersOperations operations :vartype isp_customers: azure.mgmt.connectedcache.operations.IspCustomersOperations :ivar isp_cache_nodes_operations: IspCacheNodesOperationsOperations operations @@ -58,10 +53,13 @@ class ConnectedCacheMgmtClient: # pylint: disable=too-many-instance-attributes :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str + :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 - "2023-05-01-preview". Note that overriding this default value may result in unsupported + "2024-11-30-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +70,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ConnectedCacheMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,18 +108,12 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.enterprise_customer_operations = EnterpriseCustomerOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cache_nodes_operations = CacheNodesOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.isp_customers = IspCustomersOperations(self._client, self._config, self._serialize, self._deserialize) self.isp_cache_nodes_operations = IspCacheNodesOperationsOperations( self._client, self._config, self._serialize, self._deserialize diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_configuration.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_configuration.py index 82551954ec2e..6a48a86d4383 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_configuration.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,6 +14,7 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -29,8 +30,11 @@ class ConnectedCacheMgmtClientConfiguration: # pylint: disable=too-many-instanc :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str + :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 - "2023-05-01-preview". Note that overriding this default value may result in unsupported + "2024-11-30-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,9 +44,10 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2023-05-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-30-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-connectedcache/{}".format(VERSION)) diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_patch.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_patch.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_model_base.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/model_base.py similarity index 81% rename from sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_model_base.py rename to sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/model_base.py index e6a2730f9276..75b6936a909c 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_model_base.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/model_base.py @@ -1,9 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# 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. # -------------------------------------------------------------------------- # pylint: disable=protected-access, broad-except @@ -21,17 +22,14 @@ from datetime import datetime, date, time, timedelta, timezone 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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping +from azure.core.rest import HttpResponse _LOGGER = logging.getLogger(__name__) @@ -173,6 +171,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. @@ -317,6 +330,8 @@ def _deserialize_int_as_str(attr): 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 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 @@ -347,17 +362,47 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data 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: @@ -373,50 +418,97 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D'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 + :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 + :rtype: ~typing.ItemsView + """ return self._data.items() 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. + :rtype: any + """ try: return self[key] except KeyError: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + 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. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs 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 + :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. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -438,6 +530,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()} @@ -469,9 +563,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -494,7 +586,7 @@ class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ @@ -579,7 +671,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -594,10 +686,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -633,10 +725,10 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -696,7 +788,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -706,7 +798,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -724,17 +816,28 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + try: + if ( + isinstance(obj, str) + and isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ): + # encoded string may be deserialized to sequence + return deserializer(obj) + except: # pylint: disable=bare-except + pass return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -754,7 +857,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): @@ -799,7 +902,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -812,7 +918,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -894,6 +1003,35 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, @@ -901,11 +1039,11 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -920,7 +1058,11 @@ def __init__( @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: @@ -931,14 +1073,37 @@ 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) 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) + + 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: @@ -963,11 +1128,11 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -984,8 +1149,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1004,9 +1169,9 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) @@ -1095,7 +1260,7 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: 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 @@ -1138,7 +1303,7 @@ def _deserialize_xml( def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1151,7 +1316,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_serialization.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/serialization.py similarity index 92% rename from sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_serialization.py rename to sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/serialization.py index ce17d1798ce7..81ec1de5922b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_serialization.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_utils/serialization.py @@ -1,28 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -48,10 +29,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, - List, ) try: @@ -61,13 +39,13 @@ 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 _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -185,73 +163,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset) -> None: - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -397,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -450,25 +362,25 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -479,8 +391,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -500,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -563,7 +475,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -614,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -626,7 +538,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -665,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -736,8 +648,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -781,8 +693,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -805,8 +717,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -835,8 +747,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -855,9 +767,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -875,7 +787,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) @@ -909,13 +821,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): @@ -1192,7 +1111,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1218,7 +1137,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1251,7 +1170,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1270,7 +1189,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1429,7 +1348,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1441,7 +1360,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1472,7 +1391,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1488,7 +1407,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1502,7 +1421,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1683,17 +1602,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore @@ -1713,7 +1636,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1795,7 +1718,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1841,7 +1764,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 @@ -1867,7 +1790,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): @@ -1932,7 +1859,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1945,7 +1872,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1960,7 +1887,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1978,7 +1905,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1991,7 +1918,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2009,7 +1936,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2025,7 +1952,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2040,14 +1967,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2063,7 +1990,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2101,7 +2028,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_validation.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_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/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_version.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_version.py index be71c81bd282..bbcd28b4aa67 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_version.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0b2" diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_client.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_client.py index 7d6cf5a14102..1e240dd04441 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_client.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_client.py @@ -7,19 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import ConnectedCacheMgmtClientConfiguration from .operations import ( - CacheNodesOperationsOperations, - EnterpriseCustomerOperationsOperations, EnterpriseMccCacheNodesOperationsOperations, EnterpriseMccCustomersOperations, IspCacheNodesOperationsOperations, @@ -28,20 +28,15 @@ ) if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class ConnectedCacheMgmtClient: # pylint: disable=too-many-instance-attributes +class ConnectedCacheMgmtClient: """Microsoft Connected Cache Rest Api version 2023-05-01-preview. :ivar operations: Operations operations :vartype operations: azure.mgmt.connectedcache.aio.operations.Operations - :ivar enterprise_customer_operations: EnterpriseCustomerOperationsOperations operations - :vartype enterprise_customer_operations: - azure.mgmt.connectedcache.aio.operations.EnterpriseCustomerOperationsOperations - :ivar cache_nodes_operations: CacheNodesOperationsOperations operations - :vartype cache_nodes_operations: - azure.mgmt.connectedcache.aio.operations.CacheNodesOperationsOperations :ivar isp_customers: IspCustomersOperations operations :vartype isp_customers: azure.mgmt.connectedcache.aio.operations.IspCustomersOperations :ivar isp_cache_nodes_operations: IspCacheNodesOperationsOperations operations @@ -58,10 +53,13 @@ class ConnectedCacheMgmtClient: # pylint: disable=too-many-instance-attributes :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str + :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 - "2023-05-01-preview". Note that overriding this default value may result in unsupported + "2024-11-30-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +70,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ConnectedCacheMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,18 +108,14 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.enterprise_customer_operations = EnterpriseCustomerOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cache_nodes_operations = CacheNodesOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.isp_customers = IspCustomersOperations(self._client, self._config, self._serialize, self._deserialize) self.isp_cache_nodes_operations = IspCacheNodesOperationsOperations( self._client, self._config, self._serialize, self._deserialize diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_configuration.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_configuration.py index bc8e5de56b85..5f4be314fe05 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_configuration.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,6 +14,7 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -29,8 +30,11 @@ class ConnectedCacheMgmtClientConfiguration: # pylint: disable=too-many-instanc :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str + :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 - "2023-05-01-preview". Note that overriding this default value may result in unsupported + "2024-11-30-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,9 +44,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2023-05-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-30-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-connectedcache/{}".format(VERSION)) diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_patch.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_patch.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/__init__.py index f34ede4b37e1..ff07f8879332 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/__init__.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/__init__.py @@ -13,8 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._operations import EnterpriseCustomerOperationsOperations # type: ignore -from ._operations import CacheNodesOperationsOperations # type: ignore from ._operations import IspCustomersOperations # type: ignore from ._operations import IspCacheNodesOperationsOperations # type: ignore from ._operations import EnterpriseMccCustomersOperations # type: ignore @@ -26,8 +24,6 @@ __all__ = [ "Operations", - "EnterpriseCustomerOperationsOperations", - "CacheNodesOperationsOperations", "IspCustomersOperations", "IspCacheNodesOperationsOperations", "EnterpriseMccCustomersOperations", diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_operations.py index 72e9eddb43eb..80fb76eb3b7e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_operations.py @@ -6,12 +6,13 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -33,23 +34,16 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +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_cache_nodes_operations_createor_update_request, - build_cache_nodes_operations_delete_request, - build_cache_nodes_operations_get_request, - build_cache_nodes_operations_list_by_resource_group_request, - build_cache_nodes_operations_list_by_subscription_request, - build_cache_nodes_operations_update_request, - build_enterprise_customer_operations_create_or_update_request, - build_enterprise_customer_operations_delete_request, - build_enterprise_customer_operations_get_request, - build_enterprise_customer_operations_list_by_resource_group_request, - build_enterprise_customer_operations_list_by_subscription_request, - build_enterprise_customer_operations_update_request, build_enterprise_mcc_cache_nodes_operations_create_or_update_request, build_enterprise_mcc_cache_nodes_operations_delete_request, + build_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_request, build_enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_request, + build_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request, + build_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_request, build_enterprise_mcc_cache_nodes_operations_get_request, build_enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_request, build_enterprise_mcc_cache_nodes_operations_update_request, @@ -62,7 +56,9 @@ build_isp_cache_nodes_operations_create_or_update_request, build_isp_cache_nodes_operations_delete_request, build_isp_cache_nodes_operations_get_bgp_cidrs_request, + build_isp_cache_nodes_operations_get_cache_node_auto_update_history_request, build_isp_cache_nodes_operations_get_cache_node_install_details_request, + build_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request, build_isp_cache_nodes_operations_get_request, build_isp_cache_nodes_operations_list_by_isp_customer_resource_request, build_isp_cache_nodes_operations_update_request, @@ -74,14 +70,12 @@ build_isp_customers_update_request, build_operations_list_request, ) +from .._configuration import ConnectedCacheMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list class Operations: @@ -96,13 +90,13 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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 list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -161,7 +155,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -177,1456 +171,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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EnterpriseCustomerOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.connectedcache.aio.ConnectedCacheMgmtClient`'s - :attr:`enterprise_customer_operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """Retrieves the properties of a Enterprise customer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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.EnterprisePreviewResource] = kwargs.pop("cls", None) - - _request = build_enterprise_customer_operations_get_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = 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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EnterprisePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.EnterprisePreviewResource, JSON, 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_enterprise_customer_operations_create_or_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - 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 cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: _models.EnterprisePreviewResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.EnterprisePreviewResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Is one of the following types: - EnterprisePreviewResource, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :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.EnterprisePreviewResource] = 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( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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.EnterprisePreviewResource, 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.EnterprisePreviewResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EnterprisePreviewResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: _models.ConnectedCachePatchResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: Union[_models.ConnectedCachePatchResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Is one of the following types: - ConnectedCachePatchResource, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource or JSON or - IO[bytes] - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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)) - cls: ClsType[_models.EnterprisePreviewResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_enterprise_customer_operations_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EnterprisePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, customer_resource_name: str, **kwargs: Any) -> None: - """Deletes an existing customer Enterprise resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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_enterprise_customer_operations_delete_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.EnterprisePreviewResource"]: - """Retrieves the properties of all ConnectedCache enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of EnterprisePreviewResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnterprisePreviewResource]] = 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_enterprise_customer_operations_list_by_resource_group_request( - resource_group_name=resource_group_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) - - 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.EnterprisePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.EnterprisePreviewResource"]: - """Retrieves the properties of all ConnectedCaches. - - :return: An iterator like instance of EnterprisePreviewResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnterprisePreviewResource]] = 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_enterprise_customer_operations_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), 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.EnterprisePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class CacheNodesOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.connectedcache.aio.ConnectedCacheMgmtClient`'s - :attr:`cache_nodes_operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """Retrieves the properties of a cacheNodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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.CacheNodePreviewResource] = kwargs.pop("cls", None) - - _request = build_cache_nodes_operations_get_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = 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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.CacheNodePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _createor_update_initial( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.CacheNodePreviewResource, JSON, 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_cache_nodes_operations_createor_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - 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 cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: _models.CacheNodePreviewResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.CacheNodePreviewResource, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Is one of the following types: - CacheNodePreviewResource, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :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.CacheNodePreviewResource] = 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._createor_update_initial( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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.CacheNodePreviewResource, 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.CacheNodePreviewResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CacheNodePreviewResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def delete(self, resource_group_name: str, customer_resource_name: str, **kwargs: Any) -> None: - """Deletes an existing cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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_cache_nodes_operations_delete_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: _models.ConnectedCachePatchResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: Union[_models.ConnectedCachePatchResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Is one of the following types: - ConnectedCachePatchResource, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource or JSON or - IO[bytes] - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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)) - cls: ClsType[_models.CacheNodePreviewResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_cache_nodes_operations_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.CacheNodePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CacheNodePreviewResource"]: - """Retrieves the properties of all ConnectedCache. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of CacheNodePreviewResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CacheNodePreviewResource]] = 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_cache_nodes_operations_list_by_resource_group_request( - resource_group_name=resource_group_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) - - 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.CacheNodePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CacheNodePreviewResource"]: - """Retrieves the properties of all ConnectedCaches. - - :return: An iterator like instance of CacheNodePreviewResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CacheNodePreviewResource]] = 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_cache_nodes_operations_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), params=_next_request_params + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - 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.CacheNodePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1646,10 +194,10 @@ class IspCustomersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -1706,7 +254,10 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -1775,7 +326,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2109,7 +663,10 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2164,7 +721,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2241,7 +801,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.IspCustomerResource"]: + ) -> AsyncItemPaged["_models.IspCustomerResource"]: """This api gets the information about all ispCustomer resources under the given subscription and resource group. @@ -2307,7 +867,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2323,7 +883,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2331,7 +894,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.IspCustomerResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.IspCustomerResource"]: """This api gets information about all ispCustomer resources under the given subscription. :return: An iterator like instance of IspCustomerResource @@ -2392,7 +955,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2408,7 +971,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2428,10 +994,10 @@ class IspCacheNodesOperationsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -2491,7 +1057,10 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2562,7 +1131,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2922,7 +1494,10 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2978,7 +1553,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3058,7 +1636,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_isp_customer_resource( self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> AsyncIterable["_models.IspCacheNodeResource"]: + ) -> AsyncItemPaged["_models.IspCacheNodeResource"]: """This api retrieves information about all ispCacheNode resources under the given subscription and resource group. @@ -3127,34 +1705,201 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCacheNodeResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCacheNodeResource], 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) + 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_async + async def get_bgp_cidrs( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeBgpCidrDetails: + """This api gets ispCacheNode resource information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeBgpCidrDetails. The MccCacheNodeBgpCidrDetails is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails + :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.MccCacheNodeBgpCidrDetails] = kwargs.pop("cls", None) + + _request = build_isp_cache_nodes_operations_get_bgp_cidrs_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeBgpCidrDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_cache_node_install_details( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeInstallDetails: + """This api gets secrets of the ispCacheNode resource install details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeInstallDetails. The MccCacheNodeInstallDetails is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails + :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.MccCacheNodeInstallDetails] = kwargs.pop("cls", None) + + _request = build_isp_cache_nodes_operations_get_cache_node_install_details_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.MccCacheNodeInstallDetails, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace_async - async def get_bgp_cidrs( + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + async def get_cache_node_auto_update_history( self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any - ) -> _models.MccCacheNodeBgpCidrDetails: - """This api gets ispCacheNode resource information. + ) -> _models.MccCacheNodeAutoUpdateHistory: + """This api gets ispCacheNode resource auto update histrory information. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3163,9 +1908,9 @@ async def get_bgp_cidrs( :type customer_resource_name: str :param cache_node_resource_name: Name of the ConnectedCache resource. Required. :type cache_node_resource_name: str - :return: MccCacheNodeBgpCidrDetails. The MccCacheNodeBgpCidrDetails is compatible with + :return: MccCacheNodeAutoUpdateHistory. The MccCacheNodeAutoUpdateHistory is compatible with MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3179,9 +1924,9 @@ async def get_bgp_cidrs( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.MccCacheNodeBgpCidrDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.MccCacheNodeAutoUpdateHistory] = kwargs.pop("cls", None) - _request = build_isp_cache_nodes_operations_get_bgp_cidrs_request( + _request = build_isp_cache_nodes_operations_get_cache_node_auto_update_history_request( resource_group_name=resource_group_name, customer_resource_name=customer_resource_name, cache_node_resource_name=cache_node_resource_name, @@ -3209,13 +1954,16 @@ async def get_bgp_cidrs( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.MccCacheNodeBgpCidrDetails, response.json()) + deserialized = _deserialize(_models.MccCacheNodeAutoUpdateHistory, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3223,10 +1971,24 @@ async def get_bgp_cidrs( return deserialized # type: ignore @distributed_trace_async - async def get_cache_node_install_details( + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + async def get_cache_node_mcc_issue_details_history( self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any - ) -> _models.MccCacheNodeInstallDetails: - """This api gets secrets of the ispCacheNode resource install details. + ) -> _models.MccCacheNodeIssueHistory: + """This api gets ispCacheNode resource issues details histrory information. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3235,9 +1997,9 @@ async def get_cache_node_install_details( :type customer_resource_name: str :param cache_node_resource_name: Name of the ConnectedCache resource. Required. :type cache_node_resource_name: str - :return: MccCacheNodeInstallDetails. The MccCacheNodeInstallDetails is compatible with + :return: MccCacheNodeIssueHistory. The MccCacheNodeIssueHistory is compatible with MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeIssueHistory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3251,9 +2013,9 @@ async def get_cache_node_install_details( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.MccCacheNodeInstallDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.MccCacheNodeIssueHistory] = kwargs.pop("cls", None) - _request = build_isp_cache_nodes_operations_get_cache_node_install_details_request( + _request = build_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( resource_group_name=resource_group_name, customer_resource_name=customer_resource_name, cache_node_resource_name=cache_node_resource_name, @@ -3281,13 +2043,16 @@ async def get_cache_node_install_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.MccCacheNodeInstallDetails, response.json()) + deserialized = _deserialize(_models.MccCacheNodeIssueHistory, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3307,10 +2072,10 @@ class EnterpriseMccCustomersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -3368,7 +2133,10 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -3437,7 +2205,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3776,7 +2547,10 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -3831,7 +2605,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3908,7 +2685,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.EnterpriseMccCustomerResource"]: + ) -> AsyncItemPaged["_models.EnterpriseMccCustomerResource"]: """This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. @@ -3974,7 +2751,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3990,7 +2767,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3998,7 +2778,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.EnterpriseMccCustomerResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.EnterpriseMccCustomerResource"]: """This api gets information about all enterpriseMccCustomer resources under the given subscription. @@ -4060,7 +2840,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4076,7 +2856,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4096,10 +2879,10 @@ class EnterpriseMccCacheNodesOperationsOperations: # pylint: disable=name-too-l def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -4160,7 +2943,10 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4231,7 +3017,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4596,7 +3385,10 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4652,7 +3444,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4732,7 +3527,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_enterprise_mcc_customer_resource( self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> AsyncIterable["_models.EnterpriseMccCacheNodeResource"]: + ) -> AsyncItemPaged["_models.EnterpriseMccCacheNodeResource"]: """This api retrieves information about all ispCacheNode resources under the given subscription and resource group. @@ -4801,7 +3596,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCacheNodeResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCacheNodeResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4817,7 +3612,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4883,7 +3681,10 @@ async def get_cache_node_install_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4895,3 +3696,270 @@ async def get_cache_node_install_details( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + async def get_cache_node_auto_update_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeAutoUpdateHistory: + """This api gets ispCacheNode resource auto update histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeAutoUpdateHistory. The MccCacheNodeAutoUpdateHistory is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistory + :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.MccCacheNodeAutoUpdateHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeAutoUpdateHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + async def get_cache_node_mcc_issue_details_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeIssueHistory: + """This api gets ispCacheNode resource issues details histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeIssueHistory. The MccCacheNodeIssueHistory is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeIssueHistory + :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.MccCacheNodeIssueHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeIssueHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + async def get_cache_node_tls_certificate_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeTlsCertificateHistory: + """This api gets ispCacheNode resource tls certificate histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeTlsCertificateHistory. The MccCacheNodeTlsCertificateHistory is compatible + with MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificateHistory + :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.MccCacheNodeTlsCertificateHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeTlsCertificateHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_patch.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_patch.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/__init__.py index cad334387e9e..95a0f1d9840b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/__init__.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/__init__.py @@ -21,22 +21,28 @@ CacheNodeDriveConfiguration, CacheNodeEntity, CacheNodeInstallProperties, - CacheNodeOldResponse, - CacheNodePreviewResource, CacheNodeProperty, ConnectedCachePatchResource, CustomerEntity, CustomerProperty, EnterpriseMccCacheNodeResource, EnterpriseMccCustomerResource, - EnterprisePreviewResource, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, IspCacheNodeResource, IspCustomerResource, + MccCacheNodeAutoUpdateHistory, + MccCacheNodeAutoUpdateHistoryProperties, + MccCacheNodeAutoUpdateInfo, MccCacheNodeBgpCidrDetails, MccCacheNodeInstallDetails, + MccCacheNodeIssueHistory, + MccCacheNodeIssueHistoryProperties, + MccCacheNodeTlsCertificate, + MccCacheNodeTlsCertificateHistory, + MccCacheNodeTlsCertificateProperties, + MccIssue, Operation, OperationDisplay, ProxyUrlConfiguration, @@ -52,7 +58,6 @@ ConfigurationState, CreatedByType, CustomerTransitState, - CycleType, Origin, OsType, ProvisioningState, @@ -70,22 +75,28 @@ "CacheNodeDriveConfiguration", "CacheNodeEntity", "CacheNodeInstallProperties", - "CacheNodeOldResponse", - "CacheNodePreviewResource", "CacheNodeProperty", "ConnectedCachePatchResource", "CustomerEntity", "CustomerProperty", "EnterpriseMccCacheNodeResource", "EnterpriseMccCustomerResource", - "EnterprisePreviewResource", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "IspCacheNodeResource", "IspCustomerResource", + "MccCacheNodeAutoUpdateHistory", + "MccCacheNodeAutoUpdateHistoryProperties", + "MccCacheNodeAutoUpdateInfo", "MccCacheNodeBgpCidrDetails", "MccCacheNodeInstallDetails", + "MccCacheNodeIssueHistory", + "MccCacheNodeIssueHistoryProperties", + "MccCacheNodeTlsCertificate", + "MccCacheNodeTlsCertificateHistory", + "MccCacheNodeTlsCertificateProperties", + "MccIssue", "Operation", "OperationDisplay", "ProxyUrlConfiguration", @@ -98,7 +109,6 @@ "ConfigurationState", "CreatedByType", "CustomerTransitState", - "CycleType", "Origin", "OsType", "ProvisioningState", diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_enums.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_enums.py index 08610ac96609..b2d7b7fe7db1 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_enums.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_enums.py @@ -76,17 +76,6 @@ class CustomerTransitState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """pure transit provider or network service provider""" -class CycleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Update Cycle type.""" - - PREVIEW = "Preview" - """customer selection of preview update install mcc on their physical vm""" - SLOW = "Slow" - """customer selection of slow update to install mcc on their physical vm""" - FAST = "Fast" - """customer selection of fast / auto update to install mcc on their physical vm""" - - class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_models.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_models.py index 580a2ab7dd89..7703513ea43c 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_models.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_models.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,23 +9,28 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class AdditionalCacheNodeProperties(_model_base.Model): +class AdditionalCacheNodeProperties(_Model): """Model representing cache node for connected cache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar cache_node_properties_details_issues_list: issues list to return the issues as part of the additional cache node properties. :vartype cache_node_properties_details_issues_list: list[str] + :ivar issues_list: current cache node issue list. + :vartype issues_list: list[str] + :ivar issues_count: Number of cache node issues. + :vartype issues_count: int + :ivar current_tls_certificate: cache node current tls certificate. + :vartype current_tls_certificate: ~azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificate + :ivar last_auto_update_info: cache node last auto update information. + :vartype last_auto_update_info: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateInfo :ivar aggregated_status_details: Cache node resource aggregated status details. :vartype aggregated_status_details: str :ivar aggregated_status_text: Cache node resource aggregated status text. @@ -50,16 +55,12 @@ class AdditionalCacheNodeProperties(_model_base.Model): :vartype bgp_configuration: ~azure.mgmt.connectedcache.models.BgpConfiguration :ivar proxy_url_configuration: proxyUrl configuration of the cache node. :vartype proxy_url_configuration: ~azure.mgmt.connectedcache.models.ProxyUrlConfiguration - :ivar proxy_url: Cache node resource Mcc proxy Url. - :vartype proxy_url: str :ivar is_proxy_required: Cache node resource requires a proxy. Known values are: "None" and "Required". :vartype is_proxy_required: str or ~azure.mgmt.connectedcache.models.ProxyRequired :ivar os_type: Operating system of the cache node. Known values are: "Windows", "Linux", and "Eflow". :vartype os_type: str or ~azure.mgmt.connectedcache.models.OsType - :ivar update_cycle_type: Update Cycle Type. Known values are: "Preview", "Slow", and "Fast". - :vartype update_cycle_type: str or ~azure.mgmt.connectedcache.models.CycleType :ivar auto_update_version: Auto update or fast update version. :vartype auto_update_version: str :ivar update_info_details: Update related information details. @@ -85,6 +86,10 @@ class AdditionalCacheNodeProperties(_model_base.Model): :ivar auto_update_last_triggered_date_time: Auto update last triggered date time of mcc install. :vartype auto_update_last_triggered_date_time: ~datetime.datetime + :ivar creation_method: Resource creation method of mcc cache node resource, cli or portal. + :vartype creation_method: int + :ivar tls_status: Cache node tls certificate status. + :vartype tls_status: str :ivar optional_property1: Optional property #1 of Mcc response object. :vartype optional_property1: str :ivar optional_property2: Optional property #2 of Mcc response object. @@ -97,10 +102,22 @@ class AdditionalCacheNodeProperties(_model_base.Model): :vartype optional_property5: str """ - cache_node_properties_details_issues_list: Optional[List[str]] = rest_field( - name="cacheNodePropertiesDetailsIssuesList" + cache_node_properties_details_issues_list: Optional[list[str]] = rest_field( + name="cacheNodePropertiesDetailsIssuesList", visibility=["read", "create", "update", "delete", "query"] ) """issues list to return the issues as part of the additional cache node properties.""" + issues_list: Optional[list[str]] = rest_field(name="issuesList", visibility=["read"]) + """current cache node issue list.""" + issues_count: Optional[int] = rest_field(name="issuesCount", visibility=["read"]) + """Number of cache node issues.""" + current_tls_certificate: Optional["_models.MccCacheNodeTlsCertificate"] = rest_field( + name="currentTlsCertificate", visibility=["read"] + ) + """cache node current tls certificate.""" + last_auto_update_info: Optional["_models.MccCacheNodeAutoUpdateInfo"] = rest_field( + name="lastAutoUpdateInfo", visibility=["read"] + ) + """cache node last auto update information.""" aggregated_status_details: Optional[str] = rest_field(name="aggregatedStatusDetails", visibility=["read"]) """Cache node resource aggregated status details.""" aggregated_status_text: Optional[str] = rest_field(name="aggregatedStatusText", visibility=["read"]) @@ -118,26 +135,36 @@ class AdditionalCacheNodeProperties(_model_base.Model): """Cache node resource short state text.""" cache_node_state: Optional[int] = rest_field(name="cacheNodeState", visibility=["read"]) """Cache node resource state as integer.""" - drive_configuration: Optional[List["_models.CacheNodeDriveConfiguration"]] = rest_field(name="driveConfiguration") + drive_configuration: Optional[list["_models.CacheNodeDriveConfiguration"]] = rest_field( + name="driveConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource drive configurations.""" - bgp_configuration: Optional["_models.BgpConfiguration"] = rest_field(name="bgpConfiguration") + bgp_configuration: Optional["_models.BgpConfiguration"] = rest_field( + name="bgpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource Bgp configuration.""" - proxy_url_configuration: Optional["_models.ProxyUrlConfiguration"] = rest_field(name="proxyUrlConfiguration") + proxy_url_configuration: Optional["_models.ProxyUrlConfiguration"] = rest_field( + name="proxyUrlConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) """proxyUrl configuration of the cache node.""" - proxy_url: Optional[str] = rest_field(name="proxyUrl") - """Cache node resource Mcc proxy Url.""" - is_proxy_required: Optional[Union[str, "_models.ProxyRequired"]] = rest_field(name="isProxyRequired") + is_proxy_required: Optional[Union[str, "_models.ProxyRequired"]] = rest_field( + name="isProxyRequired", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource requires a proxy. Known values are: \"None\" and \"Required\".""" - os_type: Optional[Union[str, "_models.OsType"]] = rest_field(name="osType") + os_type: Optional[Union[str, "_models.OsType"]] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) """Operating system of the cache node. Known values are: \"Windows\", \"Linux\", and \"Eflow\".""" - update_cycle_type: Optional[Union[str, "_models.CycleType"]] = rest_field(name="updateCycleType") - """Update Cycle Type. Known values are: \"Preview\", \"Slow\", and \"Fast\".""" - auto_update_version: Optional[str] = rest_field(name="autoUpdateVersion") + auto_update_version: Optional[str] = rest_field( + name="autoUpdateVersion", visibility=["read", "create", "update", "delete", "query"] + ) """Auto update or fast update version.""" - update_info_details: Optional[str] = rest_field(name="updateInfoDetails") + update_info_details: Optional[str] = rest_field( + name="updateInfoDetails", visibility=["read", "create", "update", "delete", "query"] + ) """Update related information details.""" update_requested_date_time: Optional[datetime.datetime] = rest_field( - name="updateRequestedDateTime", format="rfc3339" + name="updateRequestedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """customer requested date time for mcc install of update cycle.""" auto_update_next_available_version: Optional[str] = rest_field( @@ -164,32 +191,47 @@ class AdditionalCacheNodeProperties(_model_base.Model): name="autoUpdateLastTriggeredDateTime", visibility=["read"], format="rfc3339" ) """Auto update last triggered date time of mcc install.""" - optional_property1: Optional[str] = rest_field(name="optionalProperty1") + creation_method: Optional[int] = rest_field( + name="creationMethod", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource creation method of mcc cache node resource, cli or portal.""" + tls_status: Optional[str] = rest_field(name="tlsStatus", visibility=["read"]) + """Cache node tls certificate status.""" + optional_property1: Optional[str] = rest_field( + name="optionalProperty1", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #1 of Mcc response object.""" - optional_property2: Optional[str] = rest_field(name="optionalProperty2") + optional_property2: Optional[str] = rest_field( + name="optionalProperty2", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #2 of Mcc response object.""" - optional_property3: Optional[str] = rest_field(name="optionalProperty3") + optional_property3: Optional[str] = rest_field( + name="optionalProperty3", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #3 of Mcc response object.""" - optional_property4: Optional[str] = rest_field(name="optionalProperty4") + optional_property4: Optional[str] = rest_field( + name="optionalProperty4", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #4 of Mcc response object.""" - optional_property5: Optional[str] = rest_field(name="optionalProperty5") + optional_property5: Optional[str] = rest_field( + name="optionalProperty5", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #5 of Mcc response object.""" @overload def __init__( # pylint: disable=too-many-locals self, *, - cache_node_properties_details_issues_list: Optional[List[str]] = None, - drive_configuration: Optional[List["_models.CacheNodeDriveConfiguration"]] = None, + cache_node_properties_details_issues_list: Optional[list[str]] = None, + drive_configuration: Optional[list["_models.CacheNodeDriveConfiguration"]] = None, bgp_configuration: Optional["_models.BgpConfiguration"] = None, proxy_url_configuration: Optional["_models.ProxyUrlConfiguration"] = None, - proxy_url: Optional[str] = None, is_proxy_required: Optional[Union[str, "_models.ProxyRequired"]] = None, os_type: Optional[Union[str, "_models.OsType"]] = None, - update_cycle_type: Optional[Union[str, "_models.CycleType"]] = None, auto_update_version: Optional[str] = None, update_info_details: Optional[str] = None, update_requested_date_time: Optional[datetime.datetime] = None, + creation_method: Optional[int] = None, optional_property1: Optional[str] = None, optional_property2: Optional[str] = None, optional_property3: Optional[str] = None, @@ -208,13 +250,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AdditionalCustomerProperties(_model_base.Model): +class AdditionalCustomerProperties(_Model): """Model representing customer for connected cache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar peering_db_last_update_time: Customer resource last PeeringDB update timestamp. - :vartype peering_db_last_update_time: ~datetime.datetime :ivar customer_properties_overview_cache_efficiency: Customer resource cache efficiency. :vartype customer_properties_overview_cache_efficiency: float :ivar customer_properties_overview_average_egress_mbps: Customer resource average egress in @@ -286,10 +324,6 @@ class AdditionalCustomerProperties(_model_base.Model): :vartype optional_property5: str """ - peering_db_last_update_time: Optional[datetime.datetime] = rest_field( - name="peeringDbLastUpdateTime", visibility=["read"], format="rfc3339" - ) - """Customer resource last PeeringDB update timestamp.""" customer_properties_overview_cache_efficiency: Optional[float] = rest_field( name="customerPropertiesOverviewCacheEfficiency", visibility=["read"] ) @@ -342,40 +376,64 @@ class AdditionalCustomerProperties(_model_base.Model): """Customer resource last PeeringDB update timestamp.""" customer_org_name: Optional[str] = rest_field(name="customerOrgName", visibility=["read"]) """Customer resource owner organization name.""" - customer_email: Optional[str] = rest_field(name="customerEmail") + customer_email: Optional[str] = rest_field( + name="customerEmail", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource contact email.""" - customer_transit_asn: Optional[str] = rest_field(name="customerTransitAsn") + customer_transit_asn: Optional[str] = rest_field( + name="customerTransitAsn", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource transit Asn (autonomous system number).""" customer_transit_state: Optional[Union[str, "_models.CustomerTransitState"]] = rest_field( - name="customerTransitState" + name="customerTransitState", visibility=["read", "create", "update", "delete", "query"] ) """Customer resource transit state. Known values are: \"NoTransit\", \"CombinedTransit\", and \"TransitOnly\".""" - customer_asn: Optional[str] = rest_field(name="customerAsn") + customer_asn: Optional[str] = rest_field( + name="customerAsn", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource Asn (autonomous system number).""" customer_asn_estimated_egress_peek_gbps: Optional[float] = rest_field( name="customerAsnEstimatedEgressPeekGbps", visibility=["read"] ) """Customer resource estimated Asn peering peak in Gbps.""" - customer_entitlement_sku_id: Optional[str] = rest_field(name="customerEntitlementSkuId") + customer_entitlement_sku_id: Optional[str] = rest_field( + name="customerEntitlementSkuId", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource entitlement Sku Id.""" - customer_entitlement_sku_guid: Optional[str] = rest_field(name="customerEntitlementSkuGuid") + customer_entitlement_sku_guid: Optional[str] = rest_field( + name="customerEntitlementSkuGuid", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource entitlement Sku Guid.""" - customer_entitlement_sku_name: Optional[str] = rest_field(name="customerEntitlementSkuName") + customer_entitlement_sku_name: Optional[str] = rest_field( + name="customerEntitlementSkuName", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource entitlement Sku name.""" customer_entitlement_expiration: Optional[datetime.datetime] = rest_field( - name="customerEntitlementExpiration", format="rfc3339" + name="customerEntitlementExpiration", + visibility=["read", "create", "update", "delete", "query"], + format="rfc3339", ) """Customer resource entitlement expiration date string.""" - optional_property1: Optional[str] = rest_field(name="optionalProperty1") + optional_property1: Optional[str] = rest_field( + name="optionalProperty1", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #1 of Mcc response object.""" - optional_property2: Optional[str] = rest_field(name="optionalProperty2") + optional_property2: Optional[str] = rest_field( + name="optionalProperty2", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #2 of Mcc response object.""" - optional_property3: Optional[str] = rest_field(name="optionalProperty3") + optional_property3: Optional[str] = rest_field( + name="optionalProperty3", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #3 of Mcc response object.""" - optional_property4: Optional[str] = rest_field(name="optionalProperty4") + optional_property4: Optional[str] = rest_field( + name="optionalProperty4", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #4 of Mcc response object.""" - optional_property5: Optional[str] = rest_field(name="optionalProperty5") + optional_property5: Optional[str] = rest_field( + name="optionalProperty5", visibility=["read", "create", "update", "delete", "query"] + ) """Optional property #5 of Mcc response object.""" @overload @@ -408,27 +466,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BgpCidrsConfiguration(_model_base.Model): +class BgpCidrsConfiguration(_Model): """Mcc cache node Bgp Cidr details. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar bgp_cidrs: Mcc cache node Bgp Cidr details. :vartype bgp_cidrs: list[str] """ - bgp_cidrs: Optional[List[str]] = rest_field(name="bgpCidrs", visibility=["read"]) + bgp_cidrs: Optional[list[str]] = rest_field(name="bgpCidrs", visibility=["read"]) """Mcc cache node Bgp Cidr details.""" -class BgpConfiguration(_model_base.Model): +class BgpConfiguration(_Model): """Bgp configuration of cache node. :ivar asn_to_ip_address_mapping: Asn to ip address mapping. :vartype asn_to_ip_address_mapping: str """ - asn_to_ip_address_mapping: Optional[str] = rest_field(name="asnToIpAddressMapping") + asn_to_ip_address_mapping: Optional[str] = rest_field( + name="asnToIpAddressMapping", visibility=["read", "create", "update", "delete", "query"] + ) """Asn to ip address mapping.""" @overload @@ -449,7 +507,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheNodeDriveConfiguration(_model_base.Model): +class CacheNodeDriveConfiguration(_Model): """Drive configuration for cache node. :ivar physical_path: physical path location of the folder used for caching content. @@ -462,13 +520,19 @@ class CacheNodeDriveConfiguration(_model_base.Model): :vartype nginx_mapping: str """ - physical_path: Optional[str] = rest_field(name="physicalPath") + physical_path: Optional[str] = rest_field( + name="physicalPath", visibility=["read", "create", "update", "delete", "query"] + ) """physical path location of the folder used for caching content.""" - size_in_gb: Optional[int] = rest_field(name="sizeInGb") + size_in_gb: Optional[int] = rest_field(name="sizeInGb", visibility=["read", "create", "update", "delete", "query"]) """physical size of the drive used for caching content.""" - cache_number: Optional[int] = rest_field(name="cacheNumber") + cache_number: Optional[int] = rest_field( + name="cacheNumber", visibility=["read", "create", "update", "delete", "query"] + ) """corresponding nginx cache number. Valid cache numbers are 1 - 20.""" - nginx_mapping: Optional[str] = rest_field(name="nginxMapping") + nginx_mapping: Optional[str] = rest_field( + name="nginxMapping", visibility=["read", "create", "update", "delete", "query"] + ) """full binding for corresponding nginx cache drive.""" @overload @@ -492,11 +556,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheNodeEntity(_model_base.Model): +class CacheNodeEntity(_Model): """Model representing Cache Node for ConnectedCache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar fully_qualified_resource_id: Cache node resource Azure fully qualified resource Id. :vartype fully_qualified_resource_id: str :ivar customer_id: Cache node resource customer resource GUID Id. @@ -605,41 +667,60 @@ class CacheNodeEntity(_model_base.Model): "Preview", "Slow", and "Fast". :vartype auto_update_ring_type: str or ~azure.mgmt.connectedcache.models.AutoUpdateRingType :ivar auto_update_requested_week: Customer requested week of month for mcc install of auto - update cycle. + update cycle. 0 is default no selection. 1-5 are valid weeks of month, 1 is first week, 2 is + second week, etc. :vartype auto_update_requested_week: int :ivar auto_update_requested_day: Customer requested day of week for mcc install of auto update - cycle. + cycle. 0 is default no selection. 1-7 are days of week, 1 is Sunday, 2 is Monday, etc. :vartype auto_update_requested_day: int :ivar auto_update_requested_time: Customer requested time of the day for mcc install of auto update cycle, should be hh:mm. :vartype auto_update_requested_time: str """ - fully_qualified_resource_id: Optional[str] = rest_field(name="fullyQualifiedResourceId") + fully_qualified_resource_id: Optional[str] = rest_field( + name="fullyQualifiedResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource Azure fully qualified resource Id.""" customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"]) """Cache node resource customer resource GUID Id.""" - customer_name: Optional[str] = rest_field(name="customerName") + customer_name: Optional[str] = rest_field( + name="customerName", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource customer resource name.""" - ip_address: Optional[str] = rest_field(name="ipAddress") + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) """Cache node resource Ip address.""" - customer_index: Optional[str] = rest_field(name="customerIndex") + customer_index: Optional[str] = rest_field( + name="customerIndex", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource customer index as string.""" - cache_node_id: Optional[str] = rest_field(name="cacheNodeId") + cache_node_id: Optional[str] = rest_field( + name="cacheNodeId", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource identifier of the cache node.""" - cache_node_name: Optional[str] = rest_field(name="cacheNodeName") + cache_node_name: Optional[str] = rest_field( + name="cacheNodeName", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource name.""" - customer_asn: Optional[int] = rest_field(name="customerAsn") + customer_asn: Optional[int] = rest_field( + name="customerAsn", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource customer resource Asn (autonomous system number).""" - is_enabled: Optional[bool] = rest_field(name="isEnabled") + is_enabled: Optional[bool] = rest_field( + name="isEnabled", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource flag for indicating if cache node is enabled.""" - max_allowable_egress_in_mbps: Optional[int] = rest_field(name="maxAllowableEgressInMbps") + max_allowable_egress_in_mbps: Optional[int] = rest_field( + name="maxAllowableEgressInMbps", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource maximum allowed egress in Mbps.""" max_allowable_probability: Optional[float] = rest_field(name="maxAllowableProbability", visibility=["read"]) """Cache node resource maximum allowed probability of egress.""" x_cid: Optional[str] = rest_field(name="xCid", visibility=["read"]) """Cache node resource Azure XCid.""" - is_enterprise_managed: Optional[bool] = rest_field(name="isEnterpriseManaged") + is_enterprise_managed: Optional[bool] = rest_field( + name="isEnterpriseManaged", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource flag for determining if managed by enterprise as boolean.""" create_async_operation_id: Optional[str] = rest_field(name="createAsyncOperationId", visibility=["read"]) """Cache node resource create async operation Id.""" @@ -663,7 +744,9 @@ class CacheNodeEntity(_model_base.Model): """Cache node resource attempts to sync with Azure.""" container_configurations: Optional[str] = rest_field(name="containerConfigurations", visibility=["read"]) """Cache node resource container configuration details.""" - cidr_csv: Optional[List[str]] = rest_field(name="cidrCsv") + cidr_csv: Optional[list[str]] = rest_field( + name="cidrCsv", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource comma separated values of Cidrs.""" cidr_csv_last_update_time: Optional[datetime.datetime] = rest_field( name="cidrCsvLastUpdateTime", visibility=["read"], format="rfc3339" @@ -694,11 +777,15 @@ class CacheNodeEntity(_model_base.Model): """Cache node resource Bgp block count.""" bgp_address_space: Optional[int] = rest_field(name="bgpAddressSpace", visibility=["read"]) """Cache node resource total addressable space defined by Bgp and Cidr Csv blocks.""" - should_migrate: Optional[bool] = rest_field(name="shouldMigrate") + should_migrate: Optional[bool] = rest_field( + name="shouldMigrate", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource flag for determining if customer will be migrated.""" bgp_file_bytes_truncated: Optional[int] = rest_field(name="bgpFileBytesTruncated", visibility=["read"]) """Cache node resource bytes truncated from Bgp output file.""" - cidr_selection_type: Optional[int] = rest_field(name="cidrSelectionType") + cidr_selection_type: Optional[int] = rest_field( + name="cidrSelectionType", visibility=["read", "create", "update", "delete", "query"] + ) """Cache node resource current Cidr range precedence selection type.""" is_frozen: Optional[bool] = rest_field(name="isFrozen", visibility=["read"]) """Cache node resource flag for indicating the cache node resource is frozen (not selectable, not @@ -728,16 +815,28 @@ class CacheNodeEntity(_model_base.Model): """Cache node resource Mcc container configuration details re-sync trigger.""" image_uri: Optional[str] = rest_field(name="imageUri", visibility=["read"]) """Cache node resource Mcc Container Id Uri.""" - fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName") + fully_qualified_domain_name: Optional[str] = rest_field( + name="fullyQualifiedDomainName", visibility=["read", "create", "update", "delete", "query"] + ) """FQDN(fully qualified domain name) value of the mcc cache node.""" - auto_update_ring_type: Optional[Union[str, "_models.AutoUpdateRingType"]] = rest_field(name="autoUpdateRingType") + auto_update_ring_type: Optional[Union[str, "_models.AutoUpdateRingType"]] = rest_field( + name="autoUpdateRingType", visibility=["read", "create", "update", "delete", "query"] + ) """Auto Update Ring Type which is slow or fast etc. Known values are: \"Preview\", \"Slow\", and \"Fast\".""" - auto_update_requested_week: Optional[int] = rest_field(name="autoUpdateRequestedWeek") - """Customer requested week of month for mcc install of auto update cycle.""" - auto_update_requested_day: Optional[int] = rest_field(name="autoUpdateRequestedDay") - """Customer requested day of week for mcc install of auto update cycle.""" - auto_update_requested_time: Optional[str] = rest_field(name="autoUpdateRequestedTime") + auto_update_requested_week: Optional[int] = rest_field( + name="autoUpdateRequestedWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer requested week of month for mcc install of auto update cycle. 0 is default no + selection. 1-5 are valid weeks of month, 1 is first week, 2 is second week, etc.""" + auto_update_requested_day: Optional[int] = rest_field( + name="autoUpdateRequestedDay", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer requested day of week for mcc install of auto update cycle. 0 is default no selection. + 1-7 are days of week, 1 is Sunday, 2 is Monday, etc.""" + auto_update_requested_time: Optional[str] = rest_field( + name="autoUpdateRequestedTime", visibility=["read", "create", "update", "delete", "query"] + ) """Customer requested time of the day for mcc install of auto update cycle, should be hh:mm.""" @overload @@ -754,7 +853,7 @@ def __init__( # pylint: disable=too-many-locals is_enabled: Optional[bool] = None, max_allowable_egress_in_mbps: Optional[int] = None, is_enterprise_managed: Optional[bool] = None, - cidr_csv: Optional[List[str]] = None, + cidr_csv: Optional[list[str]] = None, should_migrate: Optional[bool] = None, cidr_selection_type: Optional[int] = None, fully_qualified_domain_name: Optional[str] = None, @@ -775,11 +874,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheNodeInstallProperties(_model_base.Model): +class CacheNodeInstallProperties(_Model): """Mcc cache node resource install script properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar customer_id: Mcc customer resource Id. :vartype customer_id: str :ivar cache_node_id: Mcc cache node resource Id. @@ -790,11 +887,22 @@ class CacheNodeInstallProperties(_model_base.Model): :vartype secondary_account_key: str :ivar registration_key: Mcc Iot Central temporary device registration key, used once. :vartype registration_key: str + :ivar tls_certificate_provisioning_key: Mcc Tls certificate provisioning key. + :vartype tls_certificate_provisioning_key: str + :ivar drive_configuration: Cache node resource drive configurations. + :vartype drive_configuration: + list[~azure.mgmt.connectedcache.models.CacheNodeDriveConfiguration] + :ivar proxy_url_configuration: proxyUrl configuration of the cache node. + :vartype proxy_url_configuration: ~azure.mgmt.connectedcache.models.ProxyUrlConfiguration """ - customer_id: Optional[str] = rest_field(name="customerId") + customer_id: Optional[str] = rest_field( + name="customerId", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc customer resource Id.""" - cache_node_id: Optional[str] = rest_field(name="cacheNodeId") + cache_node_id: Optional[str] = rest_field( + name="cacheNodeId", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc cache node resource Id.""" primary_account_key: Optional[str] = rest_field(name="primaryAccountKey", visibility=["read"]) """Mcc primary account key. Internal to Mcc.""" @@ -802,6 +910,18 @@ class CacheNodeInstallProperties(_model_base.Model): """Mcc secondary account key. Internal to Mcc.""" registration_key: Optional[str] = rest_field(name="registrationKey", visibility=["read"]) """Mcc Iot Central temporary device registration key, used once.""" + tls_certificate_provisioning_key: Optional[str] = rest_field( + name="tlsCertificateProvisioningKey", visibility=["read"] + ) + """Mcc Tls certificate provisioning key.""" + drive_configuration: Optional[list["_models.CacheNodeDriveConfiguration"]] = rest_field( + name="driveConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Cache node resource drive configurations.""" + proxy_url_configuration: Optional["_models.ProxyUrlConfiguration"] = rest_field( + name="proxyUrlConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """proxyUrl configuration of the cache node.""" @overload def __init__( @@ -809,6 +929,8 @@ def __init__( *, customer_id: Optional[str] = None, cache_node_id: Optional[str] = None, + drive_configuration: Optional[list["_models.CacheNodeDriveConfiguration"]] = None, + proxy_url_configuration: Optional["_models.ProxyUrlConfiguration"] = None, ) -> None: ... @overload @@ -822,196 +944,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CacheNodeOldResponse(_model_base.Model): - """Model representing Cache Node for ConnectedCache resource. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The provisioned state of the resource. Known values are: "Succeeded", - "Failed", "Canceled", "Unknown", "Accepted", "Upgrading", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.connectedcache.models.ProvisioningState - :ivar status_code: statusCode used to get code details of Mcc response object. - :vartype status_code: str - :ivar status_text: statusText used to get status details in string format of Mcc response - object. - :vartype status_text: str - :ivar status_details: statusDetails used to get inner details of Mcc response object. - :vartype status_details: str - :ivar status: status of the HTTP error code. - :vartype status: str - :ivar error: The error details. - :vartype error: ~azure.mgmt.connectedcache.models.ErrorDetail - """ - - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioned state of the resource. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Unknown\", \"Accepted\", \"Upgrading\", and \"Deleting\".""" - status_code: Optional[str] = rest_field(name="statusCode") - """statusCode used to get code details of Mcc response object.""" - status_text: Optional[str] = rest_field(name="statusText") - """statusText used to get status details in string format of Mcc response object.""" - status_details: Optional[str] = rest_field(name="statusDetails") - """statusDetails used to get inner details of Mcc response object.""" - status: Optional[str] = rest_field(visibility=["read"]) - """status of the HTTP error code.""" - error: Optional["_models.ErrorDetail"] = rest_field() - """The error details.""" - - @overload - def __init__( - self, - *, - status_code: Optional[str] = None, - status_text: Optional[str] = None, - status_details: Optional[str] = None, - error: Optional["_models.ErrorDetail"] = 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_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.connectedcache.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.connectedcache.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: Optional[Dict[str, str]] = rest_field() - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, 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 CacheNodePreviewResource(TrackedResource): - """Concrete tracked resource types can be created by aliasing this type using a specific property - type. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.connectedcache.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.connectedcache.models.CacheNodeOldResponse - """ - - properties: Optional["_models.CacheNodeOldResponse"] = rest_field(visibility=["read", "create", "update"]) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CacheNodeOldResponse"] = 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 CacheNodeProperty(_model_base.Model): +class CacheNodeProperty(_Model): """Model representing an Mcc cache node connectedCache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provisioning_state: The provisioned state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Unknown", "Accepted", "Upgrading", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.connectedcache.models.ProvisioningState @@ -1037,21 +972,29 @@ class CacheNodeProperty(_model_base.Model): ) """The provisioned state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Unknown\", \"Accepted\", \"Upgrading\", and \"Deleting\".""" - cache_node: Optional["_models.CacheNodeEntity"] = rest_field(name="cacheNode") + cache_node: Optional["_models.CacheNodeEntity"] = rest_field( + name="cacheNode", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc cache node resource (cache node entity).""" additional_cache_node_properties: Optional["_models.AdditionalCacheNodeProperties"] = rest_field( - name="additionalCacheNodeProperties" + name="additionalCacheNodeProperties", visibility=["read", "create", "update", "delete", "query"] ) """Mcc cache node resource additional properties.""" - status_code: Optional[str] = rest_field(name="statusCode") + status_code: Optional[str] = rest_field( + name="statusCode", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc response status code.""" - status_text: Optional[str] = rest_field(name="statusText") + status_text: Optional[str] = rest_field( + name="statusText", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc response status text as string for retrieving status details.""" - status_details: Optional[str] = rest_field(name="statusDetails") + status_details: Optional[str] = rest_field( + name="statusDetails", visibility=["read", "create", "update", "delete", "query"] + ) """Mcc response status details for retrieving response inner details.""" status: Optional[str] = rest_field(visibility=["read"]) """HTTP error status code.""" - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Mcc response error details.""" @overload @@ -1077,21 +1020,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectedCachePatchResource(_model_base.Model): +class ConnectedCachePatchResource(_Model): """Mcc PATCH operation properties. :ivar tags: Resource tags. :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "update"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "update"]) """Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1105,11 +1048,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomerEntity(_model_base.Model): +class CustomerEntity(_Model): """Model representing Customer resource for ConnectedCache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar fully_qualified_resource_id: Customer resource Azure fully qualified resource Id. :vartype fully_qualified_resource_id: str :ivar customer_id: Customer resource Guid Id. @@ -1149,27 +1090,43 @@ class CustomerEntity(_model_base.Model): :vartype verify_signup_phrase: str """ - fully_qualified_resource_id: Optional[str] = rest_field(name="fullyQualifiedResourceId") + fully_qualified_resource_id: Optional[str] = rest_field( + name="fullyQualifiedResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource Azure fully qualified resource Id.""" customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"]) """Customer resource Guid Id.""" - customer_name: Optional[str] = rest_field(name="customerName") + customer_name: Optional[str] = rest_field( + name="customerName", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource name.""" - contact_email: Optional[str] = rest_field(name="contactEmail") + contact_email: Optional[str] = rest_field( + name="contactEmail", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource contact email.""" - contact_phone: Optional[str] = rest_field(name="contactPhone") + contact_phone: Optional[str] = rest_field( + name="contactPhone", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource contact phone.""" - contact_name: Optional[str] = rest_field(name="contactName") + contact_name: Optional[str] = rest_field( + name="contactName", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource contact full name.""" - is_entitled: Optional[bool] = rest_field(name="isEntitled") + is_entitled: Optional[bool] = rest_field( + name="isEntitled", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource entitlement flag as boolean.""" - release_version: Optional[int] = rest_field(name="releaseVersion") + release_version: Optional[int] = rest_field( + name="releaseVersion", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource Mcc release version.""" create_async_operation_id: Optional[str] = rest_field(name="createAsyncOperationId", visibility=["read"]) """Customer resource create async operation Id.""" delete_async_operation_id: Optional[str] = rest_field(name="deleteAsyncOperationId", visibility=["read"]) """Customer resource deletion async operation Id.""" - client_tenant_id: Optional[str] = rest_field(name="clientTenantId") + client_tenant_id: Optional[str] = rest_field( + name="clientTenantId", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource client tenant Id of subscription.""" synch_with_azure_attempts_count: Optional[int] = rest_field(name="synchWithAzureAttemptsCount", visibility=["read"]) """Customer resource sync attempts.""" @@ -1177,13 +1134,21 @@ class CustomerEntity(_model_base.Model): name="lastSyncWithAzureTimestamp", visibility=["read"], format="rfc3339" ) """Customer resource last Azure sync timestamp.""" - is_enterprise_managed: Optional[bool] = rest_field(name="isEnterpriseManaged") + is_enterprise_managed: Optional[bool] = rest_field( + name="isEnterpriseManaged", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource flag for enterprise management as boolean.""" - should_migrate: Optional[bool] = rest_field(name="shouldMigrate") + should_migrate: Optional[bool] = rest_field( + name="shouldMigrate", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource flag for migration.""" - resend_signup_code: Optional[bool] = rest_field(name="resendSignupCode") + resend_signup_code: Optional[bool] = rest_field( + name="resendSignupCode", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource flag for resending signup code as boolean.""" - verify_signup_code: Optional[bool] = rest_field(name="verifySignupCode") + verify_signup_code: Optional[bool] = rest_field( + name="verifySignupCode", visibility=["read", "create", "update", "delete", "query"] + ) """Customer resource flag for requiring verification of signup code as boolean.""" verify_signup_phrase: Optional[str] = rest_field(name="verifySignupPhrase", visibility=["create", "update"]) """Customer resource phrase for verifying signup.""" @@ -1218,11 +1183,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomerProperty(_model_base.Model): +class CustomerProperty(_Model): """Model representing customer for connectedCache resource. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provisioning_state: The provisioned state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Unknown", "Accepted", "Upgrading", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.connectedcache.models.ProvisioningState @@ -1248,10 +1211,12 @@ class CustomerProperty(_model_base.Model): ) """The provisioned state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Unknown\", \"Accepted\", \"Upgrading\", and \"Deleting\".""" - customer: Optional["_models.CustomerEntity"] = rest_field() + customer: Optional["_models.CustomerEntity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Mcc customer resource (customer entity).""" additional_customer_properties: Optional["_models.AdditionalCustomerProperties"] = rest_field( - name="additionalCustomerProperties" + name="additionalCustomerProperties", visibility=["read", "create", "update", "delete", "query"] ) """Mcc customer resource additional properties.""" status_code: Optional[str] = rest_field(name="statusCode", visibility=["read"]) @@ -1284,14 +1249,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EnterpriseMccCacheNodeResource(TrackedResource): - """Represents the high level Nodes needed to provision cache node resources. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1301,24 +1263,51 @@ class EnterpriseMccCacheNodeResource(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.connectedcache.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.connectedcache.models.CacheNodeProperty """ - properties: Optional["_models.CacheNodeProperty"] = rest_field(visibility=["read", "create", "update"]) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked 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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.connectedcache.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CacheNodeProperty"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1332,14 +1321,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EnterpriseMccCustomerResource(TrackedResource): - """Represents the high level Nodes needed to provision customer resources. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - +class EnterpriseMccCacheNodeResource(TrackedResource): + """Represents the high level Nodes needed to provision cache node resources. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1354,10 +1340,10 @@ class EnterpriseMccCustomerResource(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.connectedcache.models.CustomerProperty + :vartype properties: ~azure.mgmt.connectedcache.models.CacheNodeProperty """ - properties: Optional["_models.CustomerProperty"] = rest_field(visibility=["read", "create", "update"]) + properties: Optional["_models.CacheNodeProperty"] = rest_field(visibility=["read", "create", "update"]) """The resource-specific properties for this resource.""" @overload @@ -1365,8 +1351,8 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CustomerProperty"] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.CacheNodeProperty"] = None, ) -> None: ... @overload @@ -1380,15 +1366,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EnterprisePreviewResource(TrackedResource): - """ConnectedCache Resource. Represents the high level Nodes needed to provision CacheNode and - customer resources used in private preview. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - +class EnterpriseMccCustomerResource(TrackedResource): + """Represents the high level Nodes needed to provision customer resources. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1403,10 +1385,10 @@ class EnterprisePreviewResource(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.connectedcache.models.CacheNodeOldResponse + :vartype properties: ~azure.mgmt.connectedcache.models.CustomerProperty """ - properties: Optional["_models.CacheNodeOldResponse"] = rest_field(visibility=["read", "create", "update"]) + properties: Optional["_models.CustomerProperty"] = rest_field(visibility=["read", "create", "update"]) """The resource-specific properties for this resource.""" @overload @@ -1414,8 +1396,8 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CacheNodeOldResponse"] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.CustomerProperty"] = None, ) -> None: ... @overload @@ -1429,11 +1411,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. @@ -1446,11 +1426,9 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -1469,23 +1447,22 @@ class ErrorDetail(_model_base.Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.connectedcache.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -1509,11 +1486,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IspCacheNodeResource(TrackedResource): """Represents the high level Nodes needed to provision cache node resources. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1539,7 +1513,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.CacheNodeProperty"] = None, ) -> None: ... @@ -1557,11 +1531,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class IspCustomerResource(TrackedResource): """Represents the high level Nodes needed to provision isp customer resources. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1587,7 +1558,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.CustomerProperty"] = None, ) -> None: ... @@ -1602,14 +1573,183 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MccCacheNodeBgpCidrDetails(TrackedResource): - """Represents all Cidr details of the Bgp request for a specific cache node resource. +class MccCacheNodeAutoUpdateHistory(TrackedResource): + """Mcc cache node resource auto update history. + + :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.connectedcache.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Mcc cache node resource auto update history properties. + :vartype properties: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistoryProperties + """ - Readonly variables are only populated by the server, and will be ignored when sending a request. + properties: Optional["_models.MccCacheNodeAutoUpdateHistoryProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mcc cache node resource auto update history properties.""" + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.MccCacheNodeAutoUpdateHistoryProperties"] = 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 MccCacheNodeAutoUpdateHistoryProperties(_Model): + """Mcc cache node resource auto update history properties. + + :ivar customer_id: Mcc customer resource Id. + :vartype customer_id: str + :ivar cache_node_id: Mcc cache node resource Id. + :vartype cache_node_id: str + :ivar auto_update_history: Cache node resource auto update history information. + :vartype auto_update_history: + list[~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateInfo] + """ + + customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"]) + """Mcc customer resource Id.""" + cache_node_id: Optional[str] = rest_field(name="cacheNodeId", visibility=["read"]) + """Mcc cache node resource Id.""" + auto_update_history: Optional[list["_models.MccCacheNodeAutoUpdateInfo"]] = rest_field( + name="autoUpdateHistory", visibility=["read", "create", "update", "delete", "query"] + ) + """Cache node resource auto update history information.""" + + @overload + def __init__( + self, + *, + auto_update_history: Optional[list["_models.MccCacheNodeAutoUpdateInfo"]] = 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 MccCacheNodeAutoUpdateInfo(_Model): + """Mcc cache node resource auto update properties. + + :ivar image_uri_before_update: Auto update image uri before update. + :vartype image_uri_before_update: str + :ivar image_uri_targeted: Auto update image uri targetted to update. + :vartype image_uri_targeted: str + :ivar image_uri_terminal: Auto update image uri at Terminal. + :vartype image_uri_terminal: str + :ivar auto_update_ring_type: Auto update Ring Type. + :vartype auto_update_ring_type: int + :ivar moved_to_terminal_state_date_time: Auto update image uri after update. + :vartype moved_to_terminal_state_date_time: ~datetime.datetime + :ivar rule_requested_week: Auto update image uri before update. + :vartype rule_requested_week: int + :ivar rule_requested_day: Auto update image uri after update. + :vartype rule_requested_day: int + :ivar created_date_time_utc: Auto update entity created datetime. + :vartype created_date_time_utc: ~datetime.datetime + :ivar updated_registry_date_time_utc: Auto update entity last updated datetime. + :vartype updated_registry_date_time_utc: ~datetime.datetime + :ivar plan_change_log_text: This text describing the purpose of the plan of auto update. + :vartype plan_change_log_text: str + :ivar auto_update_last_applied_status: Auto update last applied status. + :vartype auto_update_last_applied_status: int + :ivar auto_update_last_applied_status_text: Auto update last applied status text. + :vartype auto_update_last_applied_status_text: str + :ivar auto_update_last_applied_status_detailed_text: Auto update last applied detailed status + text. + :vartype auto_update_last_applied_status_detailed_text: str + :ivar plan_id: Auto update planId. + :vartype plan_id: int + :ivar time_to_go_live_date_time: Auto update time to go live date time. + :vartype time_to_go_live_date_time: str + :ivar rule_requested_minute: Auto update rule requested minute. + :vartype rule_requested_minute: str + :ivar rule_requested_hour: Auto update rule requested hour. + :vartype rule_requested_hour: str + """ + + image_uri_before_update: Optional[str] = rest_field(name="imageUriBeforeUpdate", visibility=["read"]) + """Auto update image uri before update.""" + image_uri_targeted: Optional[str] = rest_field(name="imageUriTargeted", visibility=["read"]) + """Auto update image uri targetted to update.""" + image_uri_terminal: Optional[str] = rest_field(name="imageUriTerminal", visibility=["read"]) + """Auto update image uri at Terminal.""" + auto_update_ring_type: Optional[int] = rest_field(name="autoUpdateRingType", visibility=["read"]) + """Auto update Ring Type.""" + moved_to_terminal_state_date_time: Optional[datetime.datetime] = rest_field( + name="movedToTerminalStateDateTime", visibility=["read"], format="rfc3339" + ) + """Auto update image uri after update.""" + rule_requested_week: Optional[int] = rest_field(name="ruleRequestedWeek", visibility=["read"]) + """Auto update image uri before update.""" + rule_requested_day: Optional[int] = rest_field(name="ruleRequestedDay", visibility=["read"]) + """Auto update image uri after update.""" + created_date_time_utc: Optional[datetime.datetime] = rest_field( + name="createdDateTimeUtc", visibility=["read"], format="rfc3339" + ) + """Auto update entity created datetime.""" + updated_registry_date_time_utc: Optional[datetime.datetime] = rest_field( + name="updatedRegistryDateTimeUtc", visibility=["read"], format="rfc3339" + ) + """Auto update entity last updated datetime.""" + plan_change_log_text: Optional[str] = rest_field(name="planChangeLogText", visibility=["read"]) + """This text describing the purpose of the plan of auto update.""" + auto_update_last_applied_status: Optional[int] = rest_field(name="autoUpdateLastAppliedStatus", visibility=["read"]) + """Auto update last applied status.""" + auto_update_last_applied_status_text: Optional[str] = rest_field( + name="autoUpdateLastAppliedStatusText", visibility=["read"] + ) + """Auto update last applied status text.""" + auto_update_last_applied_status_detailed_text: Optional[str] = rest_field( + name="autoUpdateLastAppliedStatusDetailedText", visibility=["read"] + ) + """Auto update last applied detailed status text.""" + plan_id: Optional[int] = rest_field(name="planId", visibility=["read"]) + """Auto update planId.""" + time_to_go_live_date_time: Optional[str] = rest_field(name="timeToGoLiveDateTime", visibility=["read"]) + """Auto update time to go live date time.""" + rule_requested_minute: Optional[str] = rest_field(name="ruleRequestedMinute", visibility=["read"]) + """Auto update rule requested minute.""" + rule_requested_hour: Optional[str] = rest_field(name="ruleRequestedHour", visibility=["read"]) + """Auto update rule requested hour.""" + + +class MccCacheNodeBgpCidrDetails(TrackedResource): + """Represents all Cidr details of the Bgp request for a specific cache node resource. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1627,7 +1767,9 @@ class MccCacheNodeBgpCidrDetails(TrackedResource): :vartype properties: ~azure.mgmt.connectedcache.models.BgpCidrsConfiguration """ - properties: Optional["_models.BgpCidrsConfiguration"] = rest_field() + properties: Optional["_models.BgpCidrsConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Mcc cache node resource Bgp Cidr properties.""" @overload @@ -1635,7 +1777,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.BgpCidrsConfiguration"] = None, ) -> None: ... @@ -1653,11 +1795,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class MccCacheNodeInstallDetails(TrackedResource): """Mcc cache node resource all install details. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1675,7 +1814,9 @@ class MccCacheNodeInstallDetails(TrackedResource): :vartype properties: ~azure.mgmt.connectedcache.models.CacheNodeInstallProperties """ - properties: Optional["_models.CacheNodeInstallProperties"] = rest_field() + properties: Optional["_models.CacheNodeInstallProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Mcc cache node resource install script details.""" @overload @@ -1683,7 +1824,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.CacheNodeInstallProperties"] = None, ) -> None: ... @@ -1698,10 +1839,249 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class MccCacheNodeIssueHistory(TrackedResource): + """Mcc cache node resource issue history. + + :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.connectedcache.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Mcc cache node resource issue history properties. + :vartype properties: ~azure.mgmt.connectedcache.models.MccCacheNodeIssueHistoryProperties + """ + + properties: Optional["_models.MccCacheNodeIssueHistoryProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mcc cache node resource issue history properties.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.MccCacheNodeIssueHistoryProperties"] = 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 MccCacheNodeIssueHistoryProperties(_Model): + """Mcc cache node resource issue history properties. + + :ivar customer_id: Mcc customer resource Id. + :vartype customer_id: str + :ivar cache_node_id: Mcc cache node resource Id. + :vartype cache_node_id: str + :ivar mcc_issue_history: Cache node resource issue details history. + :vartype mcc_issue_history: list[~azure.mgmt.connectedcache.models.MccIssue] + """ + + customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"]) + """Mcc customer resource Id.""" + cache_node_id: Optional[str] = rest_field(name="cacheNodeId", visibility=["read"]) + """Mcc cache node resource Id.""" + mcc_issue_history: Optional[list["_models.MccIssue"]] = rest_field( + name="mccIssueHistory", visibility=["read", "create", "update", "delete", "query"] + ) + """Cache node resource issue details history.""" + + @overload + def __init__( + self, + *, + mcc_issue_history: Optional[list["_models.MccIssue"]] = 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 MccCacheNodeTlsCertificate(_Model): + """Mcc cache node resource Tls certificate details. + + :ivar action_required: Mcc cache node Tls certificate status. + :vartype action_required: str + :ivar certificate_file_name: Mcc cache node Tls certificate file name. + :vartype certificate_file_name: str + :ivar thumbprint: Mcc cache node Tls certificate thumbprint. + :vartype thumbprint: str + :ivar expiry_date: Mcc cache node Tls certificate expiry date. + :vartype expiry_date: ~datetime.datetime + :ivar not_before_date: Mcc cache node Tls certificate not before date. + :vartype not_before_date: ~datetime.datetime + :ivar subject: Mcc cache node Tls certificate subject name. + :vartype subject: str + :ivar subject_alt_name: Mcc cache node Tls certificate subject alternate name. + :vartype subject_alt_name: str + """ + + action_required: Optional[str] = rest_field(name="actionRequired", visibility=["read"]) + """Mcc cache node Tls certificate status.""" + certificate_file_name: Optional[str] = rest_field(name="certificateFileName", visibility=["read"]) + """Mcc cache node Tls certificate file name.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Mcc cache node Tls certificate thumbprint.""" + expiry_date: Optional[datetime.datetime] = rest_field(name="expiryDate", visibility=["read"], format="rfc3339") + """Mcc cache node Tls certificate expiry date.""" + not_before_date: Optional[datetime.datetime] = rest_field( + name="notBeforeDate", visibility=["read"], format="rfc3339" + ) + """Mcc cache node Tls certificate not before date.""" + subject: Optional[str] = rest_field(visibility=["read"]) + """Mcc cache node Tls certificate subject name.""" + subject_alt_name: Optional[str] = rest_field(name="subjectAltName", visibility=["read"]) + """Mcc cache node Tls certificate subject alternate name.""" + + +class MccCacheNodeTlsCertificateHistory(TrackedResource): + """Mcc cache node resource Tls certificate history 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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.connectedcache.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Mcc cache node resource Tls certificate details. + :vartype properties: ~azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificateProperties + """ + + properties: Optional["_models.MccCacheNodeTlsCertificateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mcc cache node resource Tls certificate details.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.MccCacheNodeTlsCertificateProperties"] = 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 MccCacheNodeTlsCertificateProperties(_Model): + """Mcc cache node resource auto update properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. + :ivar customer_id: Mcc customer resource Id. + :vartype customer_id: str + :ivar cache_node_id: Mcc cache node resource Id. + :vartype cache_node_id: str + :ivar tls_certificate_history: Cache node resource tls certificate history details. + :vartype tls_certificate_history: + list[~azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificate] + """ + + customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"]) + """Mcc customer resource Id.""" + cache_node_id: Optional[str] = rest_field(name="cacheNodeId", visibility=["read"]) + """Mcc cache node resource Id.""" + tls_certificate_history: Optional[list["_models.MccCacheNodeTlsCertificate"]] = rest_field( + name="tlsCertificateHistory", visibility=["read", "create", "update", "delete", "query"] + ) + """Cache node resource tls certificate history details.""" + + @overload + def __init__( + self, + *, + tls_certificate_history: Optional[list["_models.MccCacheNodeTlsCertificate"]] = 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 MccIssue(_Model): + """Mcc cache node resource issue properties. + + :ivar mcc_issue_type: Mcc cache node issue type. + :vartype mcc_issue_type: str + :ivar toast_string: Mcc cache node issues toastString. + :vartype toast_string: str + :ivar detail_string: Mcc cache node issue detail string. + :vartype detail_string: str + :ivar help_link: Mcc cache node issue related help link. + :vartype help_link: str + :ivar issue_start_date: Mcc cache node issue start date. + :vartype issue_start_date: ~datetime.datetime + :ivar issue_end_date: Mcc cache node issue end date. + :vartype issue_end_date: ~datetime.datetime + """ + + mcc_issue_type: Optional[str] = rest_field(name="mccIssueType", visibility=["read"]) + """Mcc cache node issue type.""" + toast_string: Optional[str] = rest_field(name="toastString", visibility=["read"]) + """Mcc cache node issues toastString.""" + detail_string: Optional[str] = rest_field(name="detailString", visibility=["read"]) + """Mcc cache node issue detail string.""" + help_link: Optional[str] = rest_field(name="helpLink", visibility=["read"]) + """Mcc cache node issue related help link.""" + issue_start_date: Optional[datetime.datetime] = rest_field( + name="issueStartDate", visibility=["read"], format="rfc3339" + ) + """Mcc cache node issue start date.""" + issue_end_date: Optional[datetime.datetime] = rest_field(name="issueEndDate", visibility=["read"], format="rfc3339") + """Mcc cache node issue end date.""" + + +class Operation(_Model): + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -1727,13 +2107,15 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" @@ -1741,7 +2123,7 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, + display: Optional["_models.OperationDisplay"] = None, ) -> None: ... @overload @@ -1755,11 +2137,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): +class OperationDisplay(_Model): """Localized display information for and operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". :vartype provider: str @@ -1788,17 +2168,18 @@ class OperationDisplay(_model_base.Model): views.""" -class ProxyUrlConfiguration(_model_base.Model): +class ProxyUrlConfiguration(_Model): """ProxyUrl configuration of cache node. :ivar proxy_url: Host Proxy Address configuration along with port number. This can be a proxy - or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80. + or ip address. ex: xx.xx.xx.xxxx:80 or host name `http://exampleproxy.com:80 + `_. :vartype proxy_url: str """ - proxy_url: Optional[str] = rest_field(name="proxyUrl") + proxy_url: Optional[str] = rest_field(name="proxyUrl", visibility=["read", "create", "update", "delete", "query"]) """Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: - xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80.""" + xx.xx.xx.xxxx:80 or host name `http://exampleproxy.com:80 `_.""" @overload def __init__( @@ -1818,7 +2199,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): +class SystemData(_Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -1837,19 +2218,29 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_by: Optional[str] = rest_field(name="createdBy") + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that created the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that last modified the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource last modification (UTC).""" @overload diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_patch.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_patch.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/__init__.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/__init__.py index f34ede4b37e1..ff07f8879332 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/__init__.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/__init__.py @@ -13,8 +13,6 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._operations import EnterpriseCustomerOperationsOperations # type: ignore -from ._operations import CacheNodesOperationsOperations # type: ignore from ._operations import IspCustomersOperations # type: ignore from ._operations import IspCacheNodesOperationsOperations # type: ignore from ._operations import EnterpriseMccCustomersOperations # type: ignore @@ -26,8 +24,6 @@ __all__ = [ "Operations", - "EnterpriseCustomerOperationsOperations", - "CacheNodesOperationsOperations", "IspCustomersOperations", "IspCacheNodesOperationsOperations", "EnterpriseMccCustomersOperations", diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_operations.py index bcf520f14919..d4e5c5c6b39e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,12 +6,13 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -32,16 +33,15 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer +from .._configuration import ConnectedCacheMgmtClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -51,7 +51,7 @@ def build_operations_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,17 +66,17 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_customer_operations_get_request( # pylint: disable=name-too-long +def build_isp_customers_get_request( resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -94,18 +94,18 @@ def build_enterprise_customer_operations_get_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_customer_operations_create_or_update_request( # pylint: disable=name-too-long +def build_isp_customers_create_or_update_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -125,18 +125,18 @@ def build_enterprise_customer_operations_create_or_update_request( # pylint: di return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_customer_operations_update_request( # pylint: disable=name-too-long +def build_isp_customers_update_request( resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -156,17 +156,14 @@ def build_enterprise_customer_operations_update_request( # pylint: disable=name return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_customer_operations_delete_request( # pylint: disable=name-too-long +def build_isp_customers_delete_request( resource_group_name: str, customer_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -178,23 +175,20 @@ def build_enterprise_customer_operations_delete_request( # pylint: disable=name # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_enterprise_customer_operations_list_by_resource_group_request( # pylint: disable=name-too-long +def build_isp_customers_list_by_resource_group_request( # pylint: disable=name-too-long resource_group_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseCustomers" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -211,17 +205,17 @@ def build_enterprise_customer_operations_list_by_resource_group_request( # pyli return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_customer_operations_list_by_subscription_request( # pylint: disable=name-too-long +def build_isp_customers_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseCustomers" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -237,21 +231,26 @@ def build_enterprise_customer_operations_list_by_subscription_request( # pylint return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_nodes_operations_get_request( - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_get_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -265,22 +264,27 @@ def build_cache_nodes_operations_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_nodes_operations_createor_update_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -296,21 +300,27 @@ def build_cache_nodes_operations_createor_update_request( # pylint: disable=nam return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_nodes_operations_delete_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_update_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-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", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -319,27 +329,30 @@ def build_cache_nodes_operations_delete_request( # pylint: disable=name-too-lon _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_nodes_operations_update_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -347,28 +360,24 @@ def build_cache_nodes_operations_update_request( # pylint: disable=name-too-lon # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_cache_nodes_operations_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_list_by_isp_customer_resource_request( # pylint: disable=name-too-long + resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/cacheNodes" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -382,19 +391,26 @@ def build_cache_nodes_operations_list_by_resource_group_request( # pylint: disa return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cache_nodes_operations_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_get_bgp_cidrs_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/cacheNodes" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getBgpCidrs" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -405,24 +421,29 @@ def build_cache_nodes_operations_list_by_subscription_request( # pylint: disabl # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_get_request( - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_get_cache_node_install_details_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -433,25 +454,29 @@ def build_isp_customers_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_get_cache_node_auto_update_history_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -460,29 +485,31 @@ def build_isp_customers_create_or_update_request( # pylint: disable=name-too-lo _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_update_request( - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -491,24 +518,22 @@ def build_isp_customers_update_request( _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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_delete_request( +def build_enterprise_mcc_customers_get_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -523,23 +548,25 @@ def build_isp_customers_delete_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any +def build_enterprise_mcc_customers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, customer_resource_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", "2023-05-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", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -548,24 +575,29 @@ def build_isp_customers_list_by_resource_group_request( # pylint: disable=name- _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_customers_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any +def build_enterprise_mcc_customers_update_request( # pylint: disable=name-too-long + resource_group_name: str, customer_resource_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", "2023-05-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", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -574,31 +606,25 @@ def build_isp_customers_list_by_subscription_request( # pylint: disable=name-to _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_get_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_name: str, - subscription_id: str, - **kwargs: Any +def build_enterprise_mcc_customers_delete_request( # pylint: disable=name-too-long + resource_group_name: str, customer_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -606,33 +632,23 @@ def build_isp_cache_nodes_operations_get_request( # pylint: disable=name-too-lo # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_isp_cache_nodes_operations_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_name: str, - subscription_id: str, - **kwargs: Any +def build_enterprise_mcc_customers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -641,34 +657,24 @@ def build_isp_cache_nodes_operations_create_or_update_request( # pylint: disabl _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_update_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_name: str, - subscription_id: str, - **kwargs: Any +def build_enterprise_mcc_customers_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -677,14 +683,12 @@ def build_isp_cache_nodes_operations_update_request( # pylint: disable=name-too _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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_delete_request( # pylint: disable=name-too-long +def build_enterprise_mcc_cache_nodes_operations_get_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, @@ -694,11 +698,11 @@ def build_isp_cache_nodes_operations_delete_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -714,24 +718,30 @@ def build_isp_cache_nodes_operations_delete_request( # pylint: disable=name-too # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_list_by_isp_customer_resource_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_enterprise_mcc_cache_nodes_operations_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-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", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -740,12 +750,14 @@ def build_isp_cache_nodes_operations_list_by_isp_customer_resource_request( # p _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_get_bgp_cidrs_request( # pylint: disable=name-too-long +def build_enterprise_mcc_cache_nodes_operations_update_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, @@ -755,11 +767,12 @@ def build_isp_cache_nodes_operations_get_bgp_cidrs_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", "2023-05-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", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getBgpCidrs" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -773,26 +786,25 @@ def build_isp_cache_nodes_operations_get_bgp_cidrs_request( # pylint: disable=n _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_isp_cache_nodes_operations_get_cache_node_install_details_request( # pylint: disable=name-too-long +def build_enterprise_mcc_cache_nodes_operations_delete_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_name: str, cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -805,23 +817,20 @@ def build_isp_cache_nodes_operations_get_cache_node_install_details_request( # # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_enterprise_mcc_customers_get_request( # pylint: disable=name-too-long +def build_enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_request( # pylint: disable=name-too-long resource_group_name: str, customer_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -839,22 +848,26 @@ def build_enterprise_mcc_customers_get_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_mcc_customers_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -863,29 +876,31 @@ def build_enterprise_mcc_customers_create_or_update_request( # pylint: disable= _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_mcc_customers_update_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -894,1774 +909,106 @@ def build_enterprise_mcc_customers_update_request( # pylint: disable=name-too-l _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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_enterprise_mcc_customers_delete_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_name: str, subscription_id: str, **kwargs: Any +def build_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_enterprise_mcc_customers_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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_enterprise_mcc_customers_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers" - 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_enterprise_mcc_cache_nodes_operations_get_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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_enterprise_mcc_cache_nodes_operations_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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_enterprise_mcc_cache_nodes_operations_update_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_enterprise_mcc_cache_nodes_operations_delete_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_request( # pylint: disable=name-too-long - resource_group_name: str, customer_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_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_enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_request( # pylint: disable=name-too-long - resource_group_name: str, - customer_resource_name: str, - cache_node_resource_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", "2023-05-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails" # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), - "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.connectedcache.ConnectedCacheMgmtClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = 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_operations_list_request( - 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.Operation], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EnterpriseCustomerOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.connectedcache.ConnectedCacheMgmtClient`'s - :attr:`enterprise_customer_operations` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """Retrieves the properties of a Enterprise customer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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.EnterprisePreviewResource] = kwargs.pop("cls", None) - - _request = build_enterprise_customer_operations_get_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = 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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EnterprisePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.EnterprisePreviewResource, JSON, 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_enterprise_customer_operations_create_or_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - 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 cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: _models.EnterprisePreviewResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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 EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.EnterprisePreviewResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EnterprisePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Is one of the following types: - EnterprisePreviewResource, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource or JSON or - IO[bytes] - :return: An instance of LROPoller that returns EnterprisePreviewResource. The - EnterprisePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :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.EnterprisePreviewResource] = 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( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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.EnterprisePreviewResource, 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.EnterprisePreviewResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EnterprisePreviewResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: _models.ConnectedCachePatchResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: Union[_models.ConnectedCachePatchResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EnterprisePreviewResource: - """updates an existing enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Is one of the following types: - ConnectedCachePatchResource, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource or JSON or - IO[bytes] - :return: EnterprisePreviewResource. The EnterprisePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.EnterprisePreviewResource - :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)) - cls: ClsType[_models.EnterprisePreviewResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_enterprise_customer_operations_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EnterprisePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> None: - """Deletes an existing customer Enterprise resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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_enterprise_customer_operations_delete_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.EnterprisePreviewResource"]: - """Retrieves the properties of all ConnectedCache enterpriseCustomers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of EnterprisePreviewResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnterprisePreviewResource]] = 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_enterprise_customer_operations_list_by_resource_group_request( - resource_group_name=resource_group_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) - - 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.EnterprisePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.EnterprisePreviewResource"]: - """Retrieves the properties of all ConnectedCaches. - - :return: An iterator like instance of EnterprisePreviewResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.EnterprisePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EnterprisePreviewResource]] = 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_enterprise_customer_operations_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), 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.EnterprisePreviewResource], deserialized["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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class CacheNodesOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.connectedcache.ConnectedCacheMgmtClient`'s - :attr:`cache_nodes_operations` attribute. - """ - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """Retrieves the properties of a cacheNodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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.CacheNodePreviewResource] = kwargs.pop("cls", None) - - _request = build_cache_nodes_operations_get_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = 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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.CacheNodePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _createor_update_initial( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.CacheNodePreviewResource, JSON, 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_cache_nodes_operations_createor_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - 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 cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: _models.CacheNodePreviewResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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 CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_createor_update( - self, - resource_group_name: str, - customer_resource_name: str, - resource: Union[_models.CacheNodePreviewResource, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CacheNodePreviewResource]: - """Creates a cacheNodes with the specified create parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param resource: Resource create parameters. Is one of the following types: - CacheNodePreviewResource, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource or JSON or IO[bytes] - :return: An instance of LROPoller that returns CacheNodePreviewResource. The - CacheNodePreviewResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :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.CacheNodePreviewResource] = 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._createor_update_initial( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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.CacheNodePreviewResource, 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.CacheNodePreviewResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CacheNodePreviewResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> None: - """Deletes an existing cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_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_cache_nodes_operations_delete_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: _models.ConnectedCachePatchResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - customer_resource_name: str, - properties: Union[_models.ConnectedCachePatchResource, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.CacheNodePreviewResource: - """updates an existing Cache Node. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param customer_resource_name: Name of the Customer resource. Required. - :type customer_resource_name: str - :param properties: The resource properties to be updated. Is one of the following types: - ConnectedCachePatchResource, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.connectedcache.models.ConnectedCachePatchResource or JSON or - IO[bytes] - :return: CacheNodePreviewResource. The CacheNodePreviewResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.CacheNodePreviewResource - :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)) - cls: ClsType[_models.CacheNodePreviewResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_cache_nodes_operations_update_request( - resource_group_name=resource_group_name, - customer_resource_name=customer_resource_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) - - _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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.CacheNodePreviewResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.CacheNodePreviewResource"]: - """Retrieves the properties of all ConnectedCache. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of CacheNodePreviewResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - cls: ClsType[List[_models.CacheNodePreviewResource]] = kwargs.pop("cls", None) - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_request( # pylint: disable=name-too-long + resource_group_name: str, + customer_resource_name: str, + cache_node_resource_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-30-preview")) + accept = _headers.pop("Accept", "application/json") - _request = build_cache_nodes_operations_list_by_resource_group_request( - resource_group_name=resource_group_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) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeTlsCertificateHistory" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "customerResourceName": _SERIALIZER.url("customer_resource_name", customer_resource_name, "str"), + "cacheNodeResourceName": _SERIALIZER.url("cache_node_resource_name", cache_node_resource_name, "str"), + } - 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) + _url: str = _url.format(**path_format_arguments) # type: ignore - return _request + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CacheNodePreviewResource], deserialized["value"]) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - def get_next(next_link=None): - _request = prepare_request(next_link) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - _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 = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - return pipeline_response + Instead, you should access the following operations through + :class:`~azure.mgmt.connectedcache.ConnectedCacheMgmtClient`'s + :attr:`operations` attribute. + """ - return ItemPaged(get_next, extract_data) + 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: ConnectedCacheMgmtClientConfiguration = 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 list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CacheNodePreviewResource"]: - """Retrieves the properties of all ConnectedCaches. + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. - :return: An iterator like instance of CacheNodePreviewResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.CacheNodePreviewResource] + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.connectedcache.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.CacheNodePreviewResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2674,8 +1021,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CacheNodePrev def prepare_request(next_link=None): if not next_link: - _request = build_cache_nodes_operations_list_by_subscription_request( - subscription_id=self._config.subscription_id, + _request = build_operations_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -2711,7 +1057,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CacheNodePreviewResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2727,7 +1073,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2745,12 +1094,12 @@ class IspCustomersOperations: :attr:`isp_customers` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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, resource_group_name: str, customer_resource_name: str, **kwargs: Any) -> _models.IspCustomerResource: @@ -2805,7 +1154,10 @@ def get(self, resource_group_name: str, customer_resource_name: str, **kwargs: A except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -2874,7 +1226,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3204,7 +1559,10 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -3257,7 +1615,10 @@ def _delete_initial(self, resource_group_name: str, customer_resource_name: str, except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3332,7 +1693,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.IspCustomerResource"]: + ) -> ItemPaged["_models.IspCustomerResource"]: """This api gets the information about all ispCustomer resources under the given subscription and resource group. @@ -3397,7 +1758,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3413,7 +1774,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3421,7 +1785,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.IspCustomerResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.IspCustomerResource"]: """This api gets information about all ispCustomer resources under the given subscription. :return: An iterator like instance of IspCustomerResource @@ -3481,7 +1845,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3497,7 +1861,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3515,12 +1882,12 @@ class IspCacheNodesOperationsOperations: :attr:`isp_cache_nodes_operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -3580,7 +1947,10 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -3651,7 +2021,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4007,7 +2380,10 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4063,7 +2439,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4143,7 +2522,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_isp_customer_resource( self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> Iterable["_models.IspCacheNodeResource"]: + ) -> ItemPaged["_models.IspCacheNodeResource"]: """This api retrieves information about all ispCacheNode resources under the given subscription and resource group. @@ -4211,34 +2590,201 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IspCacheNodeResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.IspCacheNodeResource], 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) + 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 + def get_bgp_cidrs( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeBgpCidrDetails: + """This api gets ispCacheNode resource information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeBgpCidrDetails. The MccCacheNodeBgpCidrDetails is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails + :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.MccCacheNodeBgpCidrDetails] = kwargs.pop("cls", None) + + _request = build_isp_cache_nodes_operations_get_bgp_cidrs_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeBgpCidrDetails, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_cache_node_install_details( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeInstallDetails: + """This api gets secrets of the ispCacheNode resource install details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeInstallDetails. The MccCacheNodeInstallDetails is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails + :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.MccCacheNodeInstallDetails] = kwargs.pop("cls", None) + + _request = build_isp_cache_nodes_operations_get_cache_node_install_details_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.MccCacheNodeInstallDetails, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def get_bgp_cidrs( + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + def get_cache_node_auto_update_history( self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any - ) -> _models.MccCacheNodeBgpCidrDetails: - """This api gets ispCacheNode resource information. + ) -> _models.MccCacheNodeAutoUpdateHistory: + """This api gets ispCacheNode resource auto update histrory information. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4247,9 +2793,9 @@ def get_bgp_cidrs( :type customer_resource_name: str :param cache_node_resource_name: Name of the ConnectedCache resource. Required. :type cache_node_resource_name: str - :return: MccCacheNodeBgpCidrDetails. The MccCacheNodeBgpCidrDetails is compatible with + :return: MccCacheNodeAutoUpdateHistory. The MccCacheNodeAutoUpdateHistory is compatible with MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeBgpCidrDetails + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4263,9 +2809,9 @@ def get_bgp_cidrs( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.MccCacheNodeBgpCidrDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.MccCacheNodeAutoUpdateHistory] = kwargs.pop("cls", None) - _request = build_isp_cache_nodes_operations_get_bgp_cidrs_request( + _request = build_isp_cache_nodes_operations_get_cache_node_auto_update_history_request( resource_group_name=resource_group_name, customer_resource_name=customer_resource_name, cache_node_resource_name=cache_node_resource_name, @@ -4293,13 +2839,16 @@ def get_bgp_cidrs( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.MccCacheNodeBgpCidrDetails, response.json()) + deserialized = _deserialize(_models.MccCacheNodeAutoUpdateHistory, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4307,10 +2856,24 @@ def get_bgp_cidrs( return deserialized # type: ignore @distributed_trace - def get_cache_node_install_details( + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + def get_cache_node_mcc_issue_details_history( self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any - ) -> _models.MccCacheNodeInstallDetails: - """This api gets secrets of the ispCacheNode resource install details. + ) -> _models.MccCacheNodeIssueHistory: + """This api gets ispCacheNode resource issues details histrory information. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4319,9 +2882,9 @@ def get_cache_node_install_details( :type customer_resource_name: str :param cache_node_resource_name: Name of the ConnectedCache resource. Required. :type cache_node_resource_name: str - :return: MccCacheNodeInstallDetails. The MccCacheNodeInstallDetails is compatible with + :return: MccCacheNodeIssueHistory. The MccCacheNodeIssueHistory is compatible with MutableMapping - :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeInstallDetails + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeIssueHistory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4335,9 +2898,9 @@ def get_cache_node_install_details( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.MccCacheNodeInstallDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.MccCacheNodeIssueHistory] = kwargs.pop("cls", None) - _request = build_isp_cache_nodes_operations_get_cache_node_install_details_request( + _request = build_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( resource_group_name=resource_group_name, customer_resource_name=customer_resource_name, cache_node_resource_name=cache_node_resource_name, @@ -4365,13 +2928,16 @@ def get_cache_node_install_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.MccCacheNodeInstallDetails, response.json()) + deserialized = _deserialize(_models.MccCacheNodeIssueHistory, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4389,12 +2955,12 @@ class EnterpriseMccCustomersOperations: :attr:`enterprise_mcc_customers` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -4452,7 +3018,10 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4521,7 +3090,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4860,7 +3432,10 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -4913,7 +3488,10 @@ def _delete_initial(self, resource_group_name: str, customer_resource_name: str, except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4988,7 +3566,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.EnterpriseMccCustomerResource"]: + ) -> ItemPaged["_models.EnterpriseMccCustomerResource"]: """This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. @@ -5054,7 +3632,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5070,7 +3648,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5078,7 +3659,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.EnterpriseMccCustomerResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.EnterpriseMccCustomerResource"]: """This api gets information about all enterpriseMccCustomer resources under the given subscription. @@ -5140,7 +3721,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCustomerResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5156,7 +3737,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5174,12 +3758,12 @@ class EnterpriseMccCacheNodesOperationsOperations: # pylint: disable=name-too-l :attr:`enterprise_mcc_cache_nodes_operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ConnectedCacheMgmtClientConfiguration = 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( @@ -5240,7 +3824,10 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -5311,7 +3898,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5676,7 +4266,10 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -5732,7 +4325,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -5812,7 +4408,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_enterprise_mcc_customer_resource( self, resource_group_name: str, customer_resource_name: str, **kwargs: Any - ) -> Iterable["_models.EnterpriseMccCacheNodeResource"]: + ) -> ItemPaged["_models.EnterpriseMccCacheNodeResource"]: """This api retrieves information about all ispCacheNode resources under the given subscription and resource group. @@ -5881,7 +4477,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EnterpriseMccCacheNodeResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.EnterpriseMccCacheNodeResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5897,7 +4493,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 = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -5963,7 +4562,10 @@ def get_cache_node_install_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -5975,3 +4577,270 @@ def get_cache_node_install_details( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + def get_cache_node_auto_update_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeAutoUpdateHistory: + """This api gets ispCacheNode resource auto update histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeAutoUpdateHistory. The MccCacheNodeAutoUpdateHistory is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeAutoUpdateHistory + :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.MccCacheNodeAutoUpdateHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeAutoUpdateHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + def get_cache_node_mcc_issue_details_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeIssueHistory: + """This api gets ispCacheNode resource issues details histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeIssueHistory. The MccCacheNodeIssueHistory is compatible with + MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeIssueHistory + :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.MccCacheNodeIssueHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeIssueHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-11-30-preview", + params_added_on={ + "2024-11-30-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "customer_resource_name", + "cache_node_resource_name", + "accept", + ] + }, + api_versions_list=["2024-11-30-preview"], + ) + def get_cache_node_tls_certificate_history( + self, resource_group_name: str, customer_resource_name: str, cache_node_resource_name: str, **kwargs: Any + ) -> _models.MccCacheNodeTlsCertificateHistory: + """This api gets ispCacheNode resource tls certificate histrory information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param customer_resource_name: Name of the Customer resource. Required. + :type customer_resource_name: str + :param cache_node_resource_name: Name of the ConnectedCache resource. Required. + :type cache_node_resource_name: str + :return: MccCacheNodeTlsCertificateHistory. The MccCacheNodeTlsCertificateHistory is compatible + with MutableMapping + :rtype: ~azure.mgmt.connectedcache.models.MccCacheNodeTlsCertificateHistory + :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.MccCacheNodeTlsCertificateHistory] = kwargs.pop("cls", None) + + _request = build_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_request( + resource_group_name=resource_group_name, + customer_resource_name=customer_resource_name, + cache_node_resource_name=cache_node_resource_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 = 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() + else: + deserialized = _deserialize(_models.MccCacheNodeTlsCertificateHistory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_patch.py b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_patch.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/azure/mgmt/connectedcache/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_createor_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_createor_update_maximum_set_gen.py deleted file mode 100644 index ad8a69e5878f..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_createor_update_maximum_set_gen.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python cache_nodes_operations_createor_update_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_nodes_operations.begin_createor_update( - resource_group_name="rgConnectedCache", - customer_resource_name="lwrsyhvfpcfrwrim", - resource={ - "location": "westus", - "properties": { - "error": {}, - "statusCode": "movtzupooyhdqk", - "statusDetails": "quuziibkwtgf", - "statusText": "bjnsrpzaofjntleoesjwammgbi", - }, - "tags": {"key8256": "oreqiywrjkmate"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_CreateorUpdate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_delete_maximum_set_gen.py deleted file mode 100644 index af378ba9a96c..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_delete_maximum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python cache_nodes_operations_delete_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.cache_nodes_operations.delete( - resource_group_name="rgConnectedCache", - customer_resource_name="otvtvhmovthjwzjzbsqkbnmpcmmeianpqxmmaspvdczmrenquxigrtuarmlcmvsnaclhcbw", - ) - - -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_resource_group_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_resource_group_maximum_set_gen.py deleted file mode 100644 index d967f74578a6..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_resource_group_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python cache_nodes_operations_list_by_resource_group_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_nodes_operations.list_by_resource_group( - resource_group_name="rgConnectedCache", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListByResourceGroup_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_subscription_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_subscription_maximum_set_gen.py deleted file mode 100644 index 684f0a803b31..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_list_by_subscription_maximum_set_gen.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python cache_nodes_operations_list_by_subscription_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cache_nodes_operations.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_ListBySubscription_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_create_or_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_create_or_update_maximum_set_gen.py deleted file mode 100644 index 17194e22d465..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_create_or_update_maximum_set_gen.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python enterprise_customer_operations_create_or_update_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.enterprise_customer_operations.begin_create_or_update( - resource_group_name="rgConnectedCache", - customer_resource_name="l", - resource={ - "location": "zdzhhkjyogrqxwihkifnmeyhwpujbr", - "properties": { - "error": {}, - "statusCode": "oldkroffqtkryqffpsi", - "statusDetails": "lhwvcz", - "statusText": "bs", - }, - "tags": {"key4215": "zjbszvlzf"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_CreateOrUpdate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_delete_maximum_set_gen.py deleted file mode 100644 index 991c0586a925..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_delete_maximum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python enterprise_customer_operations_delete_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.enterprise_customer_operations.delete( - resource_group_name="rgConnectedCache", - customer_resource_name="jeubxmhiaihcusgnahblvvckbdcetacvqgwbohlrqucodtlwuyefpejskvamgrdnwgucziodcfpjhqy", - ) - - -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_resource_group_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_resource_group_maximum_set_gen.py deleted file mode 100644 index bf42aa1ac59c..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_resource_group_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python enterprise_customer_operations_list_by_resource_group_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.enterprise_customer_operations.list_by_resource_group( - resource_group_name="rgConnectedCache", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListByResourceGroup_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_subscription_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_subscription_maximum_set_gen.py deleted file mode 100644 index 387f04941852..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_list_by_subscription_maximum_set_gen.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-connectedcache -# USAGE - python enterprise_customer_operations_list_by_subscription_maximum_set_gen.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 = ConnectedCacheMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.enterprise_customer_operations.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_ListBySubscription_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_create_or_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_create_or_update_maximum_set_gen.py index 394dc09d0306..a39bc5c6f53e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_create_or_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_create_or_update_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -53,7 +54,6 @@ def main(): "optionalProperty3": "fpnycrbagptsujiotnjfuhlm", "optionalProperty4": "gesqugrxvhxlxxyvatgrautxwlmxsf", "optionalProperty5": "zknjgzpaqtvdqjydd", - "proxyUrl": "ihkzxlzvpcywtzrogupqozkdud", "proxyUrlConfiguration": {"proxyUrl": "hplstyg"}, }, "cacheNode": { @@ -82,6 +82,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_delete_maximum_set_gen.py index bb6e0fb686f2..2454d2c25d74 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_delete_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py similarity index 73% rename from sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_update_maximum_set_gen.py rename to sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py index 7ecb4e9e814d..e2e5ceaa1d8f 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-connectedcache # USAGE - python enterprise_customer_operations_update_maximum_set_gen.py + python enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.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, @@ -30,14 +31,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.enterprise_customer_operations.update( + response = client.enterprise_mcc_cache_nodes_operations.get_cache_node_auto_update_history( resource_group_name="rgConnectedCache", - customer_resource_name="MCCTPTest2", - properties={"tags": {"key1653": "nzjczrhclhkndesgy"}}, + customer_resource_name="MccRPTest1", + cache_node_resource_name="MCCCachenode1", ) print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeAutoUpdateHistory_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py index b04514f97249..14e1e4b2f34a 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py new file mode 100644 index 000000000000..573f080ee833 --- /dev/null +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.connectedcache import ConnectedCacheMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-connectedcache +# USAGE + python enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.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 = ConnectedCacheMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.enterprise_mcc_cache_nodes_operations.get_cache_node_mcc_issue_details_history( + resource_group_name="rgConnectedCache", + customer_resource_name="MccRPTest1", + cache_node_resource_name="MCCCachenode1", + ) + print(response) + + +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_maximum_set_gen.py similarity index 73% rename from sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_update_maximum_set_gen.py rename to sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_maximum_set_gen.py index a394f6a6cb4d..b1b1d5ea3a5f 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-connectedcache # USAGE - python cache_nodes_operations_update_maximum_set_gen.py + python enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history_maximum_set_gen.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, @@ -30,14 +31,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.cache_nodes_operations.update( + response = client.enterprise_mcc_cache_nodes_operations.get_cache_node_tls_certificate_history( resource_group_name="rgConnectedCache", - customer_resource_name="wlrwpdbcv", - properties={"tags": {"key5032": "esiuyjbpcwkpqriqiqztxuocv"}}, + customer_resource_name="MccRPTest1", + cache_node_resource_name="MCCCachenode1", ) print(response) -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeTlsCertificateHistory_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_maximum_set_gen.py index d3ac6034492d..ed58b95629d5 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_maximum_set_gen.py index 09ed1d907f3d..d6b732cf8976 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_list_by_enterprise_mcc_customer_resource_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_update_maximum_set_gen.py index 2d9da2da2c5a..9ec8c88d9790 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_cache_nodes_operations_update_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_create_or_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_create_or_update_maximum_set_gen.py index 7d7310c8fbec..df54d1135653 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_create_or_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_create_or_update_maximum_set_gen.py @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_delete_maximum_set_gen.py index 6594e1100dd5..49ecb223ad8e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_delete_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_get_maximum_set_gen.py index 6f8ea37e637f..c12c1190c21b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_resource_group_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_resource_group_maximum_set_gen.py index 4a65329eb4b1..593917b8ce4f 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_resource_group_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_subscription_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_subscription_maximum_set_gen.py index 38dd3071d93f..9eb0748830e6 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_subscription_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_update_maximum_set_gen.py index 22cd230361d2..4ee5e835ca41 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_mcc_customers_update_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_create_or_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_create_or_update_maximum_set_gen.py index 3b2e8a4ae419..de35f53810e1 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_create_or_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_create_or_update_maximum_set_gen.py @@ -48,7 +48,6 @@ def main(): "optionalProperty3": "bxkoxq", "optionalProperty4": "pqlkcekupusoc", "optionalProperty5": "nyvvmrjigqdufzjdvazdca", - "proxyUrl": "qhux", "proxyUrlConfiguration": {"proxyUrl": "hplstyg"}, }, "cacheNode": { @@ -77,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_delete_maximum_set_gen.py index 0daa25a795f7..d6822d634ab7 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_delete_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_bgp_cidrs_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_bgp_cidrs_maximum_set_gen.py index 0af1ed06eba1..37587b0066d8 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_bgp_cidrs_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_bgp_cidrs_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py similarity index 77% rename from sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_get_maximum_set_gen.py rename to sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py index 457e23e0e97a..184e98a71182 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/enterprise_customer_operations_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-connectedcache # USAGE - python enterprise_customer_operations_get_maximum_set_gen.py + python isp_cache_nodes_operations_get_cache_node_auto_update_history_maximum_set_gen.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, @@ -30,13 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.enterprise_customer_operations.get( + response = client.isp_cache_nodes_operations.get_cache_node_auto_update_history( resource_group_name="rgConnectedCache", - customer_resource_name="MCCTPTest2", + customer_resource_name="MccRPTest1", + cache_node_resource_name="MCCCachenode1", ) print(response) -# x-ms-original-file: 2023-05-01-preview/EnterpriseCustomerOperations_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeAutoUpdateHistory_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py index 2febbb1f03d8..67a3483be6ef 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_install_details_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py similarity index 76% rename from sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_get_maximum_set_gen.py rename to sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py index 46332f007190..e7517d93ec3e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/cache_nodes_operations_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-connectedcache # USAGE - python cache_nodes_operations_get_maximum_set_gen.py + python isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history_maximum_set_gen.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, @@ -30,13 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.cache_nodes_operations.get( + response = client.isp_cache_nodes_operations.get_cache_node_mcc_issue_details_history( resource_group_name="rgConnectedCache", - customer_resource_name="nqoxkgorhuzbhjwcegymzqbeydzjupemekt", + customer_resource_name="MccRPTest1", + cache_node_resource_name="MCCCachenode1", ) print(response) -# x-ms-original-file: 2023-05-01-preview/CacheNodesOperations_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_maximum_set_gen.py index 609344f3d234..b90d51bae540 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_list_by_isp_customer_resource_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_list_by_isp_customer_resource_maximum_set_gen.py index c40449e3520d..29cc10dce920 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_list_by_isp_customer_resource_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_list_by_isp_customer_resource_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_update_maximum_set_gen.py index f500bb35ee3d..e76d8442ff27 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_cache_nodes_operations_update_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_create_or_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_create_or_update_maximum_set_gen.py index dabd00da496a..09a90edaf509 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_create_or_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_create_or_update_maximum_set_gen.py @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_delete_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_delete_maximum_set_gen.py index 7e4eeee02508..1152c8491bc6 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_delete_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2023-05-01-preview/IspCustomers_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_get_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_get_maximum_set_gen.py index e0ba1a6bab60..bb1f4bf25fc1 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_get_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCustomers_Get_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_resource_group_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_resource_group_maximum_set_gen.py index 8fc639e62160..9d2c26c7ec26 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_resource_group_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_subscription_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_subscription_maximum_set_gen.py index 0eb47cd8a845..72eb5afc174e 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_subscription_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_update_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_update_maximum_set_gen.py index ba5cda75c10c..72f4af0e6199 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_update_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/isp_customers_update_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2023-05-01-preview/IspCustomers_Update_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/IspCustomers_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/operations_list_maximum_set_gen.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/operations_list_maximum_set_gen.py index 3f4fa2c8f486..83b663143f54 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_samples/operations_list_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2023-05-01-preview/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2024-11-30-preview/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations.py deleted file mode 100644 index 1ec5b5b06089..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -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 TestConnectedCacheMgmtCacheNodesOperationsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ConnectedCacheMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cache_nodes_operations_get(self, resource_group): - response = self.client.cache_nodes_operations.get( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cache_nodes_operations_begin_createor_update(self, resource_group): - response = self.client.cache_nodes_operations.begin_createor_update( - resource_group_name=resource_group.name, - customer_resource_name="str", - resource={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "provisioningState": "str", - "status": "str", - "statusCode": "str", - "statusDetails": "str", - "statusText": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "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_cache_nodes_operations_delete(self, resource_group): - response = self.client.cache_nodes_operations.delete( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cache_nodes_operations_update(self, resource_group): - response = self.client.cache_nodes_operations.update( - resource_group_name=resource_group.name, - customer_resource_name="str", - properties={"tags": {"str": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cache_nodes_operations_list_by_resource_group(self, resource_group): - response = self.client.cache_nodes_operations.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cache_nodes_operations_list_by_subscription(self, resource_group): - response = self.client.cache_nodes_operations.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations_async.py deleted file mode 100644 index 4a97d82c2ed1..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_cache_nodes_operations_operations_async.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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.connectedcache.aio import ConnectedCacheMgmtClient - -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 TestConnectedCacheMgmtCacheNodesOperationsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ConnectedCacheMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cache_nodes_operations_get(self, resource_group): - response = await self.client.cache_nodes_operations.get( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cache_nodes_operations_begin_createor_update(self, resource_group): - response = await ( - await self.client.cache_nodes_operations.begin_createor_update( - resource_group_name=resource_group.name, - customer_resource_name="str", - resource={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "provisioningState": "str", - "status": "str", - "statusCode": "str", - "statusDetails": "str", - "statusText": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "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_cache_nodes_operations_delete(self, resource_group): - response = await self.client.cache_nodes_operations.delete( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cache_nodes_operations_update(self, resource_group): - response = await self.client.cache_nodes_operations.update( - resource_group_name=resource_group.name, - customer_resource_name="str", - properties={"tags": {"str": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cache_nodes_operations_list_by_resource_group(self, resource_group): - response = self.client.cache_nodes_operations.list_by_resource_group( - resource_group_name=resource_group.name, - ) - 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_cache_nodes_operations_list_by_subscription(self, resource_group): - response = self.client.cache_nodes_operations.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations.py deleted file mode 100644 index 49b9124adc67..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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.connectedcache import ConnectedCacheMgmtClient - -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 TestConnectedCacheMgmtEnterpriseCustomerOperationsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ConnectedCacheMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_enterprise_customer_operations_get(self, resource_group): - response = self.client.enterprise_customer_operations.get( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_enterprise_customer_operations_begin_create_or_update(self, resource_group): - response = self.client.enterprise_customer_operations.begin_create_or_update( - resource_group_name=resource_group.name, - customer_resource_name="str", - resource={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "provisioningState": "str", - "status": "str", - "statusCode": "str", - "statusDetails": "str", - "statusText": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "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_enterprise_customer_operations_update(self, resource_group): - response = self.client.enterprise_customer_operations.update( - resource_group_name=resource_group.name, - customer_resource_name="str", - properties={"tags": {"str": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_enterprise_customer_operations_delete(self, resource_group): - response = self.client.enterprise_customer_operations.delete( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_enterprise_customer_operations_list_by_resource_group(self, resource_group): - response = self.client.enterprise_customer_operations.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_enterprise_customer_operations_list_by_subscription(self, resource_group): - response = self.client.enterprise_customer_operations.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations_async.py deleted file mode 100644 index a3b04affda09..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_customer_operations_operations_async.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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.connectedcache.aio import ConnectedCacheMgmtClient - -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 TestConnectedCacheMgmtEnterpriseCustomerOperationsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ConnectedCacheMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_enterprise_customer_operations_get(self, resource_group): - response = await self.client.enterprise_customer_operations.get( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_enterprise_customer_operations_begin_create_or_update(self, resource_group): - response = await ( - await self.client.enterprise_customer_operations.begin_create_or_update( - resource_group_name=resource_group.name, - customer_resource_name="str", - resource={ - "location": "str", - "id": "str", - "name": "str", - "properties": { - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "provisioningState": "str", - "status": "str", - "statusCode": "str", - "statusDetails": "str", - "statusText": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "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_enterprise_customer_operations_update(self, resource_group): - response = await self.client.enterprise_customer_operations.update( - resource_group_name=resource_group.name, - customer_resource_name="str", - properties={"tags": {"str": "str"}}, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_enterprise_customer_operations_delete(self, resource_group): - response = await self.client.enterprise_customer_operations.delete( - resource_group_name=resource_group.name, - customer_resource_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_enterprise_customer_operations_list_by_resource_group(self, resource_group): - response = self.client.enterprise_customer_operations.list_by_resource_group( - resource_group_name=resource_group.name, - ) - 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_enterprise_customer_operations_list_by_subscription(self, resource_group): - response = self.client.enterprise_customer_operations.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations.py index 464cf4083c8a..037cd7f7c059 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations.py @@ -59,11 +59,42 @@ def test_enterprise_mcc_cache_nodes_operations_begin_create_or_update(self, reso "cacheNodeState": 0, "cacheNodeStateDetailedText": "str", "cacheNodeStateShortText": "str", + "creationMethod": 0, + "currentTlsCertificate": { + "actionRequired": "str", + "certificateFileName": "str", + "expiryDate": "2020-02-20 00:00:00", + "notBeforeDate": "2020-02-20 00:00:00", + "subject": "str", + "subjectAltName": "str", + "thumbprint": "str", + }, "driveConfiguration": [ {"cacheNumber": 0, "nginxMapping": "str", "physicalPath": "str", "sizeInGb": 0} ], "isProvisioned": bool, "isProxyRequired": "str", + "issuesCount": 0, + "issuesList": ["str"], + "lastAutoUpdateInfo": { + "autoUpdateLastAppliedStatus": 0, + "autoUpdateLastAppliedStatusDetailedText": "str", + "autoUpdateLastAppliedStatusText": "str", + "autoUpdateRingType": 0, + "createdDateTimeUtc": "2020-02-20 00:00:00", + "imageUriBeforeUpdate": "str", + "imageUriTargeted": "str", + "imageUriTerminal": "str", + "movedToTerminalStateDateTime": "2020-02-20 00:00:00", + "planChangeLogText": "str", + "planId": 0, + "ruleRequestedDay": 0, + "ruleRequestedHour": "str", + "ruleRequestedMinute": "str", + "ruleRequestedWeek": 0, + "timeToGoLiveDateTime": "str", + "updatedRegistryDateTimeUtc": "2020-02-20 00:00:00", + }, "optionalProperty1": "str", "optionalProperty2": "str", "optionalProperty3": "str", @@ -71,9 +102,8 @@ def test_enterprise_mcc_cache_nodes_operations_begin_create_or_update(self, reso "optionalProperty5": "str", "osType": "str", "productVersion": "str", - "proxyUrl": "str", "proxyUrlConfiguration": {"proxyUrl": "str"}, - "updateCycleType": "str", + "tlsStatus": "str", "updateInfoDetails": "str", "updateRequestedDateTime": "2020-02-20 00:00:00", }, @@ -207,3 +237,39 @@ def test_enterprise_mcc_cache_nodes_operations_get_cache_node_install_details(se # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history(self, resource_group): + response = self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_auto_update_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history(self, resource_group): + response = self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_mcc_issue_details_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history(self, resource_group): + response = self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_tls_certificate_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations_async.py index 4539c55ff563..9c9e03acaf5b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations_async.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_cache_nodes_operations_operations_async.py @@ -61,11 +61,42 @@ async def test_enterprise_mcc_cache_nodes_operations_begin_create_or_update(self "cacheNodeState": 0, "cacheNodeStateDetailedText": "str", "cacheNodeStateShortText": "str", + "creationMethod": 0, + "currentTlsCertificate": { + "actionRequired": "str", + "certificateFileName": "str", + "expiryDate": "2020-02-20 00:00:00", + "notBeforeDate": "2020-02-20 00:00:00", + "subject": "str", + "subjectAltName": "str", + "thumbprint": "str", + }, "driveConfiguration": [ {"cacheNumber": 0, "nginxMapping": "str", "physicalPath": "str", "sizeInGb": 0} ], "isProvisioned": bool, "isProxyRequired": "str", + "issuesCount": 0, + "issuesList": ["str"], + "lastAutoUpdateInfo": { + "autoUpdateLastAppliedStatus": 0, + "autoUpdateLastAppliedStatusDetailedText": "str", + "autoUpdateLastAppliedStatusText": "str", + "autoUpdateRingType": 0, + "createdDateTimeUtc": "2020-02-20 00:00:00", + "imageUriBeforeUpdate": "str", + "imageUriTargeted": "str", + "imageUriTerminal": "str", + "movedToTerminalStateDateTime": "2020-02-20 00:00:00", + "planChangeLogText": "str", + "planId": 0, + "ruleRequestedDay": 0, + "ruleRequestedHour": "str", + "ruleRequestedMinute": "str", + "ruleRequestedWeek": 0, + "timeToGoLiveDateTime": "str", + "updatedRegistryDateTimeUtc": "2020-02-20 00:00:00", + }, "optionalProperty1": "str", "optionalProperty2": "str", "optionalProperty3": "str", @@ -73,9 +104,8 @@ async def test_enterprise_mcc_cache_nodes_operations_begin_create_or_update(self "optionalProperty5": "str", "osType": "str", "productVersion": "str", - "proxyUrl": "str", "proxyUrlConfiguration": {"proxyUrl": "str"}, - "updateCycleType": "str", + "tlsStatus": "str", "updateInfoDetails": "str", "updateRequestedDateTime": "2020-02-20 00:00:00", }, @@ -212,3 +242,39 @@ async def test_enterprise_mcc_cache_nodes_operations_get_cache_node_install_deta # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_enterprise_mcc_cache_nodes_operations_get_cache_node_auto_update_history(self, resource_group): + response = await self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_auto_update_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_enterprise_mcc_cache_nodes_operations_get_cache_node_mcc_issue_details_history(self, resource_group): + response = await self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_mcc_issue_details_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_enterprise_mcc_cache_nodes_operations_get_cache_node_tls_certificate_history(self, resource_group): + response = await self.client.enterprise_mcc_cache_nodes_operations.get_cache_node_tls_certificate_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations.py index 6b809cf9f2cd..a37b2ad55c8a 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations.py @@ -66,7 +66,6 @@ def test_enterprise_mcc_customers_begin_create_or_update(self, resource_group): "optionalProperty4": "str", "optionalProperty5": "str", "peeringDbLastUpdateDate": "2020-02-20 00:00:00", - "peeringDbLastUpdateTime": "2020-02-20 00:00:00", "signupPhaseStatusCode": 0, "signupPhaseStatusText": "str", "signupStatus": bool, diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations_async.py index 5b6929a4461d..d179eeaa6602 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations_async.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_enterprise_mcc_customers_operations_async.py @@ -68,7 +68,6 @@ async def test_enterprise_mcc_customers_begin_create_or_update(self, resource_gr "optionalProperty4": "str", "optionalProperty5": "str", "peeringDbLastUpdateDate": "2020-02-20 00:00:00", - "peeringDbLastUpdateTime": "2020-02-20 00:00:00", "signupPhaseStatusCode": 0, "signupPhaseStatusText": "str", "signupStatus": bool, diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations.py index a3a862cf67de..1a4599621200 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations.py @@ -59,11 +59,42 @@ def test_isp_cache_nodes_operations_begin_create_or_update(self, resource_group) "cacheNodeState": 0, "cacheNodeStateDetailedText": "str", "cacheNodeStateShortText": "str", + "creationMethod": 0, + "currentTlsCertificate": { + "actionRequired": "str", + "certificateFileName": "str", + "expiryDate": "2020-02-20 00:00:00", + "notBeforeDate": "2020-02-20 00:00:00", + "subject": "str", + "subjectAltName": "str", + "thumbprint": "str", + }, "driveConfiguration": [ {"cacheNumber": 0, "nginxMapping": "str", "physicalPath": "str", "sizeInGb": 0} ], "isProvisioned": bool, "isProxyRequired": "str", + "issuesCount": 0, + "issuesList": ["str"], + "lastAutoUpdateInfo": { + "autoUpdateLastAppliedStatus": 0, + "autoUpdateLastAppliedStatusDetailedText": "str", + "autoUpdateLastAppliedStatusText": "str", + "autoUpdateRingType": 0, + "createdDateTimeUtc": "2020-02-20 00:00:00", + "imageUriBeforeUpdate": "str", + "imageUriTargeted": "str", + "imageUriTerminal": "str", + "movedToTerminalStateDateTime": "2020-02-20 00:00:00", + "planChangeLogText": "str", + "planId": 0, + "ruleRequestedDay": 0, + "ruleRequestedHour": "str", + "ruleRequestedMinute": "str", + "ruleRequestedWeek": 0, + "timeToGoLiveDateTime": "str", + "updatedRegistryDateTimeUtc": "2020-02-20 00:00:00", + }, "optionalProperty1": "str", "optionalProperty2": "str", "optionalProperty3": "str", @@ -71,9 +102,8 @@ def test_isp_cache_nodes_operations_begin_create_or_update(self, resource_group) "optionalProperty5": "str", "osType": "str", "productVersion": "str", - "proxyUrl": "str", "proxyUrlConfiguration": {"proxyUrl": "str"}, - "updateCycleType": "str", + "tlsStatus": "str", "updateInfoDetails": "str", "updateRequestedDateTime": "2020-02-20 00:00:00", }, @@ -219,3 +249,27 @@ def test_isp_cache_nodes_operations_get_cache_node_install_details(self, resourc # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_isp_cache_nodes_operations_get_cache_node_auto_update_history(self, resource_group): + response = self.client.isp_cache_nodes_operations.get_cache_node_auto_update_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history(self, resource_group): + response = self.client.isp_cache_nodes_operations.get_cache_node_mcc_issue_details_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations_async.py index ca89df5abc87..32162cb04965 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations_async.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_cache_nodes_operations_operations_async.py @@ -61,11 +61,42 @@ async def test_isp_cache_nodes_operations_begin_create_or_update(self, resource_ "cacheNodeState": 0, "cacheNodeStateDetailedText": "str", "cacheNodeStateShortText": "str", + "creationMethod": 0, + "currentTlsCertificate": { + "actionRequired": "str", + "certificateFileName": "str", + "expiryDate": "2020-02-20 00:00:00", + "notBeforeDate": "2020-02-20 00:00:00", + "subject": "str", + "subjectAltName": "str", + "thumbprint": "str", + }, "driveConfiguration": [ {"cacheNumber": 0, "nginxMapping": "str", "physicalPath": "str", "sizeInGb": 0} ], "isProvisioned": bool, "isProxyRequired": "str", + "issuesCount": 0, + "issuesList": ["str"], + "lastAutoUpdateInfo": { + "autoUpdateLastAppliedStatus": 0, + "autoUpdateLastAppliedStatusDetailedText": "str", + "autoUpdateLastAppliedStatusText": "str", + "autoUpdateRingType": 0, + "createdDateTimeUtc": "2020-02-20 00:00:00", + "imageUriBeforeUpdate": "str", + "imageUriTargeted": "str", + "imageUriTerminal": "str", + "movedToTerminalStateDateTime": "2020-02-20 00:00:00", + "planChangeLogText": "str", + "planId": 0, + "ruleRequestedDay": 0, + "ruleRequestedHour": "str", + "ruleRequestedMinute": "str", + "ruleRequestedWeek": 0, + "timeToGoLiveDateTime": "str", + "updatedRegistryDateTimeUtc": "2020-02-20 00:00:00", + }, "optionalProperty1": "str", "optionalProperty2": "str", "optionalProperty3": "str", @@ -73,9 +104,8 @@ async def test_isp_cache_nodes_operations_begin_create_or_update(self, resource_ "optionalProperty5": "str", "osType": "str", "productVersion": "str", - "proxyUrl": "str", "proxyUrlConfiguration": {"proxyUrl": "str"}, - "updateCycleType": "str", + "tlsStatus": "str", "updateInfoDetails": "str", "updateRequestedDateTime": "2020-02-20 00:00:00", }, @@ -224,3 +254,27 @@ async def test_isp_cache_nodes_operations_get_cache_node_install_details(self, r # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_isp_cache_nodes_operations_get_cache_node_auto_update_history(self, resource_group): + response = await self.client.isp_cache_nodes_operations.get_cache_node_auto_update_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_isp_cache_nodes_operations_get_cache_node_mcc_issue_details_history(self, resource_group): + response = await self.client.isp_cache_nodes_operations.get_cache_node_mcc_issue_details_history( + resource_group_name=resource_group.name, + customer_resource_name="str", + cache_node_resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations.py index e1c8bc1ee5c5..0400c18dfd33 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations.py @@ -66,7 +66,6 @@ def test_isp_customers_begin_create_or_update(self, resource_group): "optionalProperty4": "str", "optionalProperty5": "str", "peeringDbLastUpdateDate": "2020-02-20 00:00:00", - "peeringDbLastUpdateTime": "2020-02-20 00:00:00", "signupPhaseStatusCode": 0, "signupPhaseStatusText": "str", "signupStatus": bool, diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations_async.py b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations_async.py index 0a41224f5e47..fc2d6530532b 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations_async.py +++ b/sdk/connectedcache/azure-mgmt-connectedcache/generated_tests/test_connected_cache_mgmt_isp_customers_operations_async.py @@ -68,7 +68,6 @@ async def test_isp_customers_begin_create_or_update(self, resource_group): "optionalProperty4": "str", "optionalProperty5": "str", "peeringDbLastUpdateDate": "2020-02-20 00:00:00", - "peeringDbLastUpdateTime": "2020-02-20 00:00:00", "signupPhaseStatusCode": 0, "signupPhaseStatusText": "str", "signupStatus": bool, diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/pyproject.toml b/sdk/connectedcache/azure-mgmt-connectedcache/pyproject.toml index 540da07d41af..b8e1d72f82c1 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/pyproject.toml +++ b/sdk/connectedcache/azure-mgmt-connectedcache/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-connectedcache" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Connectedcache Management Client Library for Python" +license = "MIT" +classifiers = [ + "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", +] +requires-python = ">=3.9" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.connectedcache._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-connectedcache" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Connectedcache Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "ConnectedCacheMgmtClient" diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/sdk_packaging.toml b/sdk/connectedcache/azure-mgmt-connectedcache/sdk_packaging.toml deleted file mode 100644 index 9d7b71cb568a..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-connectedcache" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Connectedcache Management" -package_doc_id = "" -is_stable = false -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "ConnectedCacheMgmtClient" diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/setup.py b/sdk/connectedcache/azure-mgmt-connectedcache/setup.py deleted file mode 100644 index decc6c477e86..000000000000 --- a/sdk/connectedcache/azure-mgmt-connectedcache/setup.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-connectedcache" -PACKAGE_PPRINT_NAME = "Connectedcache Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/connectedcache/azure-mgmt-connectedcache/tsp-location.yaml b/sdk/connectedcache/azure-mgmt-connectedcache/tsp-location.yaml index 62929b944503..ae6822914b92 100644 --- a/sdk/connectedcache/azure-mgmt-connectedcache/tsp-location.yaml +++ b/sdk/connectedcache/azure-mgmt-connectedcache/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/connectedcache/ConnectedCache.Management -commit: 14f4f6b25fe74f90f4ee74fdac5cd7e05d419245 +commit: be46becafeb29aa993898709e35759d3643b2809 repo: Azure/azure-rest-api-specs additionalDirectories: