diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md index 0dca1c43c802f..e66d435bab859 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2022-04-07) +- Azure Resource Manager RedisEnterprise client library for Java. This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-04-21) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md index f24d3cf4d35ca..da72586167c05 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md @@ -2,7 +2,7 @@ Azure Resource Manager RedisEnterprise client library for Java. -This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-redisenterprise - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md new file mode 100644 index 0000000000000..b105a7c111102 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md @@ -0,0 +1,712 @@ +# Code snippets and samples + + +## Databases + +- [Create](#databases_create) +- [Delete](#databases_delete) +- [Export](#databases_export) +- [ForceUnlink](#databases_forceunlink) +- [Get](#databases_get) +- [ImportMethod](#databases_importmethod) +- [ListByCluster](#databases_listbycluster) +- [ListKeys](#databases_listkeys) +- [RegenerateKey](#databases_regeneratekey) +- [Update](#databases_update) + +## Operations + +- [List](#operations_list) + +## OperationsStatus + +- [Get](#operationsstatus_get) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByCluster](#privatelinkresources_listbycluster) + +## RedisEnterprise + +- [Create](#redisenterprise_create) +- [Delete](#redisenterprise_delete) +- [GetByResourceGroup](#redisenterprise_getbyresourcegroup) +- [List](#redisenterprise_list) +- [ListByResourceGroup](#redisenterprise_listbyresourcegroup) +- [Update](#redisenterprise_update) +### Databases_Create + +```java +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import com.azure.resourcemanager.redisenterprise.models.Module; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import java.util.Arrays; + +/** Samples for Databases Create. */ +public final class DatabasesCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesCreate( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .define("default") + .withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withAofEnabled(true).withAofFrequency(AofFrequency.ONES)) + .withModules( + Arrays + .asList( + new Module().withName("RedisBloom").withArgs("ERROR_RATE 0.00 INITIAL_SIZE 400"), + new Module().withName("RedisTimeSeries").withArgs("RETENTION_POLICY 20"), + new Module().withName("RediSearch"))) + .create(); + } + + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesCreateWithActiveGeoReplication( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .define("default") + .withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) + .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("groupName") + .withLinkedDatabases( + Arrays + .asList( + new LinkedDatabase() + .withId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + new LinkedDatabase() + .withId( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")))) + .create(); + } +} +``` + +### Databases_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Databases Delete. */ +public final class DatabasesDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json + */ + /** + * Sample code: RedisEnterpriseDatabasesDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesDelete( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().delete("rg1", "cache1", "db1", Context.NONE); + } +} +``` + +### Databases_Export + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; + +/** Samples for Databases Export. */ +public final class DatabasesExportSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesExport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesExport( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .export( + "rg1", + "cache1", + "default", + new ExportClusterParameters() + .withSasUri("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), + Context.NONE); + } +} +``` + +### Databases_ForceUnlink + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; +import java.util.Arrays; + +/** Samples for Databases ForceUnlink. */ +public final class DatabasesForceUnlinkSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json + */ + /** + * Sample code: How to unlink a database during a regional outage. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToUnlinkADatabaseDuringARegionalOutage( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .forceUnlink( + "rg1", + "cache1", + "default", + new ForceUnlinkParameters() + .withIds( + Arrays + .asList( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + Context.NONE); + } +} +``` + +### Databases_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Databases Get. */ +public final class DatabasesGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json + */ + /** + * Sample code: RedisEnterpriseDatabasesGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesGet( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE); + } +} +``` + +### Databases_ImportMethod + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; + +/** Samples for Databases ImportMethod. */ +public final class DatabasesImportMethodSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesImport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesImport( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .importMethod( + "rg1", + "cache1", + "default", + new ImportClusterParameters() + .withSasUris( + Arrays + .asList( + "https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters", + "https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")), + Context.NONE); + } +} +``` + +### Databases_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Databases ListByCluster. */ +public final class DatabasesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListByCluster. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesListByCluster( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listByCluster("rg1", "cache1", Context.NONE); + } +} +``` + +### Databases_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Databases ListKeys. */ +public final class DatabasesListKeysSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListKeys. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesListKeys( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listKeysWithResponse("rg1", "cache1", "default", Context.NONE); + } +} +``` + +### Databases_RegenerateKey + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.AccessKeyType; +import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; + +/** Samples for Databases RegenerateKey. */ +public final class DatabasesRegenerateKeySamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json + */ + /** + * Sample code: RedisEnterpriseDatabasesRegenerateKey. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesRegenerateKey( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .regenerateKey( + "rg1", + "cache1", + "default", + new RegenerateKeyParameters().withKeyType(AccessKeyType.PRIMARY), + Context.NONE); + } +} +``` + +### Databases_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; + +/** Samples for Databases Update. */ +public final class DatabasesUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesUpdate( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Database resource = manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE).getValue(); + resource + .update() + .withClientProtocol(Protocol.ENCRYPTED) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) + .apply(); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### OperationsStatus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationsStatus Get. */ +public final class OperationsStatusGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json + */ + /** + * Sample code: OperationsStatusGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsStatusGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operationsStatus().getWithResponse("West US", "testoperationid", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDeletePrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGetPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().getWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisEnterpriseListPrivateEndpointConnections. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateEndpointConnections( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().list("rg1", "cache1", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterprisePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterprisePutPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .privateEndpointConnections() + .define("pectest01") + .withExistingRedisEnterprise("rg1", "cache1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateLinkResources_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByCluster. */ +public final class PrivateLinkResourcesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json + */ + /** + * Sample code: RedisEnterpriseListPrivateLinkResources. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateLinkResources( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateLinkResources().listByCluster("rg1", "cache1", Context.NONE); + } +} +``` + +### RedisEnterprise_Create + +```java +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Create. */ +public final class RedisEnterpriseCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json + */ + /** + * Sample code: RedisEnterpriseCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseCreate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .redisEnterprises() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(3)) + .withTags(mapOf("tag1", "value1")) + .withZones(Arrays.asList("1", "2", "3")) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RedisEnterprise_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise Delete. */ +public final class RedisEnterpriseDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json + */ + /** + * Sample code: RedisEnterpriseDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().delete("rg1", "cache1", Context.NONE); + } +} +``` + +### RedisEnterprise_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise GetByResourceGroup. */ +public final class RedisEnterpriseGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json + */ + /** + * Sample code: RedisEnterpriseGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + } +} +``` + +### RedisEnterprise_List + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise List. */ +public final class RedisEnterpriseListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json + */ + /** + * Sample code: RedisEnterpriseList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().list(Context.NONE); + } +} +``` + +### RedisEnterprise_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise ListByResourceGroup. */ +public final class RedisEnterpriseListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json + */ + /** + * Sample code: RedisEnterpriseListByResourceGroup. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListByResourceGroup( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### RedisEnterprise_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Update. */ +public final class RedisEnterpriseUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json + */ + /** + * Sample code: RedisEnterpriseUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Cluster resource = + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index c11bbbe69de3b..14e00bab1254c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-redisenterprise - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-redisenterprise + 1.1.0-beta.1 + jar - Microsoft Azure SDK for RedisEnterprise Management - This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for RedisEnterprise Management + This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2022-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.27.0 - - - com.azure - azure-core-management - 1.5.4 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java index 3b75d0b288ed5..db89d0d0c899d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -39,6 +40,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to RedisEnterpriseManager. REST API for managing Redis Enterprise resources in Azure. */ public final class RedisEnterpriseManager { @@ -92,11 +94,12 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -136,6 +139,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -154,9 +168,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -178,7 +194,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.redisenterprise") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -192,20 +208,33 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java index f9f98491e9b61..b891bda86a57b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; import com.azure.resourcemanager.redisenterprise.models.DatabaseUpdate; import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; @@ -28,7 +29,7 @@ public interface DatabasesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName); @@ -42,7 +43,7 @@ public interface DatabasesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); @@ -57,9 +58,9 @@ public interface DatabasesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); @@ -74,9 +75,9 @@ SyncPoller, DatabaseInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); @@ -122,9 +123,9 @@ DatabaseInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters); @@ -139,9 +140,9 @@ SyncPoller, DatabaseInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context); @@ -201,7 +202,7 @@ DatabaseInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -216,9 +217,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String databaseName); /** @@ -231,9 +232,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName, Context context); @@ -273,7 +274,7 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -288,7 +289,7 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse( @@ -304,9 +305,9 @@ Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link SyncPoller} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters); @@ -321,9 +322,9 @@ SyncPoller, AccessKeysInner> beginRegenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link SyncPoller} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, @@ -341,7 +342,7 @@ SyncPoller, AccessKeysInner> beginRegenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey( @@ -358,7 +359,7 @@ AccessKeysInner regenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey( @@ -369,7 +370,7 @@ AccessKeysInner regenerateKey( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -378,14 +379,14 @@ AccessKeysInner regenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -395,9 +396,9 @@ SyncPoller, Void> beginImportMethod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, @@ -406,7 +407,7 @@ SyncPoller, Void> beginImportMethod( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -421,7 +422,7 @@ void importMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -450,9 +451,9 @@ void importMethod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters); @@ -467,9 +468,9 @@ SyncPoller, Void> beginExport( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, @@ -510,4 +511,76 @@ void export( String databaseName, ExportClusterParameters parameters, Context context); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginForceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginForceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void forceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void forceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java index 1ac3726460ba8..9e09dae539eb5 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java @@ -17,7 +17,8 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +30,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsStatusClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsStatusClient.java index 50d86883ae374..6030d77066ada 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsStatusClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsStatusClient.java @@ -34,7 +34,7 @@ public interface OperationsStatusClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String location, String operationId, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java index 498c2b25bd922..490e4244a1bac 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java @@ -23,7 +23,8 @@ public interface PrivateEndpointConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName); @@ -37,7 +38,8 @@ public interface PrivateEndpointConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String clusterName, Context context); @@ -69,7 +71,8 @@ PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -86,9 +89,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -107,9 +110,9 @@ SyncPoller, PrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -184,7 +187,7 @@ PrivateEndpointConnectionInner put( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java index 51751bd40324e..6b488e78a6421 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java @@ -20,7 +20,8 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName); @@ -34,7 +35,8 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster( diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java index 31434fe63c020..0e74919287370 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java @@ -25,9 +25,9 @@ public interface RedisEnterprisesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters); @@ -41,9 +41,9 @@ SyncPoller, ClusterInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context); @@ -85,9 +85,9 @@ SyncPoller, ClusterInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters); @@ -101,9 +101,9 @@ SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context); @@ -144,9 +144,9 @@ SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); /** @@ -158,9 +158,9 @@ SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); /** @@ -210,7 +210,7 @@ SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -223,7 +223,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -236,7 +236,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -246,7 +246,8 @@ Response getByResourceGroupWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -258,7 +259,8 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java index a95c5c6cf6bf9..b2b7e74f41c92 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The secret access keys used for authenticating connections to redis. */ +/** Access keys The secret access keys used for authenticating connections to redis. */ @Immutable public final class AccessKeysInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); - /* * The current primary key that clients can use to authenticate */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java index b973c7f294137..968b0cca78121 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java @@ -5,24 +5,19 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.ResourceState; import com.azure.resourcemanager.redisenterprise.models.Sku; import com.azure.resourcemanager.redisenterprise.models.TlsVersion; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** Describes the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class ClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); - +public final class ClusterInner extends Resource { /* * The SKU to create, which affects price, performance, and features. */ @@ -36,41 +31,10 @@ public class ClusterInner extends Resource { private List zones; /* - * The minimum TLS version for the cluster to support, e.g. '1.2' - */ - @JsonProperty(value = "properties.minimumTlsVersion") - private TlsVersion minimumTlsVersion; - - /* - * DNS name of the cluster endpoint - */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; - - /* - * Current provisioning status of the cluster - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the cluster - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Version of redis the cluster supports, e.g. '6' + * RedisEnterprise cluster properties Other properties of the cluster. */ - @JsonProperty(value = "properties.redisVersion", access = JsonProperty.Access.WRITE_ONLY) - private String redisVersion; - - /* - * List of private endpoint connections associated with the specified - * RedisEnterprise cluster - */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; /** * Get the sku property: The SKU to create, which affects price, performance, and features. @@ -112,13 +76,36 @@ public ClusterInner withZones(List zones) { return this; } + /** + * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. * * @return the minimumTlsVersion value. */ public TlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); } /** @@ -128,7 +115,10 @@ public TlsVersion minimumTlsVersion() { * @return the ClusterInner object itself. */ public ClusterInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); return this; } @@ -138,7 +128,7 @@ public ClusterInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { * @return the hostname value. */ public String hostname() { - return this.hostname; + return this.innerProperties() == null ? null : this.innerProperties().hostname(); } /** @@ -147,7 +137,7 @@ public String hostname() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -156,7 +146,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -165,7 +155,7 @@ public ResourceState resourceState() { * @return the redisVersion value. */ public String redisVersion() { - return this.redisVersion; + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); } /** @@ -175,21 +165,7 @@ public String redisVersion() { * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** @@ -199,14 +175,16 @@ public ClusterInner withTags(Map tags) { */ public void validate() { if (sku() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sku in model ClusterInner")); } else { sku().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInner.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java new file mode 100644 index 0000000000000..431fa987f7126 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.ResourceState; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * RedisEnterprise cluster properties Properties of RedisEnterprise clusters, as opposed to general resource properties + * like location, tags. + */ +@Fluent +public final class ClusterProperties { + /* + * The minimum TLS version for the cluster to support, e.g. '1.2' + */ + @JsonProperty(value = "minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /* + * DNS name of the cluster endpoint + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Current provisioning status of the cluster + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Current resource status of the cluster + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceState resourceState; + + /* + * Version of redis the cluster supports, e.g. '6' + */ + @JsonProperty(value = "redisVersion", access = JsonProperty.Access.WRITE_ONLY) + private String redisVersion; + + /* + * List of private endpoint connections associated with the specified + * RedisEnterprise cluster + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the hostname property: DNS name of the cluster endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the provisioningState property: Current provisioning status of the cluster. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Current resource status of the cluster. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the redisVersion property: Version of redis the cluster supports, e.g. '6'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.redisVersion; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified + * RedisEnterprise cluster. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java index 80d73098f090d..e9b8a3d0ae49f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java @@ -5,76 +5,35 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; import com.azure.resourcemanager.redisenterprise.models.Module; import com.azure.resourcemanager.redisenterprise.models.Persistence; import com.azure.resourcemanager.redisenterprise.models.Protocol; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.ResourceState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes a database on the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class DatabaseInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInner.class); - - /* - * Specifies whether redis clients can connect using TLS-encrypted or - * plaintext redis protocols. Default is TLS-encrypted. - */ - @JsonProperty(value = "properties.clientProtocol") - private Protocol clientProtocol; - - /* - * TCP port of the database endpoint. Specified at create time. Defaults to - * an available port. - */ - @JsonProperty(value = "properties.port") - private Integer port; - - /* - * Current provisioning status of the database - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the database - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Clustering policy - default is OSSCluster. Specified at create time. - */ - @JsonProperty(value = "properties.clusteringPolicy") - private ClusteringPolicy clusteringPolicy; - +public final class DatabaseInner extends ProxyResource { /* - * Redis eviction policy - default is VolatileLRU + * RedisEnterprise database properties Other properties of the database. */ - @JsonProperty(value = "properties.evictionPolicy") - private EvictionPolicy evictionPolicy; + @JsonProperty(value = "properties") + private DatabaseProperties innerProperties; - /* - * Persistence settings - */ - @JsonProperty(value = "properties.persistence") - private Persistence persistence; - - /* - * Optional set of redis modules to enable in this database - modules can - * only be added at creation time. + /** + * Get the innerProperties property: RedisEnterprise database properties Other properties of the database. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.modules") - private List modules; + private DatabaseProperties innerProperties() { + return this.innerProperties; + } /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext @@ -83,7 +42,7 @@ public class DatabaseInner extends ProxyResource { * @return the clientProtocol value. */ public Protocol clientProtocol() { - return this.clientProtocol; + return this.innerProperties() == null ? null : this.innerProperties().clientProtocol(); } /** @@ -94,7 +53,10 @@ public Protocol clientProtocol() { * @return the DatabaseInner object itself. */ public DatabaseInner withClientProtocol(Protocol clientProtocol) { - this.clientProtocol = clientProtocol; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClientProtocol(clientProtocol); return this; } @@ -105,7 +67,7 @@ public DatabaseInner withClientProtocol(Protocol clientProtocol) { * @return the port value. */ public Integer port() { - return this.port; + return this.innerProperties() == null ? null : this.innerProperties().port(); } /** @@ -116,7 +78,10 @@ public Integer port() { * @return the DatabaseInner object itself. */ public DatabaseInner withPort(Integer port) { - this.port = port; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPort(port); return this; } @@ -126,7 +91,7 @@ public DatabaseInner withPort(Integer port) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -135,7 +100,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -144,7 +109,7 @@ public ResourceState resourceState() { * @return the clusteringPolicy value. */ public ClusteringPolicy clusteringPolicy() { - return this.clusteringPolicy; + return this.innerProperties() == null ? null : this.innerProperties().clusteringPolicy(); } /** @@ -154,7 +119,10 @@ public ClusteringPolicy clusteringPolicy() { * @return the DatabaseInner object itself. */ public DatabaseInner withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - this.clusteringPolicy = clusteringPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClusteringPolicy(clusteringPolicy); return this; } @@ -164,7 +132,7 @@ public DatabaseInner withClusteringPolicy(ClusteringPolicy clusteringPolicy) { * @return the evictionPolicy value. */ public EvictionPolicy evictionPolicy() { - return this.evictionPolicy; + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); } /** @@ -174,7 +142,10 @@ public EvictionPolicy evictionPolicy() { * @return the DatabaseInner object itself. */ public DatabaseInner withEvictionPolicy(EvictionPolicy evictionPolicy) { - this.evictionPolicy = evictionPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); return this; } @@ -184,7 +155,7 @@ public DatabaseInner withEvictionPolicy(EvictionPolicy evictionPolicy) { * @return the persistence value. */ public Persistence persistence() { - return this.persistence; + return this.innerProperties() == null ? null : this.innerProperties().persistence(); } /** @@ -194,7 +165,10 @@ public Persistence persistence() { * @return the DatabaseInner object itself. */ public DatabaseInner withPersistence(Persistence persistence) { - this.persistence = persistence; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPersistence(persistence); return this; } @@ -205,7 +179,7 @@ public DatabaseInner withPersistence(Persistence persistence) { * @return the modules value. */ public List modules() { - return this.modules; + return this.innerProperties() == null ? null : this.innerProperties().modules(); } /** @@ -216,7 +190,33 @@ public List modules() { * @return the DatabaseInner object itself. */ public DatabaseInner withModules(List modules) { - this.modules = modules; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withModules(modules); + return this; + } + + /** + * Get the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @return the geoReplication value. + */ + public DatabasePropertiesGeoReplication geoReplication() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplication(); + } + + /** + * Set the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @param geoReplication the geoReplication value to set. + * @return the DatabaseInner object itself. + */ + public DatabaseInner withGeoReplication(DatabasePropertiesGeoReplication geoReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withGeoReplication(geoReplication); return this; } @@ -226,11 +226,8 @@ public DatabaseInner withModules(List modules) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java new file mode 100644 index 0000000000000..346b8be291f8b --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Module; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.ResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * RedisEnterprise database properties Properties of RedisEnterprise databases, as opposed to general resource + * properties like location, tags. + */ +@Fluent +public final class DatabaseProperties { + /* + * Specifies whether redis clients can connect using TLS-encrypted or + * plaintext redis protocols. Default is TLS-encrypted. + */ + @JsonProperty(value = "clientProtocol") + private Protocol clientProtocol; + + /* + * TCP port of the database endpoint. Specified at create time. Defaults to + * an available port. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Current provisioning status of the database + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Current resource status of the database + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceState resourceState; + + /* + * Clustering policy - default is OSSCluster. Specified at create time. + */ + @JsonProperty(value = "clusteringPolicy") + private ClusteringPolicy clusteringPolicy; + + /* + * Redis eviction policy - default is VolatileLRU + */ + @JsonProperty(value = "evictionPolicy") + private EvictionPolicy evictionPolicy; + + /* + * Persistence settings + */ + @JsonProperty(value = "persistence") + private Persistence persistence; + + /* + * Optional set of redis modules to enable in this database - modules can + * only be added at creation time. + */ + @JsonProperty(value = "modules") + private List modules; + + /* + * Optional set of properties to configure geo replication for this + * database. + */ + @JsonProperty(value = "geoReplication") + private DatabasePropertiesGeoReplication geoReplication; + + /** + * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext + * redis protocols. Default is TLS-encrypted. + * + * @return the clientProtocol value. + */ + public Protocol clientProtocol() { + return this.clientProtocol; + } + + /** + * Set the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext + * redis protocols. Default is TLS-encrypted. + * + * @param clientProtocol the clientProtocol value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withClientProtocol(Protocol clientProtocol) { + this.clientProtocol = clientProtocol; + return this; + } + + /** + * Get the port property: TCP port of the database endpoint. Specified at create time. Defaults to an available + * port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: TCP port of the database endpoint. Specified at create time. Defaults to an available + * port. + * + * @param port the port value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the provisioningState property: Current provisioning status of the database. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Current resource status of the database. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create time. + * + * @return the clusteringPolicy value. + */ + public ClusteringPolicy clusteringPolicy() { + return this.clusteringPolicy; + } + + /** + * Set the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create time. + * + * @param clusteringPolicy the clusteringPolicy value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withClusteringPolicy(ClusteringPolicy clusteringPolicy) { + this.clusteringPolicy = clusteringPolicy; + return this; + } + + /** + * Get the evictionPolicy property: Redis eviction policy - default is VolatileLRU. + * + * @return the evictionPolicy value. + */ + public EvictionPolicy evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Redis eviction policy - default is VolatileLRU. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withEvictionPolicy(EvictionPolicy evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the persistence property: Persistence settings. + * + * @return the persistence value. + */ + public Persistence persistence() { + return this.persistence; + } + + /** + * Set the persistence property: Persistence settings. + * + * @param persistence the persistence value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withPersistence(Persistence persistence) { + this.persistence = persistence; + return this; + } + + /** + * Get the modules property: Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + * + * @return the modules value. + */ + public List modules() { + return this.modules; + } + + /** + * Set the modules property: Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + * + * @param modules the modules value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withModules(List modules) { + this.modules = modules; + return this; + } + + /** + * Get the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @return the geoReplication value. + */ + public DatabasePropertiesGeoReplication geoReplication() { + return this.geoReplication; + } + + /** + * Set the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @param geoReplication the geoReplication value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withGeoReplication(DatabasePropertiesGeoReplication geoReplication) { + this.geoReplication = geoReplication; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (persistence() != null) { + persistence().validate(); + } + if (modules() != null) { + modules().forEach(e -> e.validate()); + } + if (geoReplication() != null) { + geoReplication().validate(); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java index 150270059ea71..b94d16ebc1d16 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.ActionType; import com.azure.resourcemanager.redisenterprise.models.OperationDisplay; import com.azure.resourcemanager.redisenterprise.models.Origin; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The name of the operation, as per Resource-Based Access Control (RBAC). * Examples: "Microsoft.Compute/virtualMachines/write", diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java index bcb0bd186e2ac..242057dbaee63 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java @@ -6,15 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The status of a long-running operation. */ @Fluent public final class OperationStatusInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); - /* * The operation's unique id. */ @@ -46,7 +42,7 @@ public final class OperationStatusInner { private String status; /* - * Error response describing why the operation failed. + * Error response Error response describing why the operation failed. */ @JsonProperty(value = "error") private ManagementError error; @@ -152,7 +148,7 @@ public OperationStatusInner withStatus(String status) { } /** - * Get the error property: Error response describing why the operation failed. + * Get the error property: Error response Error response describing why the operation failed. * * @return the error value. */ @@ -161,7 +157,7 @@ public ManagementError error() { } /** - * Set the error property: Error response describing why the operation failed. + * Set the error property: Error response Error response describing why the operation failed. * * @param error the error value to set. * @return the OperationStatusInner object itself. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java index 6e69a85bcfd35..08defe8fc7025 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java @@ -5,39 +5,29 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint Connection resource. */ -@JsonFlatten @Fluent -public class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * The resource of private end point. - */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; - +public final class PrivateEndpointConnectionInner extends ProxyResource { /* - * A collection of information about the state of the connection between - * service consumer and provider. + * Resource properties. */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; - /* - * The provisioning state of the private endpoint connection resource. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the privateEndpoint property: The resource of private end point. @@ -45,7 +35,7 @@ public class PrivateEndpointConnectionInner extends ProxyResource { * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); } /** @@ -55,7 +45,10 @@ public PrivateEndpoint privateEndpoint() { * @return the PrivateEndpointConnectionInner object itself. */ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); return this; } @@ -66,7 +59,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); } /** @@ -78,7 +71,10 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { */ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } @@ -88,7 +84,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -97,11 +93,8 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..932d6da61c075 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java index 2e940994eb86c..6f78217b30919 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java @@ -5,36 +5,27 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A private link resource. */ -@JsonFlatten @Fluent -public class PrivateLinkResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - +public final class PrivateLinkResourceInner extends ProxyResource { /* - * The private link resource required member names. + * Resource properties. */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; - /* - * The private link resource Private link DNS zone name. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.requiredZoneNames") - private List requiredZoneNames; + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } /** * Get the groupId property: The private link resource group id. @@ -42,7 +33,7 @@ public class PrivateLinkResourceInner extends ProxyResource { * @return the groupId value. */ public String groupId() { - return this.groupId; + return this.innerProperties() == null ? null : this.innerProperties().groupId(); } /** @@ -51,7 +42,7 @@ public String groupId() { * @return the requiredMembers value. */ public List requiredMembers() { - return this.requiredMembers; + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); } /** @@ -60,7 +51,7 @@ public List requiredMembers() { * @return the requiredZoneNames value. */ public List requiredZoneNames() { - return this.requiredZoneNames; + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } /** @@ -70,7 +61,10 @@ public List requiredZoneNames() { * @return the PrivateLinkResourceInner object itself. */ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); return this; } @@ -80,5 +74,8 @@ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneN * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..802b87d2d8975 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java index 33f11b78af91a..b76e39308002b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java @@ -10,9 +10,11 @@ import com.azure.resourcemanager.redisenterprise.models.AccessKeys; import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; import com.azure.resourcemanager.redisenterprise.models.DatabaseUpdate; import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.Module; import com.azure.resourcemanager.redisenterprise.models.Persistence; @@ -77,6 +79,10 @@ public List modules() { } } + public DatabasePropertiesGeoReplication geoReplication() { + return this.innerModel().geoReplication(); + } + public DatabaseInner innerModel() { return this.innerObject; } @@ -209,6 +215,14 @@ public void export(ExportClusterParameters parameters, Context context) { serviceManager.databases().export(resourceGroupName, clusterName, databaseName, parameters, context); } + public void forceUnlink(ForceUnlinkParameters parameters) { + serviceManager.databases().forceUnlink(resourceGroupName, clusterName, databaseName, parameters); + } + + public void forceUnlink(ForceUnlinkParameters parameters, Context context) { + serviceManager.databases().forceUnlink(resourceGroupName, clusterName, databaseName, parameters, context); + } + public DatabaseImpl withClientProtocol(Protocol clientProtocol) { if (isInCreateMode()) { this.innerModel().withClientProtocol(clientProtocol); @@ -225,13 +239,8 @@ public DatabaseImpl withPort(Integer port) { } public DatabaseImpl withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - if (isInCreateMode()) { - this.innerModel().withClusteringPolicy(clusteringPolicy); - return this; - } else { - this.updateParameters.withClusteringPolicy(clusteringPolicy); - return this; - } + this.innerModel().withClusteringPolicy(clusteringPolicy); + return this; } public DatabaseImpl withEvictionPolicy(EvictionPolicy evictionPolicy) { @@ -255,13 +264,13 @@ public DatabaseImpl withPersistence(Persistence persistence) { } public DatabaseImpl withModules(List modules) { - if (isInCreateMode()) { - this.innerModel().withModules(modules); - return this; - } else { - this.updateParameters.withModules(modules); - return this; - } + this.innerModel().withModules(modules); + return this; + } + + public DatabaseImpl withGeoReplication(DatabasePropertiesGeoReplication geoReplication) { + this.innerModel().withGeoReplication(geoReplication); + return this; } private boolean isInCreateMode() { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java index 54ab0fc95e91c..8388c3b650caa 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient; @@ -40,6 +39,7 @@ import com.azure.resourcemanager.redisenterprise.models.DatabaseList; import com.azure.resourcemanager.redisenterprise.models.DatabaseUpdate; import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; import java.nio.ByteBuffer; @@ -48,8 +48,6 @@ /** An instance of this class provides access to all the operations defined in DatabasesClient. */ public final class DatabasesClientImpl implements DatabasesClient { - private final ClientLogger logger = new ClientLogger(DatabasesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DatabasesService service; @@ -222,6 +220,23 @@ Mono>> export( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" + + "/redisEnterprise/{clusterName}/databases/{databaseName}/forceUnlink") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> forceUnlink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ForceUnlinkParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -241,7 +256,8 @@ Mono> listByClusterNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync( @@ -299,7 +315,8 @@ private Mono> listByClusterSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync( @@ -353,7 +370,7 @@ private Mono> listByClusterSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { @@ -371,7 +388,7 @@ private PagedFlux listByClusterAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, Context context) { @@ -388,7 +405,7 @@ private PagedFlux listByClusterAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { @@ -404,7 +421,7 @@ public PagedIterable listByCluster(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { @@ -421,7 +438,8 @@ public PagedIterable listByCluster(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -482,7 +500,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -539,9 +558,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { Mono>> mono = @@ -549,7 +568,11 @@ private PollerFlux, DatabaseInner> beginCreateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DatabaseInner.class, + DatabaseInner.class, + this.client.getContext()); } /** @@ -563,9 +586,9 @@ private PollerFlux, DatabaseInner> beginCreateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { context = this.client.mergeContext(context); @@ -587,9 +610,9 @@ private PollerFlux, DatabaseInner> beginCreateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { return beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -606,9 +629,9 @@ public SyncPoller, DatabaseInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { return beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); @@ -624,7 +647,7 @@ public SyncPoller, DatabaseInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -645,7 +668,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -702,7 +725,8 @@ public DatabaseInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -763,7 +787,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -820,9 +845,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginUpdateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { Mono>> mono = @@ -830,7 +855,11 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DatabaseInner.class, + DatabaseInner.class, + this.client.getContext()); } /** @@ -844,9 +873,9 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginUpdateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context) { context = this.client.mergeContext(context); @@ -868,9 +897,9 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -887,9 +916,9 @@ public SyncPoller, DatabaseInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); @@ -905,7 +934,7 @@ public SyncPoller, DatabaseInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -926,7 +955,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a database on the RedisEnterprise cluster. + * @return describes a database on the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -982,7 +1011,8 @@ public DatabaseInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -1036,7 +1066,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -1086,7 +1117,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String clusterName, String databaseName) { @@ -1127,7 +1158,7 @@ public DatabaseInner get(String resourceGroupName, String clusterName, String da * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -1144,7 +1175,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1198,7 +1229,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1248,15 +1279,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, String databaseName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, databaseName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1269,9 +1301,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, String databaseName, Context context) { context = this.client.mergeContext(context); @@ -1291,9 +1323,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName) { return beginDeleteAsync(resourceGroupName, clusterName, databaseName).getSyncPoller(); @@ -1309,9 +1341,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, databaseName, context).getSyncPoller(); @@ -1326,7 +1358,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, String databaseName) { @@ -1345,7 +1377,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, String databaseName, Context context) { @@ -1394,7 +1426,7 @@ public void delete(String resourceGroupName, String clusterName, String database * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1448,7 +1480,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1498,7 +1530,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync(String resourceGroupName, String clusterName, String databaseName) { @@ -1522,7 +1554,7 @@ private Mono listKeysAsync(String resourceGroupName, String clu * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName) { @@ -1539,7 +1571,7 @@ public AccessKeysInner listKeys(String resourceGroupName, String clusterName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse( @@ -1557,7 +1589,7 @@ public Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync( @@ -1618,7 +1650,7 @@ private Mono>> regenerateKeyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync( @@ -1679,9 +1711,9 @@ private Mono>> regenerateKeyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link PollerFlux} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccessKeysInner> beginRegenerateKeyAsync( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { Mono>> mono = @@ -1689,7 +1721,11 @@ private PollerFlux, AccessKeysInner> beginRegenerate return this .client .getLroResult( - mono, this.client.getHttpPipeline(), AccessKeysInner.class, AccessKeysInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + AccessKeysInner.class, + AccessKeysInner.class, + this.client.getContext()); } /** @@ -1703,9 +1739,9 @@ private PollerFlux, AccessKeysInner> beginRegenerate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link PollerFlux} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccessKeysInner> beginRegenerateKeyAsync( String resourceGroupName, String clusterName, @@ -1731,9 +1767,9 @@ private PollerFlux, AccessKeysInner> beginRegenerate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link SyncPoller} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { return beginRegenerateKeyAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -1750,9 +1786,9 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return the {@link SyncPoller} for polling of access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, @@ -1773,7 +1809,7 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync( @@ -1794,7 +1830,7 @@ private Mono regenerateKeyAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync( @@ -1818,7 +1854,7 @@ private Mono regenerateKeyAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey( @@ -1837,7 +1873,7 @@ public AccessKeysInner regenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey( @@ -1850,7 +1886,7 @@ public AccessKeysInner regenerateKey( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1859,7 +1895,7 @@ public AccessKeysInner regenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importMethodWithResponseAsync( @@ -1910,7 +1946,7 @@ private Mono>> importMethodWithResponseAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1920,7 +1956,7 @@ private Mono>> importMethodWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importMethodWithResponseAsync( @@ -1972,7 +2008,7 @@ private Mono>> importMethodWithResponseAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1981,20 +2017,21 @@ private Mono>> importMethodWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportMethodAsync( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters) { Mono>> mono = importMethodWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2004,9 +2041,9 @@ private PollerFlux, Void> beginImportMethodAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportMethodAsync( String resourceGroupName, String clusterName, @@ -2022,7 +2059,7 @@ private PollerFlux, Void> beginImportMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2031,16 +2068,16 @@ private PollerFlux, Void> beginImportMethodAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters) { return beginImportMethodAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2050,9 +2087,9 @@ public SyncPoller, Void> beginImportMethod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, @@ -2064,7 +2101,7 @@ public SyncPoller, Void> beginImportMethod( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2073,7 +2110,7 @@ public SyncPoller, Void> beginImportMethod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono importMethodAsync( @@ -2084,7 +2121,7 @@ private Mono importMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2094,7 +2131,7 @@ private Mono importMethodAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono importMethodAsync( @@ -2109,7 +2146,7 @@ private Mono importMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2126,7 +2163,7 @@ public void importMethod( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2157,7 +2194,7 @@ public void importMethod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportWithResponseAsync( @@ -2218,7 +2255,7 @@ private Mono>> exportWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportWithResponseAsync( @@ -2279,16 +2316,17 @@ private Mono>> exportWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportAsync( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters) { Mono>> mono = exportWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2302,9 +2340,9 @@ private PollerFlux, Void> beginExportAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportAsync( String resourceGroupName, String clusterName, @@ -2329,9 +2367,9 @@ private PollerFlux, Void> beginExportAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters) { return beginExportAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -2348,9 +2386,9 @@ public SyncPoller, Void> beginExport( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, @@ -2370,7 +2408,7 @@ public SyncPoller, Void> beginExport( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono exportAsync( @@ -2391,7 +2429,7 @@ private Mono exportAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono exportAsync( @@ -2444,6 +2482,304 @@ public void export( exportAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); } + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> forceUnlinkWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .forceUnlink( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> forceUnlinkWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .forceUnlink( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginForceUnlinkAsync( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + Mono>> mono = + forceUnlinkWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginForceUnlinkAsync( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + forceUnlinkWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginForceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + return beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginForceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + return beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceUnlinkAsync( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + return beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceUnlinkAsync( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + return beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void forceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + forceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters).block(); + } + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void forceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + forceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); + } + /** * Get the next page of items. * @@ -2451,7 +2787,8 @@ public void export( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink) { @@ -2487,7 +2824,8 @@ private Mono> listByClusterNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java index ba5e7d21e6bcb..998b30c4b50fc 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java @@ -16,12 +16,12 @@ import com.azure.resourcemanager.redisenterprise.models.Database; import com.azure.resourcemanager.redisenterprise.models.Databases; import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DatabasesImpl implements Databases { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DatabasesImpl.class); private final DatabasesClient innerClient; @@ -154,10 +154,24 @@ public void export( this.serviceClient().export(resourceGroupName, clusterName, databaseName, parameters, context); } + public void forceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { + this.serviceClient().forceUnlink(resourceGroupName, clusterName, databaseName, parameters); + } + + public void forceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context) { + this.serviceClient().forceUnlink(resourceGroupName, clusterName, databaseName, parameters, context); + } + public Database getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -165,7 +179,7 @@ public Database getById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -173,7 +187,7 @@ public Database getById(String id) { } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); @@ -184,7 +198,7 @@ public Database getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -192,7 +206,7 @@ public Response getByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -200,7 +214,7 @@ public Response getByIdWithResponse(String id, Context context) { } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); @@ -211,7 +225,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -219,7 +233,7 @@ public void deleteById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -227,7 +241,7 @@ public void deleteById(String id) { } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); @@ -238,7 +252,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -246,7 +260,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -254,7 +268,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java index ff7fe368b167d..0392645e823db 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.OperationsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; import com.azure.resourcemanager.redisenterprise.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,8 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +162,8 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +176,8 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +191,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +206,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +243,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java index 7294254d61851..30cb741c56e16 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; import com.azure.resourcemanager.redisenterprise.models.Operation; import com.azure.resourcemanager.redisenterprise.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java index bdbf3695552bf..81f66679c00c9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsStatusClient. */ public final class OperationsStatusClientImpl implements OperationsStatusClient { - private final ClientLogger logger = new ClientLogger(OperationsStatusClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsStatusService service; @@ -78,7 +75,7 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location, String operationId) { @@ -125,7 +122,7 @@ private Mono> getWithResponseAsync(String locatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -169,7 +166,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location, String operationId) { @@ -208,7 +205,7 @@ public OperationStatusInner get(String location, String operationId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String operationId, Context context) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java index c2f5bea88b123..429725127207a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; import com.azure.resourcemanager.redisenterprise.models.OperationStatus; import com.azure.resourcemanager.redisenterprise.models.OperationsStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsStatusImpl implements OperationsStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsStatusImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsStatusImpl.class); private final OperationsStatusClient innerClient; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java index fc91282f51e76..352c3d86e1408 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient; @@ -41,8 +40,6 @@ /** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateEndpointConnectionsService service; @@ -142,7 +139,8 @@ Mono> delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -195,7 +193,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -244,7 +243,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String clusterName) { @@ -260,7 +260,8 @@ private PagedFlux listAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -276,7 +277,8 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String clusterName) { @@ -292,7 +294,8 @@ public PagedIterable list(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -310,7 +313,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -368,7 +372,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -422,7 +427,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -467,7 +473,8 @@ public PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -486,7 +493,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putWithResponseAsync( @@ -554,7 +562,8 @@ private Mono>> putWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putWithResponseAsync( @@ -619,9 +628,9 @@ private Mono>> putWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( String resourceGroupName, String clusterName, @@ -636,7 +645,7 @@ private PollerFlux, PrivateEndpointCo this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -651,9 +660,9 @@ private PollerFlux, PrivateEndpointCo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( String resourceGroupName, String clusterName, @@ -684,9 +693,9 @@ private PollerFlux, PrivateEndpointCo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -707,9 +716,9 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -731,7 +740,7 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putAsync( @@ -756,7 +765,7 @@ private Mono putAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putAsync( @@ -826,7 +835,7 @@ public PrivateEndpointConnectionInner put( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -884,7 +893,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -938,7 +947,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { @@ -973,7 +982,7 @@ public void delete(String resourceGroupName, String clusterName, String privateE * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java index 8a95be421c719..af538f19e8e07 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnections; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); private final PrivateEndpointConnectionsClient innerClient; @@ -83,7 +82,7 @@ public Response deleteWithResponse( public PrivateEndpointConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -91,7 +90,7 @@ public PrivateEndpointConnection getById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -99,7 +98,7 @@ public PrivateEndpointConnection getById(String id) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,7 +114,7 @@ public PrivateEndpointConnection getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -123,7 +122,7 @@ public Response getByIdWithResponse(String id, Contex } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -131,7 +130,7 @@ public Response getByIdWithResponse(String id, Contex } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -145,7 +144,7 @@ public Response getByIdWithResponse(String id, Contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -153,7 +152,7 @@ public void deleteById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,7 +160,7 @@ public void deleteById(String id) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -169,13 +168,13 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - this.deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -183,7 +182,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -191,7 +190,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java index 1cd3d2783832f..c156b9273702d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResourceListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrivateLinkResourcesService service; @@ -84,7 +81,8 @@ Mono> listByCluster( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync( @@ -137,7 +135,8 @@ private Mono> listByClusterSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync( @@ -186,7 +185,8 @@ private Mono> listByClusterSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { @@ -202,7 +202,8 @@ private PagedFlux listByClusterAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync( @@ -218,7 +219,8 @@ private PagedFlux listByClusterAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { @@ -234,7 +236,8 @@ public PagedIterable listByCluster(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster( diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java index 0b970581ca4a9..930dc94d7db45 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResource; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResources; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); private final PrivateLinkResourcesClient innerClient; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java index 6ec6f99e977ff..82d012c2c708e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java @@ -41,8 +41,6 @@ /** Initializes a new instance of the RedisEnterpriseManagementClientImpl type. */ @ServiceClient(builder = RedisEnterpriseManagementClientBuilder.class) public final class RedisEnterpriseManagementClientImpl implements RedisEnterpriseManagementClient { - private final ClientLogger logger = new ClientLogger(RedisEnterpriseManagementClientImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -209,7 +207,7 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2022-01-01"; this.operations = new OperationsClientImpl(this); this.operationsStatus = new OperationsStatusClientImpl(this); this.redisEnterprises = new RedisEnterprisesClientImpl(this); @@ -301,7 +299,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -360,4 +358,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(RedisEnterpriseManagementClientImpl.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java index d7f70e4b5c4bb..3c611ef82df6e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in RedisEnterprisesClient. */ public final class RedisEnterprisesClientImpl implements RedisEnterprisesClient { - private final ClientLogger logger = new ClientLogger(RedisEnterprisesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RedisEnterprisesService service; @@ -186,7 +183,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -242,7 +240,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -294,16 +293,16 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateAsync( String resourceGroupName, String clusterName, ClusterInner parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, parameters); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -316,9 +315,9 @@ private PollerFlux, ClusterInner> beginCreateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateAsync( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { context = this.client.mergeContext(context); @@ -339,9 +338,9 @@ private PollerFlux, ClusterInner> beginCreateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters) { return beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); @@ -357,9 +356,9 @@ public SyncPoller, ClusterInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { return beginCreateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); @@ -374,7 +373,7 @@ public SyncPoller, ClusterInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { @@ -393,7 +392,7 @@ private Mono createAsync(String resourceGroupName, String clusterN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -445,7 +444,8 @@ public ClusterInner create(String resourceGroupName, String clusterName, Cluster * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -501,7 +501,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -553,16 +554,16 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync( String resourceGroupName, String clusterName, ClusterUpdate parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -575,9 +576,9 @@ private PollerFlux, ClusterInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link PollerFlux} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { context = this.client.mergeContext(context); @@ -598,9 +599,9 @@ private PollerFlux, ClusterInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters) { return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); @@ -616,9 +617,9 @@ public SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return the {@link SyncPoller} for polling of describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); @@ -633,7 +634,7 @@ public SyncPoller, ClusterInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { @@ -652,7 +653,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the RedisEnterprise cluster. + * @return describes the RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -704,7 +705,7 @@ public ClusterInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { @@ -752,7 +753,7 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -797,14 +798,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -816,9 +818,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, Context context) { context = this.client.mergeContext(context); @@ -836,9 +838,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } @@ -852,9 +854,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); @@ -868,7 +870,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName) { @@ -884,7 +886,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { @@ -930,7 +932,8 @@ public void delete(String resourceGroupName, String clusterName, Context context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -979,7 +982,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1024,7 +1028,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { @@ -1063,7 +1067,7 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -1078,7 +1082,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1130,7 +1135,8 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1179,7 +1185,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1196,7 +1202,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1212,7 +1218,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1227,7 +1233,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1239,7 +1245,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1285,7 +1292,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1326,7 +1334,7 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1340,7 +1348,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1353,7 +1361,8 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1367,7 +1376,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1381,7 +1391,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1418,7 +1429,8 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -1453,7 +1465,8 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1489,7 +1502,8 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java index 55823f7b895ff..625eb32f946dd 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import com.azure.resourcemanager.redisenterprise.models.Cluster; import com.azure.resourcemanager.redisenterprise.models.RedisEnterprises; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RedisEnterprisesImpl implements RedisEnterprises { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RedisEnterprisesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RedisEnterprisesImpl.class); private final RedisEnterprisesClient innerClient; @@ -84,7 +83,7 @@ public PagedIterable list(Context context) { public Cluster getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -92,7 +91,7 @@ public Cluster getById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -104,7 +103,7 @@ public Cluster getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -112,7 +111,7 @@ public Response getByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -124,7 +123,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -132,7 +131,7 @@ public void deleteById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -144,7 +143,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -152,7 +151,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "redisEnterprise"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterList.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterList.java index 0eb1714d10151..67ff740c212d5 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterList.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response of a list-all operation. */ @Fluent public final class ClusterList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterList.class); - /* * List of clusters. */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java index 88b8de0bd5e97..9bc6e0f2ebf54 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterProperties; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** A partial update to the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class ClusterUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); - +public final class ClusterUpdate { /* * The SKU to create, which affects price, performance, and features. */ @@ -26,47 +22,17 @@ public class ClusterUpdate { private Sku sku; /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * The minimum TLS version for the cluster to support, e.g. '1.2' - */ - @JsonProperty(value = "properties.minimumTlsVersion") - private TlsVersion minimumTlsVersion; - - /* - * DNS name of the cluster endpoint - */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; - - /* - * Current provisioning status of the cluster - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the cluster + * RedisEnterprise cluster properties Other properties of the cluster. */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; /* - * Version of redis the cluster supports, e.g. '6' - */ - @JsonProperty(value = "properties.redisVersion", access = JsonProperty.Access.WRITE_ONLY) - private String redisVersion; - - /* - * List of private endpoint connections associated with the specified - * RedisEnterprise cluster + * Resource tags. */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; /** * Get the sku property: The SKU to create, which affects price, performance, and features. @@ -88,6 +54,15 @@ public ClusterUpdate withSku(Sku sku) { return this; } + /** + * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + /** * Get the tags property: Resource tags. * @@ -114,7 +89,7 @@ public ClusterUpdate withTags(Map tags) { * @return the minimumTlsVersion value. */ public TlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); } /** @@ -124,7 +99,10 @@ public TlsVersion minimumTlsVersion() { * @return the ClusterUpdate object itself. */ public ClusterUpdate withMinimumTlsVersion(TlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); return this; } @@ -134,7 +112,7 @@ public ClusterUpdate withMinimumTlsVersion(TlsVersion minimumTlsVersion) { * @return the hostname value. */ public String hostname() { - return this.hostname; + return this.innerProperties() == null ? null : this.innerProperties().hostname(); } /** @@ -143,7 +121,7 @@ public String hostname() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -152,7 +130,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -161,7 +139,7 @@ public ResourceState resourceState() { * @return the redisVersion value. */ public String redisVersion() { - return this.redisVersion; + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); } /** @@ -171,7 +149,7 @@ public String redisVersion() { * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** @@ -183,8 +161,8 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java index 033afa8b0349f..782786d896bf0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java @@ -91,6 +91,13 @@ public interface Database { */ List modules(); + /** + * Gets the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @return the geoReplication value. + */ + DatabasePropertiesGeoReplication geoReplication(); + /** * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner object. * @@ -128,7 +135,8 @@ interface WithCreate DefinitionStages.WithClusteringPolicy, DefinitionStages.WithEvictionPolicy, DefinitionStages.WithPersistence, - DefinitionStages.WithModules { + DefinitionStages.WithModules, + DefinitionStages.WithGeoReplication { /** * Executes the create request. * @@ -210,6 +218,17 @@ interface WithModules { */ WithCreate withModules(List modules); } + /** The stage of the Database definition allowing to specify geoReplication. */ + interface WithGeoReplication { + /** + * Specifies the geoReplication property: Optional set of properties to configure geo replication for this + * database.. + * + * @param geoReplication Optional set of properties to configure geo replication for this database. + * @return the next definition stage. + */ + WithCreate withGeoReplication(DatabasePropertiesGeoReplication geoReplication); + } } /** * Begins update for the Database resource. @@ -220,11 +239,7 @@ interface WithModules { /** The template for Database update. */ interface Update - extends UpdateStages.WithClientProtocol, - UpdateStages.WithClusteringPolicy, - UpdateStages.WithEvictionPolicy, - UpdateStages.WithPersistence, - UpdateStages.WithModules { + extends UpdateStages.WithClientProtocol, UpdateStages.WithEvictionPolicy, UpdateStages.WithPersistence { /** * Executes the update request. * @@ -254,17 +269,6 @@ interface WithClientProtocol { */ Update withClientProtocol(Protocol clientProtocol); } - /** The stage of the Database update allowing to specify clusteringPolicy. */ - interface WithClusteringPolicy { - /** - * Specifies the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create - * time.. - * - * @param clusteringPolicy Clustering policy - default is OSSCluster. Specified at create time. - * @return the next definition stage. - */ - Update withClusteringPolicy(ClusteringPolicy clusteringPolicy); - } /** The stage of the Database update allowing to specify evictionPolicy. */ interface WithEvictionPolicy { /** @@ -285,18 +289,6 @@ interface WithPersistence { */ Update withPersistence(Persistence persistence); } - /** The stage of the Database update allowing to specify modules. */ - interface WithModules { - /** - * Specifies the modules property: Optional set of redis modules to enable in this database - modules can - * only be added at creation time.. - * - * @param modules Optional set of redis modules to enable in this database - modules can only be added at - * creation time. - * @return the next definition stage. - */ - Update withModules(List modules); - } } /** * Refreshes the resource to sync with Azure. @@ -318,7 +310,7 @@ interface WithModules { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys listKeys(); @@ -329,7 +321,7 @@ interface WithModules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response}. */ Response listKeysWithResponse(Context context); @@ -340,7 +332,7 @@ interface WithModules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters); @@ -352,12 +344,12 @@ interface WithModules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters, Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param parameters Storage information for importing into the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -367,7 +359,7 @@ interface WithModules { void importMethod(ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param parameters Storage information for importing into the cluster. * @param context The context to associate with this operation. @@ -397,4 +389,25 @@ interface WithModules { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void export(ExportClusterParameters parameters, Context context); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void forceUnlink(ForceUnlinkParameters parameters); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void forceUnlink(ForceUnlinkParameters parameters, Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseList.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseList.java index 3c643d2452087..bafe21aab31d7 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseList.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response of a list-all operation. */ @Fluent public final class DatabaseList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseList.class); - /* * List of databases */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabasePropertiesGeoReplication.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabasePropertiesGeoReplication.java new file mode 100644 index 0000000000000..57f374a24bfe2 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabasePropertiesGeoReplication.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Optional set of properties to configure geo replication for this database. */ +@Fluent +public final class DatabasePropertiesGeoReplication { + /* + * Name for the group of linked database resources + */ + @JsonProperty(value = "groupNickname") + private String groupNickname; + + /* + * List of database resources to link with this database + */ + @JsonProperty(value = "linkedDatabases") + private List linkedDatabases; + + /** + * Get the groupNickname property: Name for the group of linked database resources. + * + * @return the groupNickname value. + */ + public String groupNickname() { + return this.groupNickname; + } + + /** + * Set the groupNickname property: Name for the group of linked database resources. + * + * @param groupNickname the groupNickname value to set. + * @return the DatabasePropertiesGeoReplication object itself. + */ + public DatabasePropertiesGeoReplication withGroupNickname(String groupNickname) { + this.groupNickname = groupNickname; + return this; + } + + /** + * Get the linkedDatabases property: List of database resources to link with this database. + * + * @return the linkedDatabases value. + */ + public List linkedDatabases() { + return this.linkedDatabases; + } + + /** + * Set the linkedDatabases property: List of database resources to link with this database. + * + * @param linkedDatabases the linkedDatabases value to set. + * @return the DatabasePropertiesGeoReplication object itself. + */ + public DatabasePropertiesGeoReplication withLinkedDatabases(List linkedDatabases) { + this.linkedDatabases = linkedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkedDatabases() != null) { + linkedDatabases().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java index 0bcb8abbd1362..39a0c0d5bad0d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java @@ -5,68 +5,27 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A partial update to the RedisEnterprise database. */ -@JsonFlatten @Fluent -public class DatabaseUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseUpdate.class); - - /* - * Specifies whether redis clients can connect using TLS-encrypted or - * plaintext redis protocols. Default is TLS-encrypted. - */ - @JsonProperty(value = "properties.clientProtocol") - private Protocol clientProtocol; - - /* - * TCP port of the database endpoint. Specified at create time. Defaults to - * an available port. - */ - @JsonProperty(value = "properties.port") - private Integer port; - - /* - * Current provisioning status of the database - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the database - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Clustering policy - default is OSSCluster. Specified at create time. - */ - @JsonProperty(value = "properties.clusteringPolicy") - private ClusteringPolicy clusteringPolicy; - +public final class DatabaseUpdate { /* - * Redis eviction policy - default is VolatileLRU + * RedisEnterprise database properties Properties of the database. */ - @JsonProperty(value = "properties.evictionPolicy") - private EvictionPolicy evictionPolicy; + @JsonProperty(value = "properties") + private DatabaseProperties innerProperties; - /* - * Persistence settings - */ - @JsonProperty(value = "properties.persistence") - private Persistence persistence; - - /* - * Optional set of redis modules to enable in this database - modules can - * only be added at creation time. + /** + * Get the innerProperties property: RedisEnterprise database properties Properties of the database. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.modules") - private List modules; + private DatabaseProperties innerProperties() { + return this.innerProperties; + } /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext @@ -75,7 +34,7 @@ public class DatabaseUpdate { * @return the clientProtocol value. */ public Protocol clientProtocol() { - return this.clientProtocol; + return this.innerProperties() == null ? null : this.innerProperties().clientProtocol(); } /** @@ -86,7 +45,10 @@ public Protocol clientProtocol() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withClientProtocol(Protocol clientProtocol) { - this.clientProtocol = clientProtocol; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClientProtocol(clientProtocol); return this; } @@ -97,7 +59,7 @@ public DatabaseUpdate withClientProtocol(Protocol clientProtocol) { * @return the port value. */ public Integer port() { - return this.port; + return this.innerProperties() == null ? null : this.innerProperties().port(); } /** @@ -108,7 +70,10 @@ public Integer port() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withPort(Integer port) { - this.port = port; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPort(port); return this; } @@ -118,7 +83,7 @@ public DatabaseUpdate withPort(Integer port) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -127,7 +92,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -136,7 +101,7 @@ public ResourceState resourceState() { * @return the clusteringPolicy value. */ public ClusteringPolicy clusteringPolicy() { - return this.clusteringPolicy; + return this.innerProperties() == null ? null : this.innerProperties().clusteringPolicy(); } /** @@ -146,7 +111,10 @@ public ClusteringPolicy clusteringPolicy() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - this.clusteringPolicy = clusteringPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClusteringPolicy(clusteringPolicy); return this; } @@ -156,7 +124,7 @@ public DatabaseUpdate withClusteringPolicy(ClusteringPolicy clusteringPolicy) { * @return the evictionPolicy value. */ public EvictionPolicy evictionPolicy() { - return this.evictionPolicy; + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); } /** @@ -166,7 +134,10 @@ public EvictionPolicy evictionPolicy() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withEvictionPolicy(EvictionPolicy evictionPolicy) { - this.evictionPolicy = evictionPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); return this; } @@ -176,7 +147,7 @@ public DatabaseUpdate withEvictionPolicy(EvictionPolicy evictionPolicy) { * @return the persistence value. */ public Persistence persistence() { - return this.persistence; + return this.innerProperties() == null ? null : this.innerProperties().persistence(); } /** @@ -186,7 +157,10 @@ public Persistence persistence() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withPersistence(Persistence persistence) { - this.persistence = persistence; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPersistence(persistence); return this; } @@ -197,7 +171,7 @@ public DatabaseUpdate withPersistence(Persistence persistence) { * @return the modules value. */ public List modules() { - return this.modules; + return this.innerProperties() == null ? null : this.innerProperties().modules(); } /** @@ -208,7 +182,33 @@ public List modules() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withModules(List modules) { - this.modules = modules; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withModules(modules); + return this; + } + + /** + * Get the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @return the geoReplication value. + */ + public DatabasePropertiesGeoReplication geoReplication() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplication(); + } + + /** + * Set the geoReplication property: Optional set of properties to configure geo replication for this database. + * + * @param geoReplication the geoReplication value to set. + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withGeoReplication(DatabasePropertiesGeoReplication geoReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withGeoReplication(geoReplication); return this; } @@ -218,11 +218,8 @@ public DatabaseUpdate withModules(List modules) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java index ec608137ddc25..2cea9c32c6d35 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java @@ -18,7 +18,7 @@ public interface Databases { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName); @@ -31,7 +31,7 @@ public interface Databases { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified RedisEnterprise cluster. + * @return all databases in the specified RedisEnterprise cluster as paginated response with {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); @@ -58,7 +58,7 @@ public interface Databases { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String clusterName, String databaseName, Context context); @@ -97,7 +97,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -111,7 +111,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys along with {@link Response}. */ Response listKeysWithResponse( String resourceGroupName, String clusterName, String databaseName, Context context); @@ -126,7 +126,7 @@ Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters); @@ -142,7 +142,7 @@ AccessKeys regenerateKey( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey( String resourceGroupName, @@ -152,7 +152,7 @@ AccessKeys regenerateKey( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -166,7 +166,7 @@ void importMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -216,6 +216,39 @@ void export( ExportClusterParameters parameters, Context context); + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void forceUnlink( + String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters); + + /** + * Forcibly removes the link to the specified database resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the database to be unlinked. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void forceUnlink( + String resourceGroupName, + String clusterName, + String databaseName, + ForceUnlinkParameters parameters, + Context context); + /** * Gets information about a database in a RedisEnterprise cluster. * @@ -223,7 +256,7 @@ void export( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ Database getById(String id); @@ -235,7 +268,7 @@ void export( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java index 002784922ec99..a2c7d1abc143c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Parameters for a Redis Enterprise export operation. */ +/** Export an RDB file into a target database Parameters for a Redis Enterprise export operation. */ @Fluent public final class ExportClusterParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportClusterParameters.class); - /* * SAS URI for the target directory to export to */ @@ -47,9 +44,11 @@ public ExportClusterParameters withSasUri(String sasUri) { */ public void validate() { if (sasUri() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sasUri in model ExportClusterParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ExportClusterParameters.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceUnlinkParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceUnlinkParameters.java new file mode 100644 index 0000000000000..fd54ab3302cb1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceUnlinkParameters.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Forcibly unlink another database from this database. Parameters for a Redis Enterprise Active Geo Replication Force + * Unlink operation. + */ +@Fluent +public final class ForceUnlinkParameters { + /* + * The resource IDs of the database resources to be unlinked. + */ + @JsonProperty(value = "ids", required = true) + private List ids; + + /** + * Get the ids property: The resource IDs of the database resources to be unlinked. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: The resource IDs of the database resources to be unlinked. + * + * @param ids the ids value to set. + * @return the ForceUnlinkParameters object itself. + */ + public ForceUnlinkParameters withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ids() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ids in model ForceUnlinkParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ForceUnlinkParameters.class); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java index 872f97600235d..ead15e3d54bde 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java @@ -6,37 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Parameters for a Redis Enterprise import operation. */ +/** Import RDB files into a target database Parameters for a Redis Enterprise import operation. */ @Fluent public final class ImportClusterParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportClusterParameters.class); - /* - * SAS URI for the target blob to import from + * SAS URIs for the target blobs to import from */ - @JsonProperty(value = "sasUri", required = true) - private String sasUri; + @JsonProperty(value = "sasUris", required = true) + private List sasUris; /** - * Get the sasUri property: SAS URI for the target blob to import from. + * Get the sasUris property: SAS URIs for the target blobs to import from. * - * @return the sasUri value. + * @return the sasUris value. */ - public String sasUri() { - return this.sasUri; + public List sasUris() { + return this.sasUris; } /** - * Set the sasUri property: SAS URI for the target blob to import from. + * Set the sasUris property: SAS URIs for the target blobs to import from. * - * @param sasUri the sasUri value to set. + * @param sasUris the sasUris value to set. * @return the ImportClusterParameters object itself. */ - public ImportClusterParameters withSasUri(String sasUri) { - this.sasUri = sasUri; + public ImportClusterParameters withSasUris(List sasUris) { + this.sasUris = sasUris; return this; } @@ -46,10 +44,12 @@ public ImportClusterParameters withSasUri(String sasUri) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sasUri() == null) { - throw logger + if (sasUris() == null) { + throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property sasUri in model ImportClusterParameters")); + new IllegalArgumentException("Missing required property sasUris in model ImportClusterParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImportClusterParameters.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkState.java new file mode 100644 index 0000000000000..4f60c17b9861f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinkState. */ +public final class LinkState extends ExpandableStringEnum { + /** Static value Linked for LinkState. */ + public static final LinkState LINKED = fromString("Linked"); + + /** Static value Linking for LinkState. */ + public static final LinkState LINKING = fromString("Linking"); + + /** Static value Unlinking for LinkState. */ + public static final LinkState UNLINKING = fromString("Unlinking"); + + /** Static value LinkFailed for LinkState. */ + public static final LinkState LINK_FAILED = fromString("LinkFailed"); + + /** Static value UnlinkFailed for LinkState. */ + public static final LinkState UNLINK_FAILED = fromString("UnlinkFailed"); + + /** + * Creates or finds a LinkState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkState. + */ + @JsonCreator + public static LinkState fromString(String name) { + return fromString(name, LinkState.class); + } + + /** @return known LinkState values. */ + public static Collection values() { + return values(LinkState.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkedDatabase.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkedDatabase.java new file mode 100644 index 0000000000000..48d5fe1a03207 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkedDatabase.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Linked Database Specifies details of a linked database resource. */ +@Fluent +public final class LinkedDatabase { + /* + * Resource ID of a database resource to link with this database. + */ + @JsonProperty(value = "id") + private String id; + + /* + * State of the link between the database resources. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private LinkState state; + + /** + * Get the id property: Resource ID of a database resource to link with this database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of a database resource to link with this database. + * + * @param id the id value to set. + * @return the LinkedDatabase object itself. + */ + public LinkedDatabase withId(String id) { + this.id = id; + return this; + } + + /** + * Get the state property: State of the link between the database resources. + * + * @return the state value. + */ + public LinkState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java index cd014bb8cc023..919a6f864eeee 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies configuration of a redis module. */ +/** Module settings Specifies configuration of a redis module. */ @Fluent public final class Module { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Module.class); - /* * The name of the module, e.g. 'RedisBloom', 'RediSearch', * 'RedisTimeSeries' @@ -22,7 +19,7 @@ public final class Module { private String name; /* - * Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE + * Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE * 400'. */ @JsonProperty(value = "args") @@ -55,7 +52,7 @@ public Module withName(String name) { } /** - * Get the args property: Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. + * Get the args property: Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. * * @return the args value. */ @@ -64,7 +61,7 @@ public String args() { } /** - * Set the args property: Configuration options for the module, e.g. 'ERROR_RATE 0.00 INITIAL_SIZE 400'. + * Set the args property: Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. * * @param args the args value to set. * @return the Module object itself. @@ -90,8 +87,10 @@ public String version() { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Module")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Module.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationDisplay.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationDisplay.java index bfd0182e5828e..cd2543f363ebc 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationDisplay.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Localized display information for this particular operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * The localized friendly form of the resource provider name, e.g. * "Microsoft Monitoring Insights" or "Microsoft Compute". diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationListResult.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationListResult.java index cb9fb362c14bd..a40792a91118b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationListResult.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * List of operations supported by the resource provider */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java index c5e2593dd468c..384c42984a4ac 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java @@ -45,7 +45,7 @@ public interface OperationStatus { String status(); /** - * Gets the error property: Error response describing why the operation failed. + * Gets the error property: Error response Error response describing why the operation failed. * * @return the error value. */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operations.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operations.java index 756a12edafda5..95ad8762dacd0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operations.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operations.java @@ -14,7 +14,8 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -25,7 +26,8 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java index 75f434a19e3ce..98c0662950f36 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java @@ -30,7 +30,7 @@ public interface OperationsStatus { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of operation. + * @return the status of operation along with {@link Response}. */ Response getWithResponse(String location, String operationId, Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java index df4f7aac65931..da8259c43822f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Persistence-related configuration for the RedisEnterprise database. */ +/** Persistence settings Persistence-related configuration for the RedisEnterprise database. */ @Fluent public final class Persistence { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Persistence.class); - /* * Sets whether AOF is enabled. */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpoint.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpoint.java index a8302751c98a5..05330d7c773c9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpoint.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpoint.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint resource. */ @Immutable public final class PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); - /* * The ARM identifier for Private Endpoint */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionListResult.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionListResult.java index 6256744959c23..ea2819c1fd250 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionListResult.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of private endpoint connection associated with the specified storage account. */ @Fluent public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - /* * Array of private endpoint connections */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnections.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnections.java index 0dd355b434e95..e0456b3d22dd4 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnections.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnections.java @@ -18,7 +18,8 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName); @@ -31,7 +32,8 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String clusterName, Context context); @@ -60,7 +62,8 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response}. */ Response getWithResponse( String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); @@ -89,7 +92,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); @@ -101,7 +104,8 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response}. */ PrivateEndpointConnection getById(String id); @@ -113,7 +117,8 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the RedisEnterprise cluster. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster along with {@link + * Response}. */ Response getByIdWithResponse(String id, Context context); @@ -135,7 +140,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResourceListResult.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResourceListResult.java index 225976b0bdb63..6623effd32d0e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResourceListResult.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResourceListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of private link resources. */ @Fluent public final class PrivateLinkResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); - /* * Array of private link resources */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java index 2d3a7aae02782..ed9d89094ddb8 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java @@ -17,7 +17,8 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName); @@ -30,7 +31,8 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a RedisEnterprise cluster. + * @return the private link resources that need to be created for a RedisEnterprise cluster as paginated response + * with {@link PagedIterable}. */ PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkServiceConnectionState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkServiceConnectionState.java index a113e55630dbd..780fa66fe7a8a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkServiceConnectionState.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkServiceConnectionState.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A collection of information about the state of the connection between service consumer and provider. */ @Fluent public final class PrivateLinkServiceConnectionState { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); - /* * Indicates whether the connection has been Approved/Rejected/Removed by * the owner of the service. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedisEnterprises.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedisEnterprises.java index 02116419f674a..c3df60c08f991 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedisEnterprises.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedisEnterprises.java @@ -54,7 +54,7 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); @@ -65,7 +65,7 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -77,7 +77,7 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list-all operation. + * @return the response of a list-all operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -86,7 +86,8 @@ public interface RedisEnterprises { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -97,7 +98,8 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all RedisEnterprise clusters in the specified subscription. + * @return all RedisEnterprise clusters in the specified subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); @@ -108,7 +110,7 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ Cluster getById(String id); @@ -120,7 +122,7 @@ public interface RedisEnterprises { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java index 545ec905c946b..6a3c2a4c13e62 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies which access keys to reset to a new random value. */ +/** Regenerate access keys request Specifies which access keys to reset to a new random value. */ @Fluent public final class RegenerateKeyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateKeyParameters.class); - /* * Which access key to regenerate. */ @@ -47,9 +44,11 @@ public RegenerateKeyParameters withKeyType(AccessKeyType keyType) { */ public void validate() { if (keyType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property keyType in model RegenerateKeyParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateKeyParameters.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Sku.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Sku.java index 9fbcc321f88a0..299c6e4164f22 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Sku.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Sku.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** SKU parameters supplied to the create RedisEnterprise operation. */ @Fluent public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - /* * The type of RedisEnterprise cluster to deploy. Possible values: * (Enterprise_E10, EnterpriseFlash_F300 etc.) @@ -80,8 +77,10 @@ public Sku withCapacity(Integer capacity) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.java new file mode 100644 index 0000000000000..ebbd81f863473 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import com.azure.resourcemanager.redisenterprise.models.Module; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import java.util.Arrays; + +/** Samples for Databases Create. */ +public final class DatabasesCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesCreate( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .define("default") + .withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withAofEnabled(true).withAofFrequency(AofFrequency.ONES)) + .withModules( + Arrays + .asList( + new Module().withName("RedisBloom").withArgs("ERROR_RATE 0.00 INITIAL_SIZE 400"), + new Module().withName("RedisTimeSeries").withArgs("RETENTION_POLICY 20"), + new Module().withName("RediSearch"))) + .create(); + } + + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesCreateWithActiveGeoReplication( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .define("default") + .withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) + .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("groupName") + .withLinkedDatabases( + Arrays + .asList( + new LinkedDatabase() + .withId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + new LinkedDatabase() + .withId( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")))) + .create(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java new file mode 100644 index 0000000000000..b0c5d0b23ba60 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases Delete. */ +public final class DatabasesDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesDelete.json + */ + /** + * Sample code: RedisEnterpriseDatabasesDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesDelete( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().delete("rg1", "cache1", "db1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.java new file mode 100644 index 0000000000000..6d500ad257d95 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; + +/** Samples for Databases Export. */ +public final class DatabasesExportSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesExport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesExport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesExport( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .export( + "rg1", + "cache1", + "default", + new ExportClusterParameters() + .withSasUri("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkSamples.java new file mode 100644 index 0000000000000..96b4a7c794204 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; +import java.util.Arrays; + +/** Samples for Databases ForceUnlink. */ +public final class DatabasesForceUnlinkSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesForceUnlink.json + */ + /** + * Sample code: How to unlink a database during a regional outage. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToUnlinkADatabaseDuringARegionalOutage( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .forceUnlink( + "rg1", + "cache1", + "default", + new ForceUnlinkParameters() + .withIds( + Arrays + .asList( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java new file mode 100644 index 0000000000000..dccbf4506d7f2 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases Get. */ +public final class DatabasesGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesGet.json + */ + /** + * Sample code: RedisEnterpriseDatabasesGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesGet( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java new file mode 100644 index 0000000000000..37665f5f0ea22 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; + +/** Samples for Databases ImportMethod. */ +public final class DatabasesImportMethodSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesImport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesImport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesImport( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .importMethod( + "rg1", + "cache1", + "default", + new ImportClusterParameters() + .withSasUris( + Arrays + .asList( + "https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters", + "https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java new file mode 100644 index 0000000000000..645a4336e11e1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases ListByCluster. */ +public final class DatabasesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListByCluster.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListByCluster. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesListByCluster( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listByCluster("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java new file mode 100644 index 0000000000000..36d9b2b6c87fd --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases ListKeys. */ +public final class DatabasesListKeysSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesListKeys.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListKeys. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesListKeys( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listKeysWithResponse("rg1", "cache1", "default", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.java new file mode 100644 index 0000000000000..d9603e2e41505 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.AccessKeyType; +import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; + +/** Samples for Databases RegenerateKey. */ +public final class DatabasesRegenerateKeySamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesRegenerateKey.json + */ + /** + * Sample code: RedisEnterpriseDatabasesRegenerateKey. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesRegenerateKey( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .regenerateKey( + "rg1", + "cache1", + "default", + new RegenerateKeyParameters().withKeyType(AccessKeyType.PRIMARY), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.java new file mode 100644 index 0000000000000..a8fb3c81d85d6 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; + +/** Samples for Databases Update. */ +public final class DatabasesUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesUpdate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesUpdate( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Database resource = manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE).getValue(); + resource + .update() + .withClientProtocol(Protocol.ENCRYPTED) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) + .apply(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..8a9922709fe77 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java new file mode 100644 index 0000000000000..b8071d5218ad4 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationsStatus Get. */ +public final class OperationsStatusGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/OperationsStatusGet.json + */ + /** + * Sample code: OperationsStatusGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsStatusGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operationsStatus().getWithResponse("West US", "testoperationid", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..972dcdb3cefae --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDeletePrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..ff60589920393 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGetPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().getWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..ff7836df79376 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisEnterpriseListPrivateEndpointConnections. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateEndpointConnections( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().list("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..7b661ef47e303 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterprisePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterprisePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterprisePutPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .privateEndpointConnections() + .define("pectest01") + .withExistingRedisEnterprise("rg1", "cache1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java new file mode 100644 index 0000000000000..3a84b7d8e806f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByCluster. */ +public final class PrivateLinkResourcesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListPrivateLinkResources.json + */ + /** + * Sample code: RedisEnterpriseListPrivateLinkResources. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateLinkResources( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateLinkResources().listByCluster("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java new file mode 100644 index 0000000000000..31ea01667211e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Create. */ +public final class RedisEnterpriseCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseCreate.json + */ + /** + * Sample code: RedisEnterpriseCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseCreate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .redisEnterprises() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(3)) + .withTags(mapOf("tag1", "value1")) + .withZones(Arrays.asList("1", "2", "3")) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java new file mode 100644 index 0000000000000..0a0f0070a401c --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise Delete. */ +public final class RedisEnterpriseDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDelete.json + */ + /** + * Sample code: RedisEnterpriseDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().delete("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3942e555d88f3 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise GetByResourceGroup. */ +public final class RedisEnterpriseGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseGet.json + */ + /** + * Sample code: RedisEnterpriseGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java new file mode 100644 index 0000000000000..09ceca6733b89 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise ListByResourceGroup. */ +public final class RedisEnterpriseListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseListByResourceGroup.json + */ + /** + * Sample code: RedisEnterpriseListByResourceGroup. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListByResourceGroup( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java new file mode 100644 index 0000000000000..f2dce7e7c9d66 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise List. */ +public final class RedisEnterpriseListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseList.json + */ + /** + * Sample code: RedisEnterpriseList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().list(Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java new file mode 100644 index 0000000000000..43b2c0f5b69f3 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Update. */ +public final class RedisEnterpriseUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseUpdate.json + */ + /** + * Sample code: RedisEnterpriseUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Cluster resource = + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}