diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md index 78cf51775afa..815944374ebc 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md @@ -1,14 +1,89 @@ # Release History -## 1.1.0-beta.2 (Unreleased) +## 1.1.0-beta.2 (2023-03-13) + +- 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-preview-2023-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.ManagedServiceIdentity` was added + +* `models.Name` was added + +* `models.UserAssignedIdentity` was added + +* `models.SkuDetail` was added + +* `models.LocationInfo` was added + +* `models.RegionSkuDetail` was added + +* `models.Capability` was added + +* `models.ClusterPropertiesEncryption` was added + +* `models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity` was added + +* `models.RegionSkuDetails` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.FlushParameters` was added + +* `models.CmkIdentityType` was added + +* `models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption` was added + +* `models.Skus` was added + +#### `models.ClusterUpdate` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withEncryption(models.ClusterPropertiesEncryption)` was added +* `encryption()` was added +* `identity()` was added -### Bugs Fixed +#### `models.PrivateLinkResource` was modified + +* `systemData()` was added + +#### `models.Cluster$Update` was modified + +* `withEncryption(models.ClusterPropertiesEncryption)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `RedisEnterpriseManager` was modified + +* `skus()` was added + +#### `models.Cluster$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withEncryption(models.ClusterPropertiesEncryption)` was added + +#### `models.Database` was modified + +* `flush(models.FlushParameters,com.azure.core.util.Context)` was added +* `flush(models.FlushParameters)` was added +* `resourceGroupName()` was added +* `systemData()` was added + +#### `models.PrivateEndpointConnection` was modified + +* `resourceGroupName()` was added +* `systemData()` was added + +#### `models.Cluster` was modified + +* `identity()` was added +* `resourceGroupName()` was added +* `systemData()` was added +* `encryption()` was added + +#### `models.Databases` was modified -### Other Changes +* `flush(java.lang.String,java.lang.String,java.lang.String,models.FlushParameters,com.azure.core.util.Context)` was added +* `flush(java.lang.String,java.lang.String,java.lang.String,models.FlushParameters)` was added ## 1.1.0-beta.1 (2022-04-19) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md index da72586167c0..18fd122d1af4 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-2022-01. 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-preview-2023-03. 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.1.0-beta.1 + 1.1.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md index b105a7c11110..c1913a573123 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md @@ -6,6 +6,7 @@ - [Create](#databases_create) - [Delete](#databases_delete) - [Export](#databases_export) +- [Flush](#databases_flush) - [ForceUnlink](#databases_forceunlink) - [Get](#databases_get) - [ImportMethod](#databases_importmethod) @@ -41,6 +42,10 @@ - [List](#redisenterprise_list) - [ListByResourceGroup](#redisenterprise_listbyresourcegroup) - [Update](#redisenterprise_update) + +## Skus + +- [List](#skus_list) ### Databases_Create ```java @@ -57,7 +62,7 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate. @@ -85,7 +90,7 @@ public final class DatabasesCreateSamples { } /* - * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json */ /** * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. @@ -122,12 +127,10 @@ public final class DatabasesCreateSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesDelete.json */ /** * Sample code: RedisEnterpriseDatabasesDelete. @@ -136,7 +139,7 @@ public final class DatabasesDeleteSamples { */ public static void redisEnterpriseDatabasesDelete( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().delete("rg1", "cache1", "db1", Context.NONE); + manager.databases().delete("rg1", "cache1", "db1", com.azure.core.util.Context.NONE); } } ``` @@ -144,13 +147,12 @@ public final class DatabasesDeleteSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesExport.json */ /** * Sample code: RedisEnterpriseDatabasesExport. @@ -167,7 +169,41 @@ public final class DatabasesExportSamples { "default", new ExportClusterParameters() .withSasUri("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), - Context.NONE); + com.azure.core.util.Context.NONE); + } +} +``` + +### Databases_Flush + +```java +import com.azure.resourcemanager.redisenterprise.models.FlushParameters; +import java.util.Arrays; + +/** Samples for Databases Flush. */ +public final class DatabasesFlushSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesFlush.json + */ + /** + * Sample code: How to flush all the keys in the database. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToFlushAllTheKeysInTheDatabase( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .flush( + "rg1", + "cache1", + "default", + new FlushParameters() + .withIds( + Arrays + .asList( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + com.azure.core.util.Context.NONE); } } ``` @@ -175,14 +211,13 @@ public final class DatabasesExportSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesForceUnlink.json */ /** * Sample code: How to unlink a database during a regional outage. @@ -202,7 +237,7 @@ public final class DatabasesForceUnlinkSamples { Arrays .asList( "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -210,12 +245,10 @@ public final class DatabasesForceUnlinkSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesGet.json */ /** * Sample code: RedisEnterpriseDatabasesGet. @@ -224,7 +257,7 @@ public final class DatabasesGetSamples { */ public static void redisEnterpriseDatabasesGet( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE); + manager.databases().getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE); } } ``` @@ -232,14 +265,13 @@ public final class DatabasesGetSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesImport.json */ /** * Sample code: RedisEnterpriseDatabasesImport. @@ -260,7 +292,7 @@ public final class DatabasesImportMethodSamples { .asList( "https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters", "https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -268,12 +300,10 @@ public final class DatabasesImportMethodSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesListByCluster.json */ /** * Sample code: RedisEnterpriseDatabasesListByCluster. @@ -282,7 +312,7 @@ public final class DatabasesListByClusterSamples { */ public static void redisEnterpriseDatabasesListByCluster( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().listByCluster("rg1", "cache1", Context.NONE); + manager.databases().listByCluster("rg1", "cache1", com.azure.core.util.Context.NONE); } } ``` @@ -290,12 +320,10 @@ public final class DatabasesListByClusterSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesListKeys.json */ /** * Sample code: RedisEnterpriseDatabasesListKeys. @@ -304,7 +332,7 @@ public final class DatabasesListKeysSamples { */ public static void redisEnterpriseDatabasesListKeys( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().listKeysWithResponse("rg1", "cache1", "default", Context.NONE); + manager.databases().listKeysWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE); } } ``` @@ -312,14 +340,13 @@ public final class DatabasesListKeysSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesRegenerateKey.json */ /** * Sample code: RedisEnterpriseDatabasesRegenerateKey. @@ -335,7 +362,7 @@ public final class DatabasesRegenerateKeySamples { "cache1", "default", new RegenerateKeyParameters().withKeyType(AccessKeyType.PRIMARY), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -343,7 +370,6 @@ public final class DatabasesRegenerateKeySamples { ### 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; @@ -353,7 +379,7 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesUpdate.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate. @@ -362,7 +388,11 @@ public final class DatabasesUpdateSamples { */ public static void redisEnterpriseDatabasesUpdate( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - Database resource = manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE).getValue(); + Database resource = + manager + .databases() + .getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withClientProtocol(Protocol.ENCRYPTED) @@ -376,12 +406,10 @@ public final class DatabasesUpdateSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/OperationsList.json */ /** * Sample code: OperationsList. @@ -389,7 +417,7 @@ public final class OperationsListSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void operationsList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -397,12 +425,10 @@ public final class OperationsListSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. @@ -410,7 +436,7 @@ public final class OperationsStatusGetSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void operationsStatusGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.operationsStatus().getWithResponse("West US", "testoperationid", Context.NONE); + manager.operationsStatus().getWithResponse("West US", "testoperationid", com.azure.core.util.Context.NONE); } } ``` @@ -418,12 +444,10 @@ public final class OperationsStatusGetSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDeletePrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. @@ -432,7 +456,9 @@ public final class PrivateEndpointConnectionsDeleteSamples { */ public static void redisEnterpriseDeletePrivateEndpointConnection( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + manager + .privateEndpointConnections() + .deleteWithResponse("rg1", "cache1", "pectest01", com.azure.core.util.Context.NONE); } } ``` @@ -440,12 +466,10 @@ public final class PrivateEndpointConnectionsDeleteSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseGetPrivateEndpointConnection. @@ -454,7 +478,9 @@ public final class PrivateEndpointConnectionsGetSamples { */ public static void redisEnterpriseGetPrivateEndpointConnection( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().getWithResponse("rg1", "cache1", "pectest01", Context.NONE); + manager + .privateEndpointConnections() + .getWithResponse("rg1", "cache1", "pectest01", com.azure.core.util.Context.NONE); } } ``` @@ -462,12 +488,10 @@ public final class PrivateEndpointConnectionsGetSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListPrivateEndpointConnections.json */ /** * Sample code: RedisEnterpriseListPrivateEndpointConnections. @@ -476,7 +500,7 @@ public final class PrivateEndpointConnectionsListSamples { */ public static void redisEnterpriseListPrivateEndpointConnections( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().list("rg1", "cache1", Context.NONE); + manager.privateEndpointConnections().list("rg1", "cache1", com.azure.core.util.Context.NONE); } } ``` @@ -490,7 +514,7 @@ import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnec /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json */ /** * Sample code: RedisEnterprisePutPrivateEndpointConnection. @@ -515,12 +539,10 @@ public final class PrivateEndpointConnectionsPutSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListPrivateLinkResources.json */ /** * Sample code: RedisEnterpriseListPrivateLinkResources. @@ -529,7 +551,7 @@ public final class PrivateLinkResourcesListByClusterSamples { */ public static void redisEnterpriseListPrivateLinkResources( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateLinkResources().listByCluster("rg1", "cache1", Context.NONE); + manager.privateLinkResources().listByCluster("rg1", "cache1", com.azure.core.util.Context.NONE); } } ``` @@ -537,9 +559,16 @@ public final class PrivateLinkResourcesListByClusterSamples { ### RedisEnterprise_Create ```java +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.redisenterprise.models.CmkIdentityType; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redisenterprise.models.Sku; import com.azure.resourcemanager.redisenterprise.models.SkuName; import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -547,7 +576,7 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseCreate.json */ /** * Sample code: RedisEnterpriseCreate. @@ -563,7 +592,24 @@ public final class RedisEnterpriseCreateSamples { .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(3)) .withTags(mapOf("tag1", "value1")) .withZones(Arrays.asList("1", "2", "3")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity", + new UserAssignedIdentity()))) .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withEncryption( + new ClusterPropertiesEncryption() + .withCustomerManagedKeyEncryption( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryption() + .withKeyEncryptionKeyIdentity( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() + .withUserAssignedIdentityResourceId( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity") + .withIdentityType(CmkIdentityType.USER_ASSIGNED_IDENTITY)) + .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) .create(); } @@ -583,12 +629,10 @@ public final class RedisEnterpriseCreateSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDelete.json */ /** * Sample code: RedisEnterpriseDelete. @@ -596,7 +640,7 @@ public final class RedisEnterpriseDeleteSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().delete("rg1", "cache1", Context.NONE); + manager.redisEnterprises().delete("rg1", "cache1", com.azure.core.util.Context.NONE); } } ``` @@ -604,12 +648,10 @@ public final class RedisEnterpriseDeleteSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseGet.json */ /** * Sample code: RedisEnterpriseGet. @@ -617,7 +659,7 @@ public final class RedisEnterpriseGetByResourceGroupSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); } } ``` @@ -625,12 +667,10 @@ public final class RedisEnterpriseGetByResourceGroupSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseList.json */ /** * Sample code: RedisEnterpriseList. @@ -638,7 +678,7 @@ public final class RedisEnterpriseListSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().list(Context.NONE); + manager.redisEnterprises().list(com.azure.core.util.Context.NONE); } } ``` @@ -646,12 +686,10 @@ public final class RedisEnterpriseListSamples { ### 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListByResourceGroup.json */ /** * Sample code: RedisEnterpriseListByResourceGroup. @@ -660,7 +698,7 @@ public final class RedisEnterpriseListByResourceGroupSamples { */ public static void redisEnterpriseListByResourceGroup( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().listByResourceGroup("rg1", Context.NONE); + manager.redisEnterprises().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); } } ``` @@ -668,7 +706,6 @@ public final class RedisEnterpriseListByResourceGroupSamples { ### 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; @@ -679,7 +716,7 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseUpdate.json */ /** * Sample code: RedisEnterpriseUpdate. @@ -688,7 +725,10 @@ public final class RedisEnterpriseUpdateSamples { */ public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { Cluster resource = - manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + manager + .redisEnterprises() + .getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withTags(mapOf("tag1", "value1")) @@ -710,3 +750,22 @@ public final class RedisEnterpriseUpdateSamples { } ``` +### Skus_List + +```java +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseSkusList.json + */ + /** + * Sample code: SkusList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void skusList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.skus().list("westus2", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index b73d474dd100..7d76d1be3d95 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ 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-2022-01. + 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-preview-2023-03. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 true @@ -52,5 +58,41 @@ azure-core-management 1.10.2 + + com.azure + azure-core-test + 1.15.0 + test + + + com.azure + azure-identity + 1.8.1 + test + + + org.junit.jupiter + junit-jupiter-api + 5.9.1 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.1 + test + + + org.mockito + mockito-core + 4.5.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + 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 5281eedfd232..1d019b609924 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 @@ -31,12 +31,14 @@ import com.azure.resourcemanager.redisenterprise.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.redisenterprise.implementation.RedisEnterpriseManagementClientBuilder; import com.azure.resourcemanager.redisenterprise.implementation.RedisEnterprisesImpl; +import com.azure.resourcemanager.redisenterprise.implementation.SkusImpl; import com.azure.resourcemanager.redisenterprise.models.Databases; import com.azure.resourcemanager.redisenterprise.models.Operations; import com.azure.resourcemanager.redisenterprise.models.OperationsStatus; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnections; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResources; import com.azure.resourcemanager.redisenterprise.models.RedisEnterprises; +import com.azure.resourcemanager.redisenterprise.models.Skus; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -58,6 +60,8 @@ public final class RedisEnterpriseManager { private PrivateLinkResources privateLinkResources; + private Skus skus; + private final RedisEnterpriseManagementClient clientObject; private RedisEnterpriseManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -223,7 +227,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.redisenterprise") .append("/") - .append("1.1.0-beta.1"); + .append("1.1.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -280,7 +284,11 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf } } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -288,7 +296,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of OperationsStatus. */ + /** + * Gets the resource collection API of OperationsStatus. + * + * @return Resource collection API of OperationsStatus. + */ public OperationsStatus operationsStatus() { if (this.operationsStatus == null) { this.operationsStatus = new OperationsStatusImpl(clientObject.getOperationsStatus(), this); @@ -296,7 +308,11 @@ public OperationsStatus operationsStatus() { return operationsStatus; } - /** @return Resource collection API of RedisEnterprises. */ + /** + * Gets the resource collection API of RedisEnterprises. It manages Cluster. + * + * @return Resource collection API of RedisEnterprises. + */ public RedisEnterprises redisEnterprises() { if (this.redisEnterprises == null) { this.redisEnterprises = new RedisEnterprisesImpl(clientObject.getRedisEnterprises(), this); @@ -304,7 +320,11 @@ public RedisEnterprises redisEnterprises() { return redisEnterprises; } - /** @return Resource collection API of Databases. */ + /** + * Gets the resource collection API of Databases. It manages Database. + * + * @return Resource collection API of Databases. + */ public Databases databases() { if (this.databases == null) { this.databases = new DatabasesImpl(clientObject.getDatabases(), this); @@ -312,7 +332,11 @@ public Databases databases() { return databases; } - /** @return Resource collection API of PrivateEndpointConnections. */ + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { this.privateEndpointConnections = @@ -321,7 +345,11 @@ public PrivateEndpointConnections privateEndpointConnections() { return privateEndpointConnections; } - /** @return Resource collection API of PrivateLinkResources. */ + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ public PrivateLinkResources privateLinkResources() { if (this.privateLinkResources == null) { this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); @@ -329,6 +357,18 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + /** * @return Wrapped service client RedisEnterpriseManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. 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 b891bda86a57..d1aae1395eaa 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.FlushParameters; import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; @@ -184,13 +185,15 @@ DatabaseInner update( * @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 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 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) - DatabaseInner get(String resourceGroupName, String clusterName, String databaseName); + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); /** * Gets information about a database in a RedisEnterprise cluster. @@ -198,15 +201,13 @@ DatabaseInner update( * @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 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 information about a database in a RedisEnterprise cluster along with {@link Response}. + * @return information about a database in a RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context); + DatabaseInner get(String resourceGroupName, String clusterName, String databaseName); /** * Deletes a single database. @@ -271,13 +272,15 @@ SyncPoller, Void> beginDelete( * @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 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 access keys. + * @return access keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName); + Response listKeysWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); /** * Retrieves the access keys for the RedisEnterprise database. @@ -285,15 +288,13 @@ SyncPoller, Void> beginDelete( * @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 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 access keys along with {@link Response}. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context); + AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName); /** * Regenerates the RedisEnterprise database's access keys. @@ -583,4 +584,67 @@ void forceUnlink( String databaseName, ForceUnlinkParameters parameters, Context context); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlush( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlush( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters, Context context); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters, 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 6030d77066ad..e45462b06ebb 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 @@ -15,27 +15,27 @@ public interface OperationsStatusClient { /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 status of operation. + * @return the status of operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String location, String operationId); + Response getWithResponse(String location, String operationId, Context context); /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. - * @param context The context to associate with this operation. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 status of operation along with {@link Response}. + * @return the status of operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String operationId, Context context); + OperationStatusInner get(String location, String operationId); } 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 490e4244a1ba..b54a00a48fc6 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 @@ -51,14 +51,16 @@ public interface PrivateEndpointConnectionsClient { * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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 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) - PrivateEndpointConnectionInner get( - String resourceGroupName, String clusterName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -67,16 +69,14 @@ PrivateEndpointConnectionInner get( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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 specified private endpoint connection associated with the RedisEnterprise cluster along with {@link - * Response}. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionInner get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName); /** * Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -169,12 +169,15 @@ PrivateEndpointConnectionInner put( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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 Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + Response deleteWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -183,13 +186,10 @@ PrivateEndpointConnectionInner put( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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 Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterpriseManagementClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterpriseManagementClient.java index b78ea349ab58..e1e773db6a07 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterpriseManagementClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterpriseManagementClient.java @@ -85,4 +85,11 @@ public interface RedisEnterpriseManagementClient { * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); } 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 0e7491928737..3f8e4c243f48 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 @@ -193,28 +193,28 @@ SyncPoller, ClusterInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. + * @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 information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); /** * Gets information about a RedisEnterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @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 information about a RedisEnterprise cluster along with {@link Response}. + * @return information about a RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); /** * Lists all RedisEnterprise clusters in a resource group. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/SkusClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/SkusClient.java new file mode 100644 index 000000000000..98d77370a874 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/SkusClient.java @@ -0,0 +1,41 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 information about skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, 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 b2b7e74f41c9..35d134e1b124 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 @@ -7,7 +7,11 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Access keys 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 { /* @@ -22,6 +26,10 @@ public final class AccessKeysInner { @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) private String secondaryKey; + /** Creates an instance of AccessKeysInner class. */ + public AccessKeysInner() { + } + /** * Get the primaryKey property: 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 968b0cca7812..5124741e5fae 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 @@ -6,7 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.ResourceState; import com.azure.resourcemanager.redisenterprise.models.Sku; @@ -31,11 +34,29 @@ public final class ClusterInner extends Resource { private List zones; /* - * RedisEnterprise cluster properties Other properties of the cluster. + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * RedisEnterprise cluster properties + * + * Other properties of the cluster. */ @JsonProperty(value = "properties") private ClusterProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + /** * Get the sku property: The SKU to create, which affects price, performance, and features. * @@ -77,7 +98,29 @@ public ClusterInner withZones(List zones) { } /** - * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: RedisEnterprise cluster properties + * + *

Other properties of the cluster. * * @return the innerProperties value. */ @@ -85,6 +128,15 @@ private ClusterProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public ClusterInner withLocation(String location) { @@ -122,6 +174,29 @@ public ClusterInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { return this; } + /** + * Get the encryption property: Encryption-at-rest configuration for the cluster. + * + * @return the encryption value. + */ + public ClusterPropertiesEncryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Encryption-at-rest configuration for the cluster. + * + * @param encryption the encryption value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEncryption(ClusterPropertiesEncryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -181,6 +256,9 @@ public void validate() { } else { sku().validate(); } + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } 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 index 431fa987f712..4a5059d7521b 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.ResourceState; import com.azure.resourcemanager.redisenterprise.models.TlsVersion; @@ -12,8 +13,9 @@ import java.util.List; /** - * RedisEnterprise cluster properties Properties of RedisEnterprise clusters, as opposed to general resource properties - * like location, tags. + * RedisEnterprise cluster properties + * + *

Properties of RedisEnterprise clusters, as opposed to general resource properties like location, tags. */ @Fluent public final class ClusterProperties { @@ -23,6 +25,12 @@ public final class ClusterProperties { @JsonProperty(value = "minimumTlsVersion") private TlsVersion minimumTlsVersion; + /* + * Encryption-at-rest configuration for the cluster. + */ + @JsonProperty(value = "encryption") + private ClusterPropertiesEncryption encryption; + /* * DNS name of the cluster endpoint */ @@ -48,12 +56,15 @@ public final class ClusterProperties { private String redisVersion; /* - * List of private endpoint connections associated with the specified - * RedisEnterprise cluster + * List of private endpoint connections associated with the specified RedisEnterprise cluster */ @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } + /** * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. * @@ -74,6 +85,26 @@ public ClusterProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { return this; } + /** + * Get the encryption property: Encryption-at-rest configuration for the cluster. + * + * @return the encryption value. + */ + public ClusterPropertiesEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption-at-rest configuration for the cluster. + * + * @param encryption the encryption value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withEncryption(ClusterPropertiesEncryption encryption) { + this.encryption = encryption; + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -126,6 +157,9 @@ public List privateEndpointConnections() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (encryption() != null) { + encryption().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 e9b8a3d0ae49..e3682443bb98 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; @@ -21,13 +22,27 @@ @Fluent public final class DatabaseInner extends ProxyResource { /* - * RedisEnterprise database properties Other properties of the database. + * RedisEnterprise database properties + * + * Other properties of the database. */ @JsonProperty(value = "properties") private DatabaseProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of DatabaseInner class. */ + public DatabaseInner() { + } + /** - * Get the innerProperties property: RedisEnterprise database properties Other properties of the database. + * Get the innerProperties property: RedisEnterprise database properties + * + *

Other properties of the database. * * @return the innerProperties value. */ @@ -35,6 +50,15 @@ private DatabaseProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. 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 index 346b8be291f8..41e9bed19b12 100644 --- 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 @@ -17,21 +17,21 @@ import java.util.List; /** - * RedisEnterprise database properties Properties of RedisEnterprise databases, as opposed to general resource - * properties like location, tags. + * 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. + * 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. + * TCP port of the database endpoint. Specified at create time. Defaults to an available port. */ @JsonProperty(value = "port") private Integer port; @@ -67,19 +67,21 @@ public final class DatabaseProperties { private Persistence persistence; /* - * Optional set of redis modules to enable in this database - modules can - * only be added at creation time. + * 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. + * Optional set of properties to configure geo replication for this database. */ @JsonProperty(value = "geoReplication") private DatabasePropertiesGeoReplication geoReplication; + /** Creates an instance of DatabaseProperties class. */ + public DatabaseProperties() { + } + /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. 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 b94d16ebc1d1..679f57b6c954 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 @@ -10,20 +10,23 @@ import com.azure.resourcemanager.redisenterprise.models.Origin; import com.fasterxml.jackson.annotation.JsonProperty; -/** REST API Operation 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 { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -35,19 +38,22 @@ public final class OperationInner { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". 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 242057dbaee6..0f2c8fa71b65 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 @@ -42,11 +42,17 @@ public final class OperationStatusInner { private String status; /* - * Error response Error response describing why the operation failed. + * Error response + * + * Error response describing why the operation failed. */ @JsonProperty(value = "error") private ManagementError error; + /** Creates an instance of OperationStatusInner class. */ + public OperationStatusInner() { + } + /** * Get the id property: The operation's unique id. * @@ -148,7 +154,9 @@ public OperationStatusInner withStatus(String status) { } /** - * Get the error property: Error response Error response describing why the operation failed. + * Get the error property: Error response + * + *

Error response describing why the operation failed. * * @return the error value. */ @@ -157,7 +165,9 @@ public ManagementError error() { } /** - * Set the error property: Error response 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 08defe8fc702..af62758cf6ae 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; @@ -20,6 +21,16 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -29,6 +40,15 @@ private PrivateEndpointConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the privateEndpoint property: The resource of private end point. * 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 index 932d6da61c07..4a0b49721c26 100644 --- 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 @@ -21,8 +21,7 @@ public final class PrivateEndpointConnectionProperties { private PrivateEndpoint privateEndpoint; /* - * A collection of information about the state of the connection between - * service consumer and provider. + * A collection of information about the state of the connection between service consumer and provider. */ @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; @@ -33,6 +32,10 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + /** * Get the privateEndpoint property: The resource of private end point. * 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 6f78217b3091..e4db579f0bb8 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,6 +19,16 @@ public final class PrivateLinkResourceInner extends ProxyResource { @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + /** * Get the innerProperties property: Resource properties. * @@ -27,6 +38,15 @@ private PrivateLinkResourceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the groupId property: The private link resource group id. * 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 index 802b87d2d897..5b134967b42d 100644 --- 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 @@ -29,6 +29,10 @@ public final class PrivateLinkResourceProperties { @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + /** * Get the groupId property: The private link resource group id. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/RegionSkuDetailInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/RegionSkuDetailInner.java new file mode 100644 index 000000000000..4b42bfc2cf4f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/RegionSkuDetailInner.java @@ -0,0 +1,120 @@ +// 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.LocationInfo; +import com.azure.resourcemanager.redisenterprise.models.SkuDetail; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Region Sku Detail + * + *

Details about the location requested and the available skus in the location. + */ +@Fluent +public final class RegionSkuDetailInner { + /* + * Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * Details about location and its capabilities + */ + @JsonProperty(value = "locationInfo") + private LocationInfo locationInfo; + + /* + * Sku Detail + * + * Details about available skus + */ + @JsonProperty(value = "skuDetails") + private SkuDetail skuDetails; + + /** Creates an instance of RegionSkuDetailInner class. */ + public RegionSkuDetailInner() { + } + + /** + * Get the resourceType property: Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise. + * + * @param resourceType the resourceType value to set. + * @return the RegionSkuDetailInner object itself. + */ + public RegionSkuDetailInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the locationInfo property: Details about location and its capabilities. + * + * @return the locationInfo value. + */ + public LocationInfo locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: Details about location and its capabilities. + * + * @param locationInfo the locationInfo value to set. + * @return the RegionSkuDetailInner object itself. + */ + public RegionSkuDetailInner withLocationInfo(LocationInfo locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the skuDetails property: Sku Detail + * + *

Details about available skus. + * + * @return the skuDetails value. + */ + public SkuDetail skuDetails() { + return this.skuDetails; + } + + /** + * Set the skuDetails property: Sku Detail + * + *

Details about available skus. + * + * @param skuDetails the skuDetails value to set. + * @return the RegionSkuDetailInner object itself. + */ + public RegionSkuDetailInner withSkuDetails(SkuDetail skuDetails) { + this.skuDetails = skuDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationInfo() != null) { + locationInfo().validate(); + } + if (skuDetails() != null) { + skuDetails().validate(); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java index f862768b8cd4..39e8896e1b34 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.redisenterprise.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; import com.azure.resourcemanager.redisenterprise.models.ClusterUpdate; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.ResourceState; @@ -63,10 +66,22 @@ public List zones() { } } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public TlsVersion minimumTlsVersion() { return this.innerModel().minimumTlsVersion(); } + public ClusterPropertiesEncryption encryption() { + return this.innerModel().encryption(); + } + public String hostname() { return this.innerModel().hostname(); } @@ -105,6 +120,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ClusterInner innerModel() { return this.innerObject; } @@ -234,6 +253,16 @@ public ClusterImpl withZones(List zones) { return this; } + public ClusterImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + public ClusterImpl withMinimumTlsVersion(TlsVersion minimumTlsVersion) { if (isInCreateMode()) { this.innerModel().withMinimumTlsVersion(minimumTlsVersion); @@ -244,6 +273,16 @@ public ClusterImpl withMinimumTlsVersion(TlsVersion minimumTlsVersion) { } } + public ClusterImpl withEncryption(ClusterPropertiesEncryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } 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 b76e39308002..851a39d700df 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.redisenterprise.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; import com.azure.resourcemanager.redisenterprise.models.AccessKeys; @@ -14,6 +15,7 @@ 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.FlushParameters; import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.Module; @@ -42,6 +44,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Protocol clientProtocol() { return this.innerModel().clientProtocol(); } @@ -83,6 +89,10 @@ public DatabasePropertiesGeoReplication geoReplication() { return this.innerModel().geoReplication(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DatabaseInner innerModel() { return this.innerObject; } @@ -181,14 +191,14 @@ public Database refresh(Context context) { return this; } - public AccessKeys listKeys() { - return serviceManager.databases().listKeys(resourceGroupName, clusterName, databaseName); - } - public Response listKeysWithResponse(Context context) { return serviceManager.databases().listKeysWithResponse(resourceGroupName, clusterName, databaseName, context); } + public AccessKeys listKeys() { + return serviceManager.databases().listKeys(resourceGroupName, clusterName, databaseName); + } + public AccessKeys regenerateKey(RegenerateKeyParameters parameters) { return serviceManager.databases().regenerateKey(resourceGroupName, clusterName, databaseName, parameters); } @@ -223,6 +233,14 @@ public void forceUnlink(ForceUnlinkParameters parameters, Context context) { serviceManager.databases().forceUnlink(resourceGroupName, clusterName, databaseName, parameters, context); } + public void flush(FlushParameters parameters) { + serviceManager.databases().flush(resourceGroupName, clusterName, databaseName, parameters); + } + + public void flush(FlushParameters parameters, Context context) { + serviceManager.databases().flush(resourceGroupName, clusterName, databaseName, parameters, context); + } + public DatabaseImpl withClientProtocol(Protocol clientProtocol) { if (isInCreateMode()) { this.innerModel().withClientProtocol(clientProtocol); 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 8388c3b650ca..da6c50b78da2 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 @@ -39,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.FlushParameters; import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; @@ -71,7 +72,7 @@ public final class DatabasesClientImpl implements DatabasesClient { */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface DatabasesService { + public interface DatabasesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" @@ -237,6 +238,23 @@ Mono>> forceUnlink( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" + + "/redisEnterprise/{clusterName}/databases/{databaseName}/flush") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> flush( + @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") FlushParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -615,7 +633,7 @@ private PollerFlux, DatabaseInner> beginCreateAsync( @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(); + return this.beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -634,7 +652,7 @@ public SyncPoller, DatabaseInner> beginCreate( @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(); + return this.beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); } /** @@ -902,7 +920,7 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( @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(); + return this.beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -921,7 +939,7 @@ public SyncPoller, DatabaseInner> beginUpdate( @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(); + return this.beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); } /** @@ -1122,14 +1140,7 @@ private Mono> getWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String clusterName, String databaseName) { return getWithResponseAsync(resourceGroupName, clusterName, databaseName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1138,14 +1149,16 @@ private Mono getAsync(String resourceGroupName, String clusterNam * @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 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 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 DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { - return getAsync(resourceGroupName, clusterName, databaseName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, context).block(); } /** @@ -1154,16 +1167,14 @@ public DatabaseInner get(String resourceGroupName, String clusterName, String da * @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 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 information about a database in a RedisEnterprise cluster along with {@link Response}. + * @return information about a database in a RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, databaseName, context).block(); + public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { + return getWithResponse(resourceGroupName, clusterName, databaseName, Context.NONE).getValue(); } /** @@ -1328,7 +1339,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName) { - return beginDeleteAsync(resourceGroupName, clusterName, databaseName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName, databaseName).getSyncPoller(); } /** @@ -1346,7 +1357,7 @@ public SyncPoller, Void> beginDelete( @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(); + return this.beginDeleteAsync(resourceGroupName, clusterName, databaseName, context).getSyncPoller(); } /** @@ -1535,14 +1546,7 @@ private Mono> listKeysWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync(String resourceGroupName, String clusterName, String databaseName) { return listKeysWithResponseAsync(resourceGroupName, clusterName, databaseName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1551,14 +1555,16 @@ private Mono listKeysAsync(String resourceGroupName, String clu * @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 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 access keys. + * @return access keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName) { - return listKeysAsync(resourceGroupName, clusterName, databaseName).block(); + public Response listKeysWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, clusterName, databaseName, context).block(); } /** @@ -1567,16 +1573,14 @@ public AccessKeysInner listKeys(String resourceGroupName, String clusterName, St * @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 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 access keys along with {@link Response}. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, clusterName, databaseName, context).block(); + public AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName) { + return listKeysWithResponse(resourceGroupName, clusterName, databaseName, Context.NONE).getValue(); } /** @@ -1772,7 +1776,7 @@ private PollerFlux, AccessKeysInner> beginRegenerate @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(); + return this.beginRegenerateKeyAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -1795,7 +1799,8 @@ public SyncPoller, AccessKeysInner> beginRegenerateK String databaseName, RegenerateKeyParameters parameters, Context context) { - return beginRegenerateKeyAsync(resourceGroupName, clusterName, databaseName, parameters, context) + return this + .beginRegenerateKeyAsync(resourceGroupName, clusterName, databaseName, parameters, context) .getSyncPoller(); } @@ -2073,7 +2078,7 @@ private PollerFlux, Void> beginImportMethodAsync( @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(); + return this.beginImportMethodAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -2096,7 +2101,8 @@ public SyncPoller, Void> beginImportMethod( String databaseName, ImportClusterParameters parameters, Context context) { - return beginImportMethodAsync(resourceGroupName, clusterName, databaseName, parameters, context) + return this + .beginImportMethodAsync(resourceGroupName, clusterName, databaseName, parameters, context) .getSyncPoller(); } @@ -2372,7 +2378,7 @@ private PollerFlux, Void> beginExportAsync( @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(); + return this.beginExportAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -2395,7 +2401,7 @@ public SyncPoller, Void> beginExport( String databaseName, ExportClusterParameters parameters, Context context) { - return beginExportAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); + return this.beginExportAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); } /** @@ -2670,7 +2676,7 @@ private PollerFlux, Void> beginForceUnlinkAsync( @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(); + return this.beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** @@ -2693,7 +2699,9 @@ public SyncPoller, Void> beginForceUnlink( String databaseName, ForceUnlinkParameters parameters, Context context) { - return beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); + return this + .beginForceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .getSyncPoller(); } /** @@ -2780,10 +2788,308 @@ public void forceUnlink( forceUnlinkAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); } + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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>> flushWithResponseAsync( + String resourceGroupName, String clusterName, String databaseName, FlushParameters 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 + .flush( + 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())); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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>> flushWithResponseAsync( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters 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 + .flush( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + databaseName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlushAsync( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { + Mono>> mono = + flushWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlushAsync( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + flushWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlush( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { + return this.beginFlushAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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> beginFlush( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters parameters, + Context context) { + return this.beginFlushAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flushAsync( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { + return beginFlushAsync(resourceGroupName, clusterName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flushAsync( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters parameters, + Context context) { + return beginFlushAsync(resourceGroupName, clusterName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { + flushAsync(resourceGroupName, clusterName, databaseName, parameters).block(); + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters parameters, + Context context) { + flushAsync(resourceGroupName, clusterName, databaseName, parameters, context).block(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -2819,7 +3125,8 @@ private Mono> listByClusterNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. 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 998b30c4b50f..a582b7f13129 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,6 +16,7 @@ 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.FlushParameters; import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; @@ -44,15 +45,6 @@ public PagedIterable listByCluster(String resourceGroupName, String cl return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); } - public Database get(String resourceGroupName, String clusterName, String databaseName) { - DatabaseInner inner = this.serviceClient().get(resourceGroupName, clusterName, databaseName); - if (inner != null) { - return new DatabaseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String databaseName, Context context) { Response inner = @@ -68,6 +60,15 @@ public Response getWithResponse( } } + public Database get(String resourceGroupName, String clusterName, String databaseName) { + DatabaseInner inner = this.serviceClient().get(resourceGroupName, clusterName, databaseName); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String clusterName, String databaseName) { this.serviceClient().delete(resourceGroupName, clusterName, databaseName); } @@ -76,15 +77,6 @@ public void delete(String resourceGroupName, String clusterName, String database this.serviceClient().delete(resourceGroupName, clusterName, databaseName, context); } - public AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName) { - AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, clusterName, databaseName); - if (inner != null) { - return new AccessKeysImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listKeysWithResponse( String resourceGroupName, String clusterName, String databaseName, Context context) { Response inner = @@ -100,6 +92,15 @@ public Response listKeysWithResponse( } } + public AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName) { + AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, clusterName, databaseName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + public AccessKeys regenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { AccessKeysInner inner = @@ -168,6 +169,19 @@ public void forceUnlink( this.serviceClient().forceUnlink(resourceGroupName, clusterName, databaseName, parameters, context); } + public void flush(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { + this.serviceClient().flush(resourceGroupName, clusterName, databaseName, parameters); + } + + public void flush( + String resourceGroupName, + String clusterName, + String databaseName, + FlushParameters parameters, + Context context) { + this.serviceClient().flush(resourceGroupName, clusterName, databaseName, parameters, context); + } + public Database getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 0392645e823d..6db72f33a7c1 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 @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Cache/operations") @ExpectedResponses({200}) @@ -202,7 +202,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -238,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. 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 81f66679c00c..6a59b7a75f38 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 @@ -50,7 +50,7 @@ public final class OperationsStatusClientImpl implements OperationsStatusClient */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface OperationsStatusService { + public interface OperationsStatusService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus" @@ -70,8 +70,8 @@ Mono> get( /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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. @@ -116,8 +116,8 @@ private Mono> getWithResponseAsync(String locatio /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. * @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. @@ -161,8 +161,8 @@ private Mono> getWithResponseAsync( /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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. @@ -170,45 +170,37 @@ private Mono> getWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 status of operation. + * @return the status of operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String location, String operationId) { - return getAsync(location, operationId).block(); + public Response getWithResponse(String location, String operationId, Context context) { + return getWithResponseAsync(location, operationId, context).block(); } /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. - * @param context The context to associate with this operation. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 status of operation along with {@link Response}. + * @return the status of operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String operationId, Context context) { - return getWithResponseAsync(location, operationId, context).block(); + public OperationStatusInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); } } 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 429725127207..6d44d30954f3 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 @@ -27,15 +27,6 @@ public OperationsStatusImpl( this.serviceManager = serviceManager; } - public OperationStatus get(String location, String operationId) { - OperationStatusInner inner = this.serviceClient().get(location, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String location, String operationId, Context context) { Response inner = this.serviceClient().getWithResponse(location, operationId, context); if (inner != null) { @@ -49,6 +40,15 @@ public Response getWithResponse(String location, String operati } } + public OperationStatus get(String location, String operationId) { + OperationStatusInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsStatusClient serviceClient() { return this.innerClient; } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java index 6eeba93d56c2..120bf562f2ba 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.redisenterprise.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; @@ -29,6 +30,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public PrivateEndpoint privateEndpoint() { return this.innerModel().privateEndpoint(); } @@ -41,6 +46,10 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } 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 352c3d86e140..28e7fe041e42 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 @@ -65,7 +65,7 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface PrivateEndpointConnectionsService { + public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" @@ -434,14 +434,7 @@ private Mono> getWithResponseAsync( private Mono getAsync( String resourceGroupName, String clusterName, String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -451,15 +444,17 @@ private Mono getAsync( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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 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 PrivateEndpointConnectionInner get( - String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, clusterName, privateEndpointConnectionName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); } /** @@ -469,17 +464,15 @@ public PrivateEndpointConnectionInner get( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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 specified private endpoint connection associated with the RedisEnterprise cluster along with {@link - * Response}. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + public PrivateEndpointConnectionInner get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE).getValue(); } /** @@ -701,7 +694,9 @@ public SyncPoller, PrivateEndpointCon String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - return beginPutAsync(resourceGroupName, clusterName, privateEndpointConnectionName, properties).getSyncPoller(); + return this + .beginPutAsync(resourceGroupName, clusterName, privateEndpointConnectionName, properties) + .getSyncPoller(); } /** @@ -725,7 +720,8 @@ public SyncPoller, PrivateEndpointCon String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - return beginPutAsync(resourceGroupName, clusterName, privateEndpointConnectionName, properties, context) + return this + .beginPutAsync(resourceGroupName, clusterName, privateEndpointConnectionName, properties, context) .getSyncPoller(); } @@ -952,7 +948,7 @@ private Mono> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { return deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -962,13 +958,16 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Str * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName).block(); + public Response deleteWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); } /** @@ -978,15 +977,12 @@ public void delete(String resourceGroupName, String clusterName, String privateE * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE); } } 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 af538f19e8e0..a34e9a42241d 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 @@ -40,17 +40,6 @@ public PagedIterable list( return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public PrivateEndpointConnection get( - String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, clusterName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { Response inner = @@ -68,8 +57,15 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, clusterName, privateEndpointConnectionName); + public PrivateEndpointConnection get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, clusterName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -79,6 +75,10 @@ public Response deleteWithResponse( .deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, context); } + public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, clusterName, privateEndpointConnectionName); + } + public PrivateEndpointConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java index 20f4e9d62591..9b943035858f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.redisenterprise.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResource; import java.util.Collections; @@ -33,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String groupId() { return this.innerModel().groupId(); } 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 c156b9273702..2a5f17974952 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 @@ -56,7 +56,7 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface PrivateLinkResourcesService { + public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientBuilder.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientBuilder.java index 7fe27e7033bb..998d6c966e8c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientBuilder.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientBuilder.java @@ -119,27 +119,26 @@ public RedisEnterpriseManagementClientBuilder serializerAdapter(SerializerAdapte * @return an instance of RedisEnterpriseManagementClientImpl. */ public RedisEnterpriseManagementClientImpl buildClient() { - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); RedisEnterpriseManagementClientImpl client = new RedisEnterpriseManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } 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 82d012c2c708..bd4aadb26a2e 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 @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -28,13 +29,13 @@ import com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterpriseManagementClient; import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient; +import com.azure.resourcemanager.redisenterprise.fluent.SkusClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -185,6 +186,18 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + /** * Initializes an instance of RedisEnterpriseManagementClient client. * @@ -207,13 +220,14 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-01-01"; + this.apiVersion = "2023-03-01-preview"; this.operations = new OperationsClientImpl(this); this.operationsStatus = new OperationsStatusClientImpl(this); this.redisEnterprises = new RedisEnterprisesClientImpl(this); this.databases = new DatabasesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.skus = new SkusClientImpl(this); } /** @@ -232,10 +246,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** 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 3c611ef82df6..6e79f873793b 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 @@ -65,7 +65,7 @@ public final class RedisEnterprisesClientImpl implements RedisEnterprisesClient */ @Host("{$host}") @ServiceInterface(name = "RedisEnterpriseManag") - private interface RedisEnterprisesService { + public interface RedisEnterprisesService { @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache" @@ -343,7 +343,7 @@ private PollerFlux, ClusterInner> beginCreateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters) { - return beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); } /** @@ -361,7 +361,7 @@ public SyncPoller, ClusterInner> beginCreate( @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(); + return this.beginCreateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); } /** @@ -604,7 +604,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); } /** @@ -622,7 +622,7 @@ public SyncPoller, ClusterInner> beginUpdate( @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(); + return this.beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); } /** @@ -842,7 +842,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } /** @@ -859,7 +859,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); } /** @@ -1033,14 +1033,7 @@ private Mono> getByResourceGroupWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1048,14 +1041,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. + * @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 information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** @@ -1063,16 +1058,14 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @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 information about a RedisEnterprise cluster along with {@link Response}. + * @return information about a RedisEnterprise cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -1387,7 +1380,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1424,7 +1418,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1461,7 +1456,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -1497,7 +1493,8 @@ private Mono> listNextSinglePageAsync(String nextLin /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. 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 625eb32f946d..fc2ebe8fcbcf 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 @@ -36,15 +36,6 @@ public void delete(String resourceGroupName, String clusterName, Context context this.serviceClient().delete(resourceGroupName, clusterName, context); } - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context) { Response inner = @@ -60,6 +51,15 @@ public Response getByResourceGroupWithResponse( } } + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RegionSkuDetailImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RegionSkuDetailImpl.java new file mode 100644 index 000000000000..047d9d2f74e8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RegionSkuDetailImpl.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.implementation; + +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.azure.resourcemanager.redisenterprise.models.LocationInfo; +import com.azure.resourcemanager.redisenterprise.models.RegionSkuDetail; +import com.azure.resourcemanager.redisenterprise.models.SkuDetail; + +public final class RegionSkuDetailImpl implements RegionSkuDetail { + private RegionSkuDetailInner innerObject; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + RegionSkuDetailImpl( + RegionSkuDetailInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public LocationInfo locationInfo() { + return this.innerModel().locationInfo(); + } + + public SkuDetail skuDetails() { + return this.innerModel().skuDetails(); + } + + public RegionSkuDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..86f6a63c3672 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusClientImpl.java @@ -0,0 +1,222 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redisenterprise.fluent.SkusClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.azure.resourcemanager.redisenterprise.models.RegionSkuDetails; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final RedisEnterpriseManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(RedisEnterpriseManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisEnterpriseManagementClientSkus to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisEnterpriseManag") + public interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 skus in specified location for the given subscription id along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 information about skus in specified location for the given subscription id along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 skus in specified location for the given subscription id as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location)); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 information about skus in specified location for the given subscription id as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, context)); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 information about skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusImpl.java new file mode 100644 index 000000000000..ef64fe0143f8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkusImpl.java @@ -0,0 +1,45 @@ +// 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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.SkusClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.azure.resourcemanager.redisenterprise.models.RegionSkuDetail; +import com.azure.resourcemanager.redisenterprise.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + public SkusImpl( + SkusClient innerClient, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new RegionSkuDetailImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new RegionSkuDetailImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeyType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeyType.java index 4d38c4298510..a475e6db70f9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeyType.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeyType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for AccessKeyType. */ +/** Which access key to regenerate. */ public enum AccessKeyType { /** Enum value Primary. */ PRIMARY("Primary"), @@ -30,6 +30,9 @@ public enum AccessKeyType { */ @JsonCreator public static AccessKeyType fromString(String value) { + if (value == null) { + return null; + } AccessKeyType[] items = AccessKeyType.values(); for (AccessKeyType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static AccessKeyType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ActionType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ActionType.java index a5dff0893374..e3af6536802d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ActionType.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ActionType.java @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ActionType. */ +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. * @@ -24,7 +33,11 @@ public static ActionType fromString(String name) { return fromString(name, ActionType.class); } - /** @return known ActionType values. */ + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ public static Collection values() { return values(ActionType.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AofFrequency.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AofFrequency.java index a984c98d713a..42056137ab5e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AofFrequency.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AofFrequency.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AofFrequency. */ +/** Sets the frequency at which data is written to disk. */ public final class AofFrequency extends ExpandableStringEnum { /** Static value 1s for AofFrequency. */ public static final AofFrequency ONES = fromString("1s"); @@ -16,6 +16,15 @@ public final class AofFrequency extends ExpandableStringEnum { /** Static value always for AofFrequency. */ public static final AofFrequency ALWAYS = fromString("always"); + /** + * Creates a new instance of AofFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AofFrequency() { + } + /** * Creates or finds a AofFrequency from its string representation. * @@ -27,7 +36,11 @@ public static AofFrequency fromString(String name) { return fromString(name, AofFrequency.class); } - /** @return known AofFrequency values. */ + /** + * Gets known AofFrequency values. + * + * @return known AofFrequency values. + */ public static Collection values() { return values(AofFrequency.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Capability.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Capability.java new file mode 100644 index 000000000000..5eeb214d8498 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Capability.java @@ -0,0 +1,80 @@ +// 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; + +/** + * Capability + * + *

Information about the features the location supports. + */ +@Fluent +public final class Capability { + /* + * Feature name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether feature is supported or not + */ + @JsonProperty(value = "value") + private Boolean value; + + /** Creates an instance of Capability class. */ + public Capability() { + } + + /** + * Get the name property: Feature name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Feature name. + * + * @param name the name value to set. + * @return the Capability object itself. + */ + public Capability withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Indicates whether feature is supported or not. + * + * @return the value value. + */ + public Boolean value() { + return this.value; + } + + /** + * Set the value property: Indicates whether feature is supported or not. + * + * @param value the value value to set. + * @return the Capability object itself. + */ + public Capability withValue(Boolean value) { + this.value = value; + 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/models/Cluster.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Cluster.java index a5925e5b538b..39ac8576d939 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Cluster.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Cluster.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import java.util.List; @@ -61,6 +62,20 @@ public interface Cluster { */ List zones(); + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. * @@ -68,6 +83,13 @@ public interface Cluster { */ TlsVersion minimumTlsVersion(); + /** + * Gets the encryption property: Encryption-at-rest configuration for the cluster. + * + * @return the encryption value. + */ + ClusterPropertiesEncryption encryption(); + /** * Gets the hostname property: DNS name of the cluster endpoint. * @@ -118,6 +140,13 @@ public interface Cluster { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner object. * @@ -181,7 +210,11 @@ interface WithSku { * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithZones, DefinitionStages.WithMinimumTlsVersion { + extends DefinitionStages.WithTags, + DefinitionStages.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithEncryption { /** * Executes the create request. * @@ -217,6 +250,16 @@ interface WithZones { */ WithCreate withZones(List zones); } + /** The stage of the Cluster definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } /** The stage of the Cluster definition allowing to specify minimumTlsVersion. */ interface WithMinimumTlsVersion { /** @@ -227,6 +270,16 @@ interface WithMinimumTlsVersion { */ WithCreate withMinimumTlsVersion(TlsVersion minimumTlsVersion); } + /** The stage of the Cluster definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption-at-rest configuration for the cluster.. + * + * @param encryption Encryption-at-rest configuration for the cluster. + * @return the next definition stage. + */ + WithCreate withEncryption(ClusterPropertiesEncryption encryption); + } } /** * Begins update for the Cluster resource. @@ -236,7 +289,12 @@ interface WithMinimumTlsVersion { Cluster.Update update(); /** The template for Cluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithMinimumTlsVersion { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithMinimumTlsVersion, + UpdateStages.WithEncryption { /** * Executes the update request. * @@ -274,6 +332,16 @@ interface WithSku { */ Update withSku(Sku sku); } + /** The stage of the Cluster update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } /** The stage of the Cluster update allowing to specify minimumTlsVersion. */ interface WithMinimumTlsVersion { /** @@ -284,6 +352,16 @@ interface WithMinimumTlsVersion { */ Update withMinimumTlsVersion(TlsVersion minimumTlsVersion); } + /** The stage of the Cluster update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption-at-rest configuration for the cluster.. + * + * @param encryption Encryption-at-rest configuration for the cluster. + * @return the next definition stage. + */ + Update withEncryption(ClusterPropertiesEncryption encryption); + } } /** * Refreshes the resource to sync with Azure. 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 67ff740c212d..b121135d06dd 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 @@ -24,6 +24,10 @@ public final class ClusterList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ClusterList class. */ + public ClusterList() { + } + /** * Get the value property: List of clusters. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryption.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryption.java new file mode 100644 index 000000000000..f2567b4f3802 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryption.java @@ -0,0 +1,57 @@ +// 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; + +/** Encryption-at-rest configuration for the cluster. */ +@Fluent +public final class ClusterPropertiesEncryption { + /* + * All Customer-managed key encryption properties for the resource. Set this to an empty object to use + * Microsoft-managed key encryption. + */ + @JsonProperty(value = "customerManagedKeyEncryption") + private ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption; + + /** Creates an instance of ClusterPropertiesEncryption class. */ + public ClusterPropertiesEncryption() { + } + + /** + * Get the customerManagedKeyEncryption property: All Customer-managed key encryption properties for the resource. + * Set this to an empty object to use Microsoft-managed key encryption. + * + * @return the customerManagedKeyEncryption value. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption() { + return this.customerManagedKeyEncryption; + } + + /** + * Set the customerManagedKeyEncryption property: All Customer-managed key encryption properties for the resource. + * Set this to an empty object to use Microsoft-managed key encryption. + * + * @param customerManagedKeyEncryption the customerManagedKeyEncryption value to set. + * @return the ClusterPropertiesEncryption object itself. + */ + public ClusterPropertiesEncryption withCustomerManagedKeyEncryption( + ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption) { + this.customerManagedKeyEncryption = customerManagedKeyEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customerManagedKeyEncryption() != null) { + customerManagedKeyEncryption().validate(); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryption.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryption.java new file mode 100644 index 000000000000..422d57f0fd55 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryption.java @@ -0,0 +1,89 @@ +// 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; + +/** + * All Customer-managed key encryption properties for the resource. Set this to an empty object to use Microsoft-managed + * key encryption. + */ +@Fluent +public final class ClusterPropertiesEncryptionCustomerManagedKeyEncryption { + /* + * All identity configuration for Customer-managed key settings defining which identity should be used to auth to + * Key Vault. + */ + @JsonProperty(value = "keyEncryptionKeyIdentity") + private ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity; + + /* + * Key encryption key Url, versioned only. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 + */ + @JsonProperty(value = "keyEncryptionKeyUrl") + private String keyEncryptionKeyUrl; + + /** Creates an instance of ClusterPropertiesEncryptionCustomerManagedKeyEncryption class. */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryption() { + } + + /** + * Get the keyEncryptionKeyIdentity property: All identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault. + * + * @return the keyEncryptionKeyIdentity value. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity() { + return this.keyEncryptionKeyIdentity; + } + + /** + * Set the keyEncryptionKeyIdentity property: All identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault. + * + * @param keyEncryptionKeyIdentity the keyEncryptionKeyIdentity value to set. + * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryption object itself. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryption withKeyEncryptionKeyIdentity( + ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity) { + this.keyEncryptionKeyIdentity = keyEncryptionKeyIdentity; + return this; + } + + /** + * Get the keyEncryptionKeyUrl property: Key encryption key Url, versioned only. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78. + * + * @return the keyEncryptionKeyUrl value. + */ + public String keyEncryptionKeyUrl() { + return this.keyEncryptionKeyUrl; + } + + /** + * Set the keyEncryptionKeyUrl property: Key encryption key Url, versioned only. Ex: + * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78. + * + * @param keyEncryptionKeyUrl the keyEncryptionKeyUrl value to set. + * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryption object itself. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryption withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) { + this.keyEncryptionKeyUrl = keyEncryptionKeyUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyEncryptionKeyIdentity() != null) { + keyEncryptionKeyIdentity().validate(); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.java new file mode 100644 index 000000000000..1eb7183f4e49 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.java @@ -0,0 +1,88 @@ +// 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; + +/** + * All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key + * Vault. + */ +@Fluent +public class ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity { + /* + * User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. + */ + @JsonProperty(value = "userAssignedIdentityResourceId") + private String userAssignedIdentityResourceId; + + /* + * Only userAssignedIdentity is supported in this API version; other types may be supported in the future + */ + @JsonProperty(value = "identityType") + private CmkIdentityType identityType; + + /** Creates an instance of ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity class. */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() { + } + + /** + * Get the userAssignedIdentityResourceId property: User assigned identity to use for accessing key encryption key + * Url. Ex: /subscriptions/<sub uuid>/resourceGroups/<resource + * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: User assigned identity to use for accessing key encryption key + * Url. Ex: /subscriptions/<sub uuid>/resourceGroups/<resource + * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity object itself. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity withUserAssignedIdentityResourceId( + String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + return this; + } + + /** + * Get the identityType property: Only userAssignedIdentity is supported in this API version; other types may be + * supported in the future. + * + * @return the identityType value. + */ + public CmkIdentityType identityType() { + return this.identityType; + } + + /** + * Set the identityType property: Only userAssignedIdentity is supported in this API version; other types may be + * supported in the future. + * + * @param identityType the identityType value to set. + * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity object itself. + */ + public ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity withIdentityType( + CmkIdentityType identityType) { + this.identityType = identityType; + 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/models/ClusterUpdate.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java index 9bc6e0f2ebf5..e36423281d05 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 @@ -22,11 +22,19 @@ public final class ClusterUpdate { private Sku sku; /* - * RedisEnterprise cluster properties Other properties of the cluster. + * RedisEnterprise cluster properties + * + * Other properties of the cluster. */ @JsonProperty(value = "properties") private ClusterProperties innerProperties; + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /* * Resource tags. */ @@ -34,6 +42,10 @@ public final class ClusterUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ClusterUpdate class. */ + public ClusterUpdate() { + } + /** * Get the sku property: The SKU to create, which affects price, performance, and features. * @@ -55,7 +67,9 @@ public ClusterUpdate withSku(Sku sku) { } /** - * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * Get the innerProperties property: RedisEnterprise cluster properties + * + *

Other properties of the cluster. * * @return the innerProperties value. */ @@ -63,6 +77,26 @@ private ClusterProperties innerProperties() { return this.innerProperties; } + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the tags property: Resource tags. * @@ -106,6 +140,29 @@ public ClusterUpdate withMinimumTlsVersion(TlsVersion minimumTlsVersion) { return this; } + /** + * Get the encryption property: Encryption-at-rest configuration for the cluster. + * + * @return the encryption value. + */ + public ClusterPropertiesEncryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Encryption-at-rest configuration for the cluster. + * + * @param encryption the encryption value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEncryption(ClusterPropertiesEncryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -164,5 +221,8 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusteringPolicy.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusteringPolicy.java index ecd7044b582b..13f694d8a5f0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusteringPolicy.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusteringPolicy.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ClusteringPolicy. */ +/** Clustering policy - default is OSSCluster. Specified at create time. */ public final class ClusteringPolicy extends ExpandableStringEnum { /** Static value EnterpriseCluster for ClusteringPolicy. */ public static final ClusteringPolicy ENTERPRISE_CLUSTER = fromString("EnterpriseCluster"); @@ -16,6 +16,15 @@ public final class ClusteringPolicy extends ExpandableStringEnum values() { return values(ClusteringPolicy.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/CmkIdentityType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/CmkIdentityType.java new file mode 100644 index 000000000000..a5a43a2f9b14 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/CmkIdentityType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Only userAssignedIdentity is supported in this API version; other types may be supported in the future. */ +public final class CmkIdentityType extends ExpandableStringEnum { + /** Static value systemAssignedIdentity for CmkIdentityType. */ + public static final CmkIdentityType SYSTEM_ASSIGNED_IDENTITY = fromString("systemAssignedIdentity"); + + /** Static value userAssignedIdentity for CmkIdentityType. */ + public static final CmkIdentityType USER_ASSIGNED_IDENTITY = fromString("userAssignedIdentity"); + + /** + * Creates a new instance of CmkIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CmkIdentityType() { + } + + /** + * Creates or finds a CmkIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CmkIdentityType. + */ + @JsonCreator + public static CmkIdentityType fromString(String name) { + return fromString(name, CmkIdentityType.class); + } + + /** + * Gets known CmkIdentityType values. + * + * @return known CmkIdentityType values. + */ + public static Collection values() { + return values(CmkIdentityType.class); + } +} 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 782786d896bf..93d3dfb8c1c4 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; import java.util.List; @@ -32,6 +33,13 @@ public interface Database { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. @@ -98,6 +106,13 @@ public interface Database { */ DatabasePropertiesGeoReplication geoReplication(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner object. * @@ -308,22 +323,22 @@ interface WithPersistence { /** * Retrieves the access keys for the RedisEnterprise database. * + * @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 access keys. + * @return access keys along with {@link Response}. */ - AccessKeys listKeys(); + Response listKeysWithResponse(Context context); /** * Retrieves the access keys for the RedisEnterprise database. * - * @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 access keys along with {@link Response}. + * @return access keys. */ - Response listKeysWithResponse(Context context); + AccessKeys listKeys(); /** * Regenerates the RedisEnterprise database's access keys. @@ -410,4 +425,25 @@ interface WithPersistence { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void forceUnlink(ForceUnlinkParameters parameters, Context context); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @param parameters Information identifying the databases to be flushed. + * @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 flush(FlushParameters parameters); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @param parameters Information identifying the databases to be flushed. + * @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 flush(FlushParameters 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 bafe21aab31d..685e20d87c3c 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 @@ -24,6 +24,10 @@ public final class DatabaseList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of DatabaseList class. */ + public DatabaseList() { + } + /** * Get the value property: 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 index 57f374a24bfe..8279a01bed5c 100644 --- 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 @@ -23,6 +23,10 @@ public final class DatabasePropertiesGeoReplication { @JsonProperty(value = "linkedDatabases") private List linkedDatabases; + /** Creates an instance of DatabasePropertiesGeoReplication class. */ + public DatabasePropertiesGeoReplication() { + } + /** * Get the groupNickname property: Name for the group of linked database resources. * 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 39a0c0d5bad0..39fcb08b896a 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 @@ -13,13 +13,21 @@ @Fluent public final class DatabaseUpdate { /* - * RedisEnterprise database properties Properties of the database. + * RedisEnterprise database properties + * + * Properties of the database. */ @JsonProperty(value = "properties") private DatabaseProperties innerProperties; + /** Creates an instance of DatabaseUpdate class. */ + public DatabaseUpdate() { + } + /** - * Get the innerProperties property: RedisEnterprise database properties Properties of the database. + * Get the innerProperties property: RedisEnterprise database properties + * + *

Properties of the database. * * @return the innerProperties value. */ 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 2cea9c32c6d3..f0e707857436 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 @@ -41,12 +41,14 @@ public interface Databases { * @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 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 information about a database in a RedisEnterprise cluster. + * @return information about a database in a RedisEnterprise cluster along with {@link Response}. */ - Database get(String resourceGroupName, String clusterName, String databaseName); + Response getWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); /** * Gets information about a database in a RedisEnterprise cluster. @@ -54,14 +56,12 @@ public interface Databases { * @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 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 information about a database in a RedisEnterprise cluster along with {@link Response}. + * @return information about a database in a RedisEnterprise cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context); + Database get(String resourceGroupName, String clusterName, String databaseName); /** * Deletes a single database. @@ -94,12 +94,14 @@ Response getWithResponse( * @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 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 access keys. + * @return access keys along with {@link Response}. */ - AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName); + Response listKeysWithResponse( + String resourceGroupName, String clusterName, String databaseName, Context context); /** * Retrieves the access keys for the RedisEnterprise database. @@ -107,14 +109,12 @@ Response getWithResponse( * @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 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 access keys along with {@link Response}. + * @return access keys. */ - Response listKeysWithResponse( - String resourceGroupName, String clusterName, String databaseName, Context context); + AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName); /** * Regenerates the RedisEnterprise database's access keys. @@ -249,6 +249,34 @@ void forceUnlink( ForceUnlinkParameters parameters, Context context); + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters); + + /** + * Flushes all the keys in this database and also from its linked databases. + * + * @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 databases to be flushed. + * @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 flush( + String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters, Context context); + /** * Gets information about a database in a RedisEnterprise cluster. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/EvictionPolicy.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/EvictionPolicy.java index 7bd8bf8f2436..6ccd183fd91c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/EvictionPolicy.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/EvictionPolicy.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EvictionPolicy. */ +/** Redis eviction policy - default is VolatileLRU. */ public final class EvictionPolicy extends ExpandableStringEnum { /** Static value AllKeysLFU for EvictionPolicy. */ public static final EvictionPolicy ALL_KEYS_LFU = fromString("AllKeysLFU"); @@ -34,6 +34,15 @@ public final class EvictionPolicy extends ExpandableStringEnum { /** Static value NoEviction for EvictionPolicy. */ public static final EvictionPolicy NO_EVICTION = fromString("NoEviction"); + /** + * Creates a new instance of EvictionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EvictionPolicy() { + } + /** * Creates or finds a EvictionPolicy from its string representation. * @@ -45,7 +54,11 @@ public static EvictionPolicy fromString(String name) { return fromString(name, EvictionPolicy.class); } - /** @return known EvictionPolicy values. */ + /** + * Gets known EvictionPolicy values. + * + * @return known EvictionPolicy values. + */ public static Collection values() { return values(EvictionPolicy.class); } 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 a2c7d1abc143..db429aa7d8e9 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 @@ -8,7 +8,11 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Export an RDB file into a target database 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 { /* @@ -17,6 +21,10 @@ public final class ExportClusterParameters { @JsonProperty(value = "sasUri", required = true) private String sasUri; + /** Creates an instance of ExportClusterParameters class. */ + public ExportClusterParameters() { + } + /** * Get the sasUri property: SAS URI for the target directory to export to. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/FlushParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/FlushParameters.java new file mode 100644 index 000000000000..6961dd359be7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/FlushParameters.java @@ -0,0 +1,57 @@ +// 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; + +/** + * Flush all the keys from the current and all its linked databases + * + *

Parameters for a Redis Enterprise active geo-replication flush operation. + */ +@Fluent +public final class FlushParameters { + /* + * The resource identifiers of all the other database resources in the georeplication group to be flushed + */ + @JsonProperty(value = "ids") + private List ids; + + /** Creates an instance of FlushParameters class. */ + public FlushParameters() { + } + + /** + * Get the ids property: The resource identifiers of all the other database resources in the georeplication group to + * be flushed. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: The resource identifiers of all the other database resources in the georeplication group to + * be flushed. + * + * @param ids the ids value to set. + * @return the FlushParameters object itself. + */ + public FlushParameters withIds(List ids) { + this.ids = ids; + 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/models/ForceUnlinkParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceUnlinkParameters.java index fd54ab3302cb..281a5e554c0f 100644 --- 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 @@ -10,8 +10,9 @@ import java.util.List; /** - * Forcibly unlink another database from this database. Parameters for a Redis Enterprise Active Geo Replication Force - * Unlink operation. + * Forcibly unlink another database from this database. + * + *

Parameters for a Redis Enterprise Active Geo Replication Force Unlink operation. */ @Fluent public final class ForceUnlinkParameters { @@ -21,6 +22,10 @@ public final class ForceUnlinkParameters { @JsonProperty(value = "ids", required = true) private List ids; + /** Creates an instance of ForceUnlinkParameters class. */ + public ForceUnlinkParameters() { + } + /** * Get the ids property: The resource IDs of the database resources to be unlinked. * 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 ead15e3d54bd..2c1fdd2517c0 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 @@ -9,7 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Import RDB files into a target database 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 { /* @@ -18,6 +22,10 @@ public final class ImportClusterParameters { @JsonProperty(value = "sasUris", required = true) private List sasUris; + /** Creates an instance of ImportClusterParameters class. */ + public ImportClusterParameters() { + } + /** * Get the sasUris property: SAS URIs for the target blobs to import from. * 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 index 4f60c17b9861..f81704245740 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for LinkState. */ +/** State of the link between the database resources. */ public final class LinkState extends ExpandableStringEnum { /** Static value Linked for LinkState. */ public static final LinkState LINKED = fromString("Linked"); @@ -25,6 +25,15 @@ public final class LinkState extends ExpandableStringEnum { /** Static value UnlinkFailed for LinkState. */ public static final LinkState UNLINK_FAILED = fromString("UnlinkFailed"); + /** + * Creates a new instance of LinkState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkState() { + } + /** * Creates or finds a LinkState from its string representation. * @@ -36,7 +45,11 @@ public static LinkState fromString(String name) { return fromString(name, LinkState.class); } - /** @return known LinkState values. */ + /** + * Gets known LinkState values. + * + * @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 index 48d5fe1a0320..43a74c90a4d0 100644 --- 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 @@ -7,7 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Linked Database Specifies details of a linked database resource. */ +/** + * Linked Database + * + *

Specifies details of a linked database resource. + */ @Fluent public final class LinkedDatabase { /* @@ -22,6 +26,10 @@ public final class LinkedDatabase { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private LinkState state; + /** Creates an instance of LinkedDatabase class. */ + public LinkedDatabase() { + } + /** * Get the id property: Resource ID of a database resource to link with this database. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LocationInfo.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LocationInfo.java new file mode 100644 index 000000000000..c07423fea2d1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/LocationInfo.java @@ -0,0 +1,80 @@ +// 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; + +/** Information about location (for example: features that it supports). */ +@Fluent +public final class LocationInfo { + /* + * Location name + */ + @JsonProperty(value = "location") + private String location; + + /* + * List of capabilities + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** Creates an instance of LocationInfo class. */ + public LocationInfo() { + } + + /** + * Get the location property: Location name. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location name. + * + * @param location the location value to set. + * @return the LocationInfo object itself. + */ + public LocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the capabilities property: List of capabilities. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: List of capabilities. + * + * @param capabilities the capabilities value to set. + * @return the LocationInfo object itself. + */ + public LocationInfo withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentity.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..30c5b288bc72 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// 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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentityType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..b82525ecbff7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentityType.java @@ -0,0 +1,54 @@ +// 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; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} 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 919a6f864eee..69320e7ecbf9 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 @@ -8,19 +8,21 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Module settings Specifies configuration of a redis module. */ +/** + * Module settings + * + *

Specifies configuration of a redis module. + */ @Fluent public final class Module { /* - * The name of the module, e.g. 'RedisBloom', 'RediSearch', - * 'RedisTimeSeries' + * The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' */ @JsonProperty(value = "name", required = true) private String name; /* - * Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE - * 400'. + * Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. */ @JsonProperty(value = "args") private String args; @@ -31,6 +33,10 @@ public final class Module { @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; + /** Creates an instance of Module class. */ + public Module() { + } + /** * Get the name property: The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries'. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Name.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Name.java new file mode 100644 index 000000000000..2d954610d04e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Name.java @@ -0,0 +1,62 @@ +// 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; + +/** The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). */ +public final class Name extends ExpandableStringEnum { + /** Static value Enterprise_E10 for Name. */ + public static final Name ENTERPRISE_E10 = fromString("Enterprise_E10"); + + /** Static value Enterprise_E20 for Name. */ + public static final Name ENTERPRISE_E20 = fromString("Enterprise_E20"); + + /** Static value Enterprise_E50 for Name. */ + public static final Name ENTERPRISE_E50 = fromString("Enterprise_E50"); + + /** Static value Enterprise_E100 for Name. */ + public static final Name ENTERPRISE_E100 = fromString("Enterprise_E100"); + + /** Static value EnterpriseFlash_F300 for Name. */ + public static final Name ENTERPRISE_FLASH_F300 = fromString("EnterpriseFlash_F300"); + + /** Static value EnterpriseFlash_F700 for Name. */ + public static final Name ENTERPRISE_FLASH_F700 = fromString("EnterpriseFlash_F700"); + + /** Static value EnterpriseFlash_F1500 for Name. */ + public static final Name ENTERPRISE_FLASH_F1500 = fromString("EnterpriseFlash_F1500"); + + /** + * Creates a new instance of Name value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Name() { + } + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + @JsonCreator + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** + * Gets known Name values. + * + * @return known Name values. + */ + public static Collection values() { + return values(Name.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 cd2543f363eb..75df33a0c397 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 @@ -11,34 +11,36 @@ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: 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 a40792a91118..7cc56e480a44 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 @@ -27,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: 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 384c42984a4a..c51babac7c55 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,9 @@ public interface OperationStatus { String status(); /** - * Gets the error property: Error response 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/OperationsStatus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java index 98c0662950f3..bc89ca67af35 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 @@ -12,25 +12,25 @@ public interface OperationsStatus { /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 status of operation. + * @return the status of operation along with {@link Response}. */ - OperationStatus get(String location, String operationId); + Response getWithResponse(String location, String operationId, Context context); /** * Gets the status of operation. * - * @param location The region the operation is in. - * @param operationId The operation's unique identifier. - * @param context The context to associate with this operation. + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 status of operation along with {@link Response}. + * @return the status of operation. */ - Response getWithResponse(String location, String operationId, Context context); + OperationStatus get(String location, String operationId); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Origin.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Origin.java index 31b02162f693..8ffed4685bd6 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Origin.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Origin.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Origin. */ +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ public final class Origin extends ExpandableStringEnum { /** Static value user for Origin. */ public static final Origin USER = fromString("user"); @@ -19,6 +22,15 @@ public final class Origin extends ExpandableStringEnum { /** Static value user,system for Origin. */ public static final Origin USER_SYSTEM = fromString("user,system"); + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + /** * Creates or finds a Origin from its string representation. * @@ -30,7 +42,11 @@ public static Origin fromString(String name) { return fromString(name, Origin.class); } - /** @return known Origin values. */ + /** + * Gets known Origin values. + * + * @return known Origin values. + */ public static Collection values() { return values(Origin.class); } 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 da8259c43822..03eb7fbf2f41 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 @@ -7,7 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Persistence settings Persistence-related configuration for the RedisEnterprise database. */ +/** + * Persistence settings + * + *

Persistence-related configuration for the RedisEnterprise database. + */ @Fluent public final class Persistence { /* @@ -34,6 +38,10 @@ public final class Persistence { @JsonProperty(value = "rdbFrequency") private RdbFrequency rdbFrequency; + /** Creates an instance of Persistence class. */ + public Persistence() { + } + /** * Get the aofEnabled property: 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 05330d7c773c..d02e68409dc2 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 @@ -16,6 +16,10 @@ public final class PrivateEndpoint { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + /** * Get the id property: The ARM identifier for Private Endpoint. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnection.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnection.java index 27b956344c6d..d9c1082fad26 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnection.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnection.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.redisenterprise.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; @@ -30,6 +31,13 @@ public interface PrivateEndpointConnection { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the privateEndpoint property: The resource of private end point. * @@ -52,6 +60,13 @@ public interface PrivateEndpointConnection { */ PrivateEndpointConnectionProvisioningState provisioningState(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner object. * 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 ea2819c1fd25..345835b415ba 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 @@ -18,6 +18,10 @@ public final class PrivateEndpointConnectionListResult { @JsonProperty(value = "value") private List value; + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + /** * Get the value property: Array of private endpoint connections. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionProvisioningState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionProvisioningState.java index 1805d124aacb..9bcf46d6e16f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionProvisioningState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PrivateEndpointConnectionProvisioningState. */ +/** The current provisioning state. */ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ @@ -23,6 +23,15 @@ public final class PrivateEndpointConnectionProvisioningState /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. * @@ -34,7 +43,11 @@ public static PrivateEndpointConnectionProvisioningState fromString(String name) return fromString(name, PrivateEndpointConnectionProvisioningState.class); } - /** @return known PrivateEndpointConnectionProvisioningState values. */ + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ public static Collection values() { return values(PrivateEndpointConnectionProvisioningState.class); } 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 e0456b3d22dd..04d8334ce296 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 @@ -44,12 +44,15 @@ public interface PrivateEndpointConnections { * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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 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 get(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -58,15 +61,12 @@ public interface PrivateEndpointConnections { * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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 specified private endpoint connection associated with the RedisEnterprise cluster along with {@link - * Response}. + * @return the specified private endpoint connection associated with the RedisEnterprise cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String clusterName, String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -75,11 +75,14 @@ Response getWithResponse( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @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 Response}. */ - void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + Response deleteWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. @@ -88,14 +91,11 @@ Response getWithResponse( * @param clusterName The name of the RedisEnterprise cluster. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @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 Response}. */ - Response deleteWithResponse( - String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); /** * Gets the specified private endpoint connection associated with the RedisEnterprise cluster. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointServiceConnectionStatus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointServiceConnectionStatus.java index a0f7445525d0..87cffd02b839 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointServiceConnectionStatus.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PrivateEndpointServiceConnectionStatus. */ +/** The private endpoint connection status. */ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ @@ -20,6 +20,15 @@ public final class PrivateEndpointServiceConnectionStatus /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. * @@ -31,7 +40,11 @@ public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } - /** @return known PrivateEndpointServiceConnectionStatus values. */ + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ public static Collection values() { return values(PrivateEndpointServiceConnectionStatus.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResource.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResource.java index 5ec2aeef5980..dfbee4652567 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResource.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResource.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.redisenterprise.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import java.util.List; @@ -30,6 +31,13 @@ public interface PrivateLinkResource { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the groupId property: The private link resource group id. * 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 6623effd32d0..51465789943c 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 @@ -18,6 +18,10 @@ public final class PrivateLinkResourceListResult { @JsonProperty(value = "value") private List value; + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + /** * Get the value property: Array of private link resources. * 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 780fa66fe7a8..1d20e5e9160a 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 @@ -11,8 +11,7 @@ @Fluent public final class PrivateLinkServiceConnectionState { /* - * Indicates whether the connection has been Approved/Rejected/Removed by - * the owner of the service. + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; @@ -24,12 +23,15 @@ public final class PrivateLinkServiceConnectionState { private String description; /* - * A message indicating if changes on the service provider require any - * updates on the consumer. + * A message indicating if changes on the service provider require any updates on the consumer. */ @JsonProperty(value = "actionsRequired") private String actionsRequired; + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + /** * Get the status property: 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/Protocol.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Protocol.java index 9abf088a840c..a57dda4ba7e9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Protocol.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Protocol.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Protocol. */ +/** + * Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is + * TLS-encrypted. + */ public final class Protocol extends ExpandableStringEnum { /** Static value Encrypted for Protocol. */ public static final Protocol ENCRYPTED = fromString("Encrypted"); @@ -16,6 +19,15 @@ public final class Protocol extends ExpandableStringEnum { /** Static value Plaintext for Protocol. */ public static final Protocol PLAINTEXT = fromString("Plaintext"); + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + /** * Creates or finds a Protocol from its string representation. * @@ -27,7 +39,11 @@ public static Protocol fromString(String name) { return fromString(name, Protocol.class); } - /** @return known Protocol values. */ + /** + * Gets known Protocol values. + * + * @return known Protocol values. + */ public static Collection values() { return values(Protocol.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ProvisioningState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ProvisioningState.java index 9ffa5efe2376..d02bbe974cd5 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ProvisioningState.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ProvisioningState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** Current provisioning status. */ public final class ProvisioningState extends ExpandableStringEnum { /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); @@ -28,6 +28,15 @@ public final class ProvisioningState extends ExpandableStringEnum values() { return values(ProvisioningState.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RdbFrequency.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RdbFrequency.java index da38226152af..3a4efbdfa429 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RdbFrequency.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RdbFrequency.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for RdbFrequency. */ +/** Sets the frequency at which a snapshot of the database is created. */ public final class RdbFrequency extends ExpandableStringEnum { /** Static value 1h for RdbFrequency. */ public static final RdbFrequency ONEH = fromString("1h"); @@ -19,6 +19,15 @@ public final class RdbFrequency extends ExpandableStringEnum { /** Static value 12h for RdbFrequency. */ public static final RdbFrequency ONE_TWOH = fromString("12h"); + /** + * Creates a new instance of RdbFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RdbFrequency() { + } + /** * Creates or finds a RdbFrequency from its string representation. * @@ -30,7 +39,11 @@ public static RdbFrequency fromString(String name) { return fromString(name, RdbFrequency.class); } - /** @return known RdbFrequency values. */ + /** + * Gets known RdbFrequency values. + * + * @return known RdbFrequency values. + */ public static Collection values() { return values(RdbFrequency.class); } 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 c3df60c08f99..2a66480a02f4 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 @@ -38,25 +38,25 @@ public interface RedisEnterprises { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. + * @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 information about a RedisEnterprise cluster. + * @return information about a RedisEnterprise cluster along with {@link Response}. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); /** * Gets information about a RedisEnterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. - * @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 information about a RedisEnterprise cluster along with {@link Response}. + * @return information about a RedisEnterprise cluster. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** * Lists all RedisEnterprise clusters in a resource group. 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 6a3c2a4c13e6..017bc502c99c 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 @@ -8,7 +8,11 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regenerate access keys request 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 { /* @@ -17,6 +21,10 @@ public final class RegenerateKeyParameters { @JsonProperty(value = "keyType", required = true) private AccessKeyType keyType; + /** Creates an instance of RegenerateKeyParameters class. */ + public RegenerateKeyParameters() { + } + /** * Get the keyType property: Which access key to regenerate. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetail.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetail.java new file mode 100644 index 000000000000..520df8717f2f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetail.java @@ -0,0 +1,40 @@ +// 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.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; + +/** An immutable client-side representation of RegionSkuDetail. */ +public interface RegionSkuDetail { + /** + * Gets the resourceType property: Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the locationInfo property: Details about location and its capabilities. + * + * @return the locationInfo value. + */ + LocationInfo locationInfo(); + + /** + * Gets the skuDetails property: Sku Detail + * + *

Details about available skus. + * + * @return the skuDetails value. + */ + SkuDetail skuDetails(); + + /** + * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner object. + * + * @return the inner object. + */ + RegionSkuDetailInner innerModel(); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetails.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetails.java new file mode 100644 index 000000000000..6bf8863b0e6b --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegionSkuDetails.java @@ -0,0 +1,59 @@ +// 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.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Region Sku Details + * + *

List of details about all the available SKUs. + */ +@Fluent +public final class RegionSkuDetails { + /* + * List of Sku Detail + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RegionSkuDetails class. */ + public RegionSkuDetails() { + } + + /** + * Get the value property: List of Sku Detail. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Sku Detail. + * + * @param value the value value to set. + * @return the RegionSkuDetails object itself. + */ + public RegionSkuDetails withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ResourceState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ResourceState.java index 98e6bf619428..05fd95a4b78b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ResourceState.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ResourceState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ResourceState. */ +/** Current resource status. */ public final class ResourceState extends ExpandableStringEnum { /** Static value Running for ResourceState. */ public static final ResourceState RUNNING = fromString("Running"); @@ -46,6 +46,15 @@ public final class ResourceState extends ExpandableStringEnum { /** Static value Disabled for ResourceState. */ public static final ResourceState DISABLED = fromString("Disabled"); + /** + * Creates a new instance of ResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceState() { + } + /** * Creates or finds a ResourceState from its string representation. * @@ -57,7 +66,11 @@ public static ResourceState fromString(String name) { return fromString(name, ResourceState.class); } - /** @return known ResourceState values. */ + /** + * Gets known ResourceState values. + * + * @return known ResourceState values. + */ public static Collection values() { return values(ResourceState.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 299c6e4164f2..9b088f3d24aa 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 @@ -12,20 +12,22 @@ @Fluent public final class Sku { /* - * The type of RedisEnterprise cluster to deploy. Possible values: - * (Enterprise_E10, EnterpriseFlash_F300 etc.) + * The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.) */ @JsonProperty(value = "name", required = true) private SkuName name; /* - * The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on - * SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, - * ...) for Flash SKUs. + * The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are (2, 4, 6, ...) + * for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. */ @JsonProperty(value = "capacity") private Integer capacity; + /** Creates an instance of Sku class. */ + public Sku() { + } + /** * Get the name property: The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, * EnterpriseFlash_F300 etc.). diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetail.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetail.java new file mode 100644 index 000000000000..04c0f767ee89 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetail.java @@ -0,0 +1,56 @@ +// 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; + +/** + * Sku Detail + * + *

Information about Sku. + */ +@Fluent +public final class SkuDetail { + /* + * The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.) + */ + @JsonProperty(value = "name") + private Name name; + + /** Creates an instance of SkuDetail class. */ + public SkuDetail() { + } + + /** + * Get the name property: The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, + * EnterpriseFlash_F300 etc.). + * + * @return the name value. + */ + public Name name() { + return this.name; + } + + /** + * Set the name property: The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, + * EnterpriseFlash_F300 etc.). + * + * @param name the name value to set. + * @return the SkuDetail object itself. + */ + public SkuDetail withName(Name name) { + this.name = name; + 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/models/SkuName.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuName.java index 9b274b181383..8ae5fe7a0c7d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuName.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuName.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SkuName. */ +/** The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). */ public final class SkuName extends ExpandableStringEnum { /** Static value Enterprise_E10 for SkuName. */ public static final SkuName ENTERPRISE_E10 = fromString("Enterprise_E10"); @@ -31,6 +31,15 @@ public final class SkuName extends ExpandableStringEnum { /** Static value EnterpriseFlash_F1500 for SkuName. */ public static final SkuName ENTERPRISE_FLASH_F1500 = fromString("EnterpriseFlash_F1500"); + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + /** * Creates or finds a SkuName from its string representation. * @@ -42,7 +51,11 @@ public static SkuName fromString(String name) { return fromString(name, SkuName.class); } - /** @return known SkuName values. */ + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ public static Collection values() { return values(SkuName.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Skus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Skus.java new file mode 100644 index 000000000000..0d035c1bae9f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Skus.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Gets information about skus in specified location for the given subscription id. + * + * @param location The name of Azure region. + * @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 information about skus in specified location for the given subscription id as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/TlsVersion.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/TlsVersion.java index 63307ebcccd7..608d71f2c4fa 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/TlsVersion.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/TlsVersion.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TlsVersion. */ +/** The minimum TLS version for the cluster to support, e.g. '1.2'. */ public final class TlsVersion extends ExpandableStringEnum { /** Static value 1.0 for TlsVersion. */ public static final TlsVersion ONE_ZERO = fromString("1.0"); @@ -19,6 +19,15 @@ public final class TlsVersion extends ExpandableStringEnum { /** Static value 1.2 for TlsVersion. */ public static final TlsVersion ONE_TWO = fromString("1.2"); + /** + * Creates a new instance of TlsVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TlsVersion() { + } + /** * Creates or finds a TlsVersion from its string representation. * @@ -30,7 +39,11 @@ public static TlsVersion fromString(String name) { return fromString(name, TlsVersion.class); } - /** @return known TlsVersion values. */ + /** + * Gets known TlsVersion values. + * + * @return known TlsVersion values. + */ public static Collection values() { return values(TlsVersion.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/UserAssignedIdentity.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..e9d7f0cb6c47 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// 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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 index ebbd81f86347..38cd9fcae483 100644 --- 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 @@ -17,7 +17,7 @@ /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate. @@ -45,7 +45,7 @@ public static void redisEnterpriseDatabasesCreate( } /* - * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2022-01-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json */ /** * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. 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 index b0c5d0b23ba6..62f5a06b8e6f 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesDelete.json */ /** * Sample code: RedisEnterpriseDatabasesDelete. @@ -18,6 +16,6 @@ public final class DatabasesDeleteSamples { */ public static void redisEnterpriseDatabasesDelete( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().delete("rg1", "cache1", "db1", Context.NONE); + manager.databases().delete("rg1", "cache1", "db1", com.azure.core.util.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 index 6d500ad257d9..3f88f12b2f0f 100644 --- 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 @@ -4,13 +4,12 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesExport.json */ /** * Sample code: RedisEnterpriseDatabasesExport. @@ -27,6 +26,6 @@ public static void redisEnterpriseDatabasesExport( "default", new ExportClusterParameters() .withSasUri("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushSamples.java new file mode 100644 index 000000000000..326ea36a78ec --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushSamples.java @@ -0,0 +1,35 @@ +// 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.FlushParameters; +import java.util.Arrays; + +/** Samples for Databases Flush. */ +public final class DatabasesFlushSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesFlush.json + */ + /** + * Sample code: How to flush all the keys in the database. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToFlushAllTheKeysInTheDatabase( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager + .databases() + .flush( + "rg1", + "cache1", + "default", + new FlushParameters() + .withIds( + Arrays + .asList( + "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + com.azure.core.util.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 index 96b4a7c79420..937ba66aa8c8 100644 --- 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 @@ -4,14 +4,13 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesForceUnlink.json */ /** * Sample code: How to unlink a database during a regional outage. @@ -31,6 +30,6 @@ public static void howToUnlinkADatabaseDuringARegionalOutage( Arrays .asList( "/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), - Context.NONE); + com.azure.core.util.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 index dccbf4506d7f..4afaa584562c 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesGet.json */ /** * Sample code: RedisEnterpriseDatabasesGet. @@ -18,6 +16,6 @@ public final class DatabasesGetSamples { */ public static void redisEnterpriseDatabasesGet( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE); + manager.databases().getWithResponse("rg1", "cache1", "default", com.azure.core.util.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 index 37665f5f0ea2..51e054badbec 100644 --- 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 @@ -4,14 +4,13 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesImport.json */ /** * Sample code: RedisEnterpriseDatabasesImport. @@ -32,6 +31,6 @@ public static void redisEnterpriseDatabasesImport( .asList( "https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters", "https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")), - Context.NONE); + com.azure.core.util.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 index 645a4336e11e..3d2345f7f550 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesListByCluster.json */ /** * Sample code: RedisEnterpriseDatabasesListByCluster. @@ -18,6 +16,6 @@ public final class DatabasesListByClusterSamples { */ public static void redisEnterpriseDatabasesListByCluster( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().listByCluster("rg1", "cache1", Context.NONE); + manager.databases().listByCluster("rg1", "cache1", com.azure.core.util.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 index 36d9b2b6c87f..810aebae03b7 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesListKeys.json */ /** * Sample code: RedisEnterpriseDatabasesListKeys. @@ -18,6 +16,6 @@ public final class DatabasesListKeysSamples { */ public static void redisEnterpriseDatabasesListKeys( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.databases().listKeysWithResponse("rg1", "cache1", "default", Context.NONE); + manager.databases().listKeysWithResponse("rg1", "cache1", "default", com.azure.core.util.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 index d9603e2e4150..a35052532820 100644 --- 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 @@ -4,14 +4,13 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesRegenerateKey.json */ /** * Sample code: RedisEnterpriseDatabasesRegenerateKey. @@ -27,6 +26,6 @@ public static void redisEnterpriseDatabasesRegenerateKey( "cache1", "default", new RegenerateKeyParameters().withKeyType(AccessKeyType.PRIMARY), - Context.NONE); + com.azure.core.util.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 index a8fb3c81d85d..56565da1f665 100644 --- 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 @@ -4,7 +4,6 @@ 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; @@ -14,7 +13,7 @@ /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDatabasesUpdate.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate. @@ -23,7 +22,11 @@ public final class DatabasesUpdateSamples { */ public static void redisEnterpriseDatabasesUpdate( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - Database resource = manager.databases().getWithResponse("rg1", "cache1", "default", Context.NONE).getValue(); + Database resource = + manager + .databases() + .getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withClientProtocol(Protocol.ENCRYPTED) 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 index 8a9922709fe7..665c43997f3f 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/OperationsList.json */ /** * Sample code: OperationsList. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void operationsList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.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 index b8071d5218ad..271cbd96ea8b 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. @@ -17,6 +15,6 @@ public final class OperationsStatusGetSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void operationsStatusGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.operationsStatus().getWithResponse("West US", "testoperationid", Context.NONE); + manager.operationsStatus().getWithResponse("West US", "testoperationid", com.azure.core.util.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 index 972dcdb3cefa..67c0b482b470 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDeletePrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. @@ -18,6 +16,8 @@ public final class PrivateEndpointConnectionsDeleteSamples { */ public static void redisEnterpriseDeletePrivateEndpointConnection( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + manager + .privateEndpointConnections() + .deleteWithResponse("rg1", "cache1", "pectest01", com.azure.core.util.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 index ff6058992039..926418d4529e 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseGetPrivateEndpointConnection. @@ -18,6 +16,8 @@ public final class PrivateEndpointConnectionsGetSamples { */ public static void redisEnterpriseGetPrivateEndpointConnection( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().getWithResponse("rg1", "cache1", "pectest01", Context.NONE); + manager + .privateEndpointConnections() + .getWithResponse("rg1", "cache1", "pectest01", com.azure.core.util.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 index ff7836df7937..137cdd9ad570 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListPrivateEndpointConnections.json */ /** * Sample code: RedisEnterpriseListPrivateEndpointConnections. @@ -18,6 +16,6 @@ public final class PrivateEndpointConnectionsListSamples { */ public static void redisEnterpriseListPrivateEndpointConnections( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateEndpointConnections().list("rg1", "cache1", Context.NONE); + manager.privateEndpointConnections().list("rg1", "cache1", com.azure.core.util.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 index 7b661ef47e30..afa3503d855f 100644 --- 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 @@ -10,7 +10,7 @@ /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json */ /** * Sample code: RedisEnterprisePutPrivateEndpointConnection. 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 index 3a84b7d8e806..95b20f5b140b 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListPrivateLinkResources.json */ /** * Sample code: RedisEnterpriseListPrivateLinkResources. @@ -18,6 +16,6 @@ public final class PrivateLinkResourcesListByClusterSamples { */ public static void redisEnterpriseListPrivateLinkResources( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.privateLinkResources().listByCluster("rg1", "cache1", Context.NONE); + manager.privateLinkResources().listByCluster("rg1", "cache1", com.azure.core.util.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 index 31ea01667211..0e215713432d 100644 --- 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 @@ -4,9 +4,16 @@ package com.azure.resourcemanager.redisenterprise.generated; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.redisenterprise.models.CmkIdentityType; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redisenterprise.models.Sku; import com.azure.resourcemanager.redisenterprise.models.SkuName; import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -14,7 +21,7 @@ /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseCreate.json */ /** * Sample code: RedisEnterpriseCreate. @@ -30,7 +37,24 @@ public static void redisEnterpriseCreate(com.azure.resourcemanager.redisenterpri .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(3)) .withTags(mapOf("tag1", "value1")) .withZones(Arrays.asList("1", "2", "3")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity", + new UserAssignedIdentity()))) .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withEncryption( + new ClusterPropertiesEncryption() + .withCustomerManagedKeyEncryption( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryption() + .withKeyEncryptionKeyIdentity( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() + .withUserAssignedIdentityResourceId( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity") + .withIdentityType(CmkIdentityType.USER_ASSIGNED_IDENTITY)) + .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) .create(); } 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 index 0a0f0070a401..a84c3525976d 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseDelete.json */ /** * Sample code: RedisEnterpriseDelete. @@ -17,6 +15,6 @@ public final class RedisEnterpriseDeleteSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().delete("rg1", "cache1", Context.NONE); + manager.redisEnterprises().delete("rg1", "cache1", com.azure.core.util.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 index 3942e555d88f..65dfb9caa35f 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseGet.json */ /** * Sample code: RedisEnterpriseGet. @@ -17,6 +15,6 @@ public final class RedisEnterpriseGetByResourceGroupSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.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 index 09ceca6733b8..6bf487cdaecf 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseListByResourceGroup.json */ /** * Sample code: RedisEnterpriseListByResourceGroup. @@ -18,6 +16,6 @@ public final class RedisEnterpriseListByResourceGroupSamples { */ public static void redisEnterpriseListByResourceGroup( com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().listByResourceGroup("rg1", Context.NONE); + manager.redisEnterprises().listByResourceGroup("rg1", com.azure.core.util.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 index f2dce7e7c9d6..caee449cc761 100644 --- 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 @@ -4,12 +4,10 @@ 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseList.json */ /** * Sample code: RedisEnterpriseList. @@ -17,6 +15,6 @@ public final class RedisEnterpriseListSamples { * @param manager Entry point to RedisEnterpriseManager. */ public static void redisEnterpriseList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { - manager.redisEnterprises().list(Context.NONE); + manager.redisEnterprises().list(com.azure.core.util.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 index 43b2c0f5b69f..05b9adf7bc81 100644 --- 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 @@ -4,7 +4,6 @@ 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; @@ -15,7 +14,7 @@ /** 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 + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseUpdate.json */ /** * Sample code: RedisEnterpriseUpdate. @@ -24,7 +23,10 @@ public final class RedisEnterpriseUpdateSamples { */ public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { Cluster resource = - manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + manager + .redisEnterprises() + .getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withTags(mapOf("tag1", "value1")) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/SkusListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/SkusListSamples.java new file mode 100644 index 000000000000..a7560f8f95a0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/SkusListSamples.java @@ -0,0 +1,20 @@ +// 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; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2023-03-01-preview/examples/RedisEnterpriseSkusList.json + */ + /** + * Sample code: SkusList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void skusList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.skus().list("westus2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/CapabilityTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/CapabilityTests.java new file mode 100644 index 000000000000..610043a8d46d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/CapabilityTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.Capability; +import org.junit.jupiter.api.Assertions; + +public final class CapabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Capability model = + BinaryData.fromString("{\"name\":\"oklyaxuconuq\",\"value\":false}").toObject(Capability.class); + Assertions.assertEquals("oklyaxuconuq", model.name()); + Assertions.assertEquals(false, model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Capability model = new Capability().withName("oklyaxuconuq").withValue(false); + model = BinaryData.fromObject(model).toObject(Capability.class); + Assertions.assertEquals("oklyaxuconuq", model.name()); + Assertions.assertEquals(false, model.value()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterInnerTests.java new file mode 100644 index 000000000000..366e0069b981 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterInnerTests.java @@ -0,0 +1,73 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ClusterInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterInner model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"EnterpriseFlash_F700\",\"capacity\":992034682},\"zones\":[\"k\",\"vd\"],\"identity\":{\"principalId\":\"fe6d4757-06a9-45f2-8c07-7cba50454b99\",\"tenantId\":\"3d06b81f-db5f-4948-a67d-dccd92fd370c\",\"type\":\"None\",\"userAssignedIdentities\":{\"ukxgaud\":{\"principalId\":\"eee9d496-073e-4b6a-990b-9a50c84d3e28\",\"clientId\":\"5d4cc358-2895-499a-9cc3-32e4b9a5a4dd\"},\"nhsjcnyej\":{\"principalId\":\"a684c0e7-7bac-4ebe-80d3-c6416db7c849\",\"clientId\":\"efd45439-3e7c-45e0-8ab0-585a134a339a\"}}},\"properties\":{\"minimumTlsVersion\":\"1.0\",\"encryption\":{},\"hostName\":\"apcz\",\"provisioningState\":\"Creating\",\"resourceState\":\"DeleteFailed\",\"redisVersion\":\"emkkvnipjox\",\"privateEndpointConnections\":[{\"id\":\"gejspodmailzyde\",\"name\":\"o\",\"type\":\"wyahuxinpmqnja\"},{\"id\":\"xj\",\"name\":\"prozvcputegjvwmf\",\"type\":\"atscmd\"}]},\"location\":\"jhulsuuvmkjo\",\"tags\":{\"ej\":\"wfndiodjpsl\",\"azakl\":\"pvwryoqpsoacc\"},\"id\":\"lahbcryff\",\"name\":\"fdosyg\",\"type\":\"xpaojakhmsbz\"}") + .toObject(ClusterInner.class); + Assertions.assertEquals("jhulsuuvmkjo", model.location()); + Assertions.assertEquals("wfndiodjpsl", model.tags().get("ej")); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F700, model.sku().name()); + Assertions.assertEquals(992034682, model.sku().capacity()); + Assertions.assertEquals("k", model.zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterInner model = + new ClusterInner() + .withLocation("jhulsuuvmkjo") + .withTags(mapOf("ej", "wfndiodjpsl", "azakl", "pvwryoqpsoacc")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F700).withCapacity(992034682)) + .withZones(Arrays.asList("k", "vd")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities( + mapOf("ukxgaud", new UserAssignedIdentity(), "nhsjcnyej", new UserAssignedIdentity()))) + .withMinimumTlsVersion(TlsVersion.ONE_ZERO) + .withEncryption(new ClusterPropertiesEncryption()); + model = BinaryData.fromObject(model).toObject(ClusterInner.class); + Assertions.assertEquals("jhulsuuvmkjo", model.location()); + Assertions.assertEquals("wfndiodjpsl", model.tags().get("ej")); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F700, model.sku().name()); + Assertions.assertEquals(992034682, model.sku().capacity()); + Assertions.assertEquals("k", model.zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersion()); + } + + @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/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterListTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterListTests.java new file mode 100644 index 000000000000..9a62e1ea7c94 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterListTests.java @@ -0,0 +1,114 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; +import com.azure.resourcemanager.redisenterprise.models.ClusterList; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +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; +import org.junit.jupiter.api.Assertions; + +public final class ClusterListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterList model = + BinaryData + .fromString( + "{\"value\":[{\"sku\":{\"name\":\"Enterprise_E100\",\"capacity\":757698897},\"zones\":[\"l\",\"ndlik\",\"yqkgfg\"],\"identity\":{\"principalId\":\"66ecb295-38ae-4c4b-8800-a916a1ee454e\",\"tenantId\":\"9feaa53f-4032-48b5-9212-e0ea96151cd0\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.1\",\"hostName\":\"rxybz\",\"provisioningState\":\"Canceled\",\"resourceState\":\"Disabled\",\"redisVersion\":\"tbciqfouflmm\",\"privateEndpointConnections\":[]},\"location\":\"smodmgloug\",\"tags\":{\"ta\":\"wtmutduq\",\"whbmd\":\"spwgcuertumkdosv\",\"bhtqqrolfpfpsa\":\"bbjfddgmbmbexp\",\"jgzjaoyfhrtx\":\"gbquxigj\"},\"id\":\"lnerkujysvleju\",\"name\":\"fqawrlyxw\",\"type\":\"kcprbnw\"},{\"sku\":{\"name\":\"EnterpriseFlash_F1500\",\"capacity\":19976049},\"zones\":[\"bvpyss\",\"dnrujqguhmuouqfp\",\"wzwbnguitn\"],\"identity\":{\"principalId\":\"a369edef-132c-4f2e-8fa5-66b86bace413\",\"tenantId\":\"69e5849e-9803-49eb-bfc0-703914786446\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.1\",\"hostName\":\"zuckyfi\",\"provisioningState\":\"Creating\",\"resourceState\":\"EnableFailed\",\"redisVersion\":\"vzwdzuhtymwis\",\"privateEndpointConnections\":[]},\"location\":\"thwxmnteiwaopvkm\",\"tags\":{\"uf\":\"mmxdcu\"},\"id\":\"rpymzidnsez\",\"name\":\"xtbzsgfyccsne\",\"type\":\"mdwzjeiachboo\"},{\"sku\":{\"name\":\"Enterprise_E20\",\"capacity\":219333087},\"zones\":[\"sfqpteehz\",\"vypyqrimzinpv\",\"wjdk\"],\"identity\":{\"principalId\":\"532cfe8f-6574-4a1c-ae91-8751890a9146\",\"tenantId\":\"340509cb-973d-4bd1-8d40-9e1c6bffe87e\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.0\",\"hostName\":\"mnoh\",\"provisioningState\":\"Failed\",\"resourceState\":\"Running\",\"redisVersion\":\"dsoifiyipj\",\"privateEndpointConnections\":[]},\"location\":\"wpgrjbzno\",\"tags\":{\"nb\":\"xv\",\"rzafbljjgpbtoqcj\":\"xqabnmocpcysh\",\"vbqid\":\"klj\"},\"id\":\"qajzyulpkudjkr\",\"name\":\"khbzhfepgzg\",\"type\":\"e\"},{\"sku\":{\"name\":\"Enterprise_E20\",\"capacity\":1678385538},\"zones\":[\"scpai\",\"rhhbcs\",\"l\"],\"identity\":{\"principalId\":\"884efdeb-3484-49ab-87df-8ade42d5ad0b\",\"tenantId\":\"2fa44bb3-38d6-4654-8509-3f15c6eb7f9d\",\"type\":\"SystemAssigned," + + " UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.2\",\"hostName\":\"obnbdxkqpxokaj\",\"provisioningState\":\"Succeeded\",\"resourceState\":\"Disabling\",\"redisVersion\":\"ex\",\"privateEndpointConnections\":[]},\"location\":\"xgcp\",\"tags\":{\"mcl\":\"maajrmvdjwzrlo\",\"jctbza\":\"hijco\"},\"id\":\"s\",\"name\":\"sycbkbfk\",\"type\":\"ukdkexxppofmxa\"}],\"nextLink\":\"fjpgddtocjjxhvp\"}") + .toObject(ClusterList.class); + Assertions.assertEquals("smodmgloug", model.value().get(0).location()); + Assertions.assertEquals("wtmutduq", model.value().get(0).tags().get("ta")); + Assertions.assertEquals(SkuName.ENTERPRISE_E100, model.value().get(0).sku().name()); + Assertions.assertEquals(757698897, model.value().get(0).sku().capacity()); + Assertions.assertEquals("l", model.value().get(0).zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); + Assertions.assertEquals(TlsVersion.ONE_ONE, model.value().get(0).minimumTlsVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterList model = + new ClusterList() + .withValue( + Arrays + .asList( + new ClusterInner() + .withLocation("smodmgloug") + .withTags( + mapOf( + "ta", + "wtmutduq", + "whbmd", + "spwgcuertumkdosv", + "bhtqqrolfpfpsa", + "bbjfddgmbmbexp", + "jgzjaoyfhrtx", + "gbquxigj")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_E100).withCapacity(757698897)) + .withZones(Arrays.asList("l", "ndlik", "yqkgfg")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withMinimumTlsVersion(TlsVersion.ONE_ONE), + new ClusterInner() + .withLocation("thwxmnteiwaopvkm") + .withTags(mapOf("uf", "mmxdcu")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F1500).withCapacity(19976049)) + .withZones(Arrays.asList("bvpyss", "dnrujqguhmuouqfp", "wzwbnguitn")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf())) + .withMinimumTlsVersion(TlsVersion.ONE_ONE), + new ClusterInner() + .withLocation("wpgrjbzno") + .withTags(mapOf("nb", "xv", "rzafbljjgpbtoqcj", "xqabnmocpcysh", "vbqid", "klj")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_E20).withCapacity(219333087)) + .withZones(Arrays.asList("sfqpteehz", "vypyqrimzinpv", "wjdk")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .withMinimumTlsVersion(TlsVersion.ONE_ZERO), + new ClusterInner() + .withLocation("xgcp") + .withTags(mapOf("mcl", "maajrmvdjwzrlo", "jctbza", "hijco")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_E20).withCapacity(1678385538)) + .withZones(Arrays.asList("scpai", "rhhbcs", "l")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf())) + .withMinimumTlsVersion(TlsVersion.ONE_TWO))); + model = BinaryData.fromObject(model).toObject(ClusterList.class); + Assertions.assertEquals("smodmgloug", model.value().get(0).location()); + Assertions.assertEquals("wtmutduq", model.value().get(0).tags().get("ta")); + Assertions.assertEquals(SkuName.ENTERPRISE_E100, model.value().get(0).sku().name()); + Assertions.assertEquals(757698897, model.value().get(0).sku().capacity()); + Assertions.assertEquals("l", model.value().get(0).zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); + Assertions.assertEquals(TlsVersion.ONE_ONE, model.value().get(0).minimumTlsVersion()); + } + + @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/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentityTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentityTests.java new file mode 100644 index 000000000000..f4ebd3e0e5c6 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentityTests.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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.redisenterprise.models.CmkIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model = + BinaryData + .fromString( + "{\"userAssignedIdentityResourceId\":\"ininmay\",\"identityType\":\"systemAssignedIdentity\"}") + .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class); + Assertions.assertEquals("ininmay", model.userAssignedIdentityResourceId()); + Assertions.assertEquals(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY, model.identityType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model = + new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() + .withUserAssignedIdentityResourceId("ininmay") + .withIdentityType(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY); + model = + BinaryData + .fromObject(model) + .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class); + Assertions.assertEquals("ininmay", model.userAssignedIdentityResourceId()); + Assertions.assertEquals(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY, model.identityType()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterUpdateTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterUpdateTests.java new file mode 100644 index 000000000000..682d7dcd0eea --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ClusterUpdateTests.java @@ -0,0 +1,72 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterUpdate; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ClusterUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterUpdate model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"EnterpriseFlash_F300\",\"capacity\":422670277},\"properties\":{\"minimumTlsVersion\":\"1.0\",\"encryption\":{},\"hostName\":\"tnhxbn\",\"provisioningState\":\"Creating\",\"resourceState\":\"EnableFailed\",\"redisVersion\":\"rglssainqpj\",\"privateEndpointConnections\":[{\"id\":\"jfm\",\"name\":\"pee\",\"type\":\"vmgxsab\"},{\"id\":\"duuji\",\"name\":\"c\",\"type\":\"czdzev\"},{\"id\":\"krwpdap\",\"name\":\"dsbdkvwrwjf\",\"type\":\"usnhutje\"},{\"id\":\"rl\",\"name\":\"hugjzzdatqxhoc\",\"type\":\"geablgphuticndvk\"}]},\"identity\":{\"principalId\":\"d5f6f6d7-8077-4676-af17-a64fddba6e5b\",\"tenantId\":\"16d70fc0-155f-42ed-8fde-4493b28379d9\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hxh\":{\"principalId\":\"c0a965f4-680a-4f60-b4e8-b8a009d19953\",\"clientId\":\"b62d2ff2-6cab-47d1-8bd0-3f164b075a64\"},\"k\":{\"principalId\":\"b5e8118f-935d-45fc-9993-aba8653de6b5\",\"clientId\":\"cb8875af-2235-47ef-a04a-c698740d9367\"},\"xolniwpwcukjfk\":{\"principalId\":\"0be7067e-a0b6-48b2-b22c-8df3a1efb3f2\",\"clientId\":\"4a994955-6c2b-4f39-8a60-8f3eb4a1f73b\"}}},\"tags\":{\"klryplwck\":\"w\",\"pnddhsgcbacphejk\":\"asy\"}}") + .toObject(ClusterUpdate.class); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F300, model.sku().name()); + Assertions.assertEquals(422670277, model.sku().capacity()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("w", model.tags().get("klryplwck")); + Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterUpdate model = + new ClusterUpdate() + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(422670277)) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "hxh", + new UserAssignedIdentity(), + "k", + new UserAssignedIdentity(), + "xolniwpwcukjfk", + new UserAssignedIdentity()))) + .withTags(mapOf("klryplwck", "w", "pnddhsgcbacphejk", "asy")) + .withMinimumTlsVersion(TlsVersion.ONE_ZERO) + .withEncryption(new ClusterPropertiesEncryption()); + model = BinaryData.fromObject(model).toObject(ClusterUpdate.class); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F300, model.sku().name()); + Assertions.assertEquals(422670277, model.sku().capacity()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("w", model.tags().get("klryplwck")); + Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersion()); + } + + @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/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseInnerTests.java new file mode 100644 index 000000000000..8bc50f5acc18 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseInnerTests.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.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; +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.Module; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DatabaseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DatabaseInner model = + BinaryData + .fromString( + "{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":248377661,\"provisioningState\":\"Succeeded\",\"resourceState\":\"Creating\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"VolatileRandom\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"always\",\"rdbFrequency\":\"6h\"},\"modules\":[{\"name\":\"ftutqxlngxlefgu\",\"args\":\"xkrxdqmi\",\"version\":\"thz\"},{\"name\":\"vqdra\",\"args\":\"jybige\",\"version\":\"qfbow\"},{\"name\":\"kanyktzlcuiywg\",\"args\":\"wgndrvynhzgpp\",\"version\":\"cgyncocpecf\"},{\"name\":\"m\",\"args\":\"oo\",\"version\":\"xlzevgbmqjqabcy\"}],\"geoReplication\":{\"groupNickname\":\"vkwlzuvccfwnf\",\"linkedDatabases\":[]}},\"id\":\"fionl\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"}") + .toObject(DatabaseInner.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(248377661, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.VOLATILE_RANDOM, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(false, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.SIXH, model.persistence().rdbFrequency()); + Assertions.assertEquals("ftutqxlngxlefgu", model.modules().get(0).name()); + Assertions.assertEquals("xkrxdqmi", model.modules().get(0).args()); + Assertions.assertEquals("vkwlzuvccfwnf", model.geoReplication().groupNickname()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DatabaseInner model = + new DatabaseInner() + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(248377661) + .withClusteringPolicy(ClusteringPolicy.OSSCLUSTER) + .withEvictionPolicy(EvictionPolicy.VOLATILE_RANDOM) + .withPersistence( + new Persistence() + .withAofEnabled(true) + .withRdbEnabled(false) + .withAofFrequency(AofFrequency.ALWAYS) + .withRdbFrequency(RdbFrequency.SIXH)) + .withModules( + Arrays + .asList( + new Module().withName("ftutqxlngxlefgu").withArgs("xkrxdqmi"), + new Module().withName("vqdra").withArgs("jybige"), + new Module().withName("kanyktzlcuiywg").withArgs("wgndrvynhzgpp"), + new Module().withName("m").withArgs("oo"))) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("vkwlzuvccfwnf") + .withLinkedDatabases(Arrays.asList())); + model = BinaryData.fromObject(model).toObject(DatabaseInner.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(248377661, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.VOLATILE_RANDOM, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(false, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.SIXH, model.persistence().rdbFrequency()); + Assertions.assertEquals("ftutqxlngxlefgu", model.modules().get(0).name()); + Assertions.assertEquals("xkrxdqmi", model.modules().get(0).args()); + Assertions.assertEquals("vkwlzuvccfwnf", model.geoReplication().groupNickname()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseListTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseListTests.java new file mode 100644 index 000000000000..49347126f3ae --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseListTests.java @@ -0,0 +1,55 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabaseList; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DatabaseListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DatabaseList model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":2146697807,\"provisioningState\":\"Deleting\",\"resourceState\":\"Disabling\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"VolatileLFU\",\"modules\":[]},\"id\":\"vddntwn\",\"name\":\"eic\",\"type\":\"twnpzaoqvuhrhcf\"},{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":1519639894,\"provisioningState\":\"Failed\",\"resourceState\":\"Creating\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"AllKeysLFU\",\"modules\":[]},\"id\":\"icxm\",\"name\":\"ciwqvhk\",\"type\":\"ixuigdtopbobj\"}],\"nextLink\":\"hm\"}") + .toObject(DatabaseList.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.value().get(0).clientProtocol()); + Assertions.assertEquals(2146697807, model.value().get(0).port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.value().get(0).clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.VOLATILE_LFU, model.value().get(0).evictionPolicy()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DatabaseList model = + new DatabaseList() + .withValue( + Arrays + .asList( + new DatabaseInner() + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(2146697807) + .withClusteringPolicy(ClusteringPolicy.OSSCLUSTER) + .withEvictionPolicy(EvictionPolicy.VOLATILE_LFU) + .withModules(Arrays.asList()), + new DatabaseInner() + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(1519639894) + .withClusteringPolicy(ClusteringPolicy.OSSCLUSTER) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LFU) + .withModules(Arrays.asList()))); + model = BinaryData.fromObject(model).toObject(DatabaseList.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.value().get(0).clientProtocol()); + Assertions.assertEquals(2146697807, model.value().get(0).port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.value().get(0).clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.VOLATILE_LFU, model.value().get(0).evictionPolicy()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesGeoReplicationTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesGeoReplicationTests.java new file mode 100644 index 000000000000..6cf75af31d89 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesGeoReplicationTests.java @@ -0,0 +1,41 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DatabasePropertiesGeoReplicationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DatabasePropertiesGeoReplication model = + BinaryData + .fromString( + "{\"groupNickname\":\"zzvdudgwds\",\"linkedDatabases\":[{\"id\":\"twmcynpwlb\",\"state\":\"LinkFailed\"},{\"id\":\"acfta\",\"state\":\"UnlinkFailed\"},{\"id\":\"nltyfsoppusuesnz\",\"state\":\"Linking\"},{\"id\":\"bavo\",\"state\":\"Unlinking\"}]}") + .toObject(DatabasePropertiesGeoReplication.class); + Assertions.assertEquals("zzvdudgwds", model.groupNickname()); + Assertions.assertEquals("twmcynpwlb", model.linkedDatabases().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DatabasePropertiesGeoReplication model = + new DatabasePropertiesGeoReplication() + .withGroupNickname("zzvdudgwds") + .withLinkedDatabases( + Arrays + .asList( + new LinkedDatabase().withId("twmcynpwlb"), + new LinkedDatabase().withId("acfta"), + new LinkedDatabase().withId("nltyfsoppusuesnz"), + new LinkedDatabase().withId("bavo"))); + model = BinaryData.fromObject(model).toObject(DatabasePropertiesGeoReplication.class); + Assertions.assertEquals("zzvdudgwds", model.groupNickname()); + Assertions.assertEquals("twmcynpwlb", model.linkedDatabases().get(0).id()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesTests.java new file mode 100644 index 000000000000..1717ca2791d1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseProperties; +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 com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DatabasePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DatabaseProperties model = + BinaryData + .fromString( + "{\"clientProtocol\":\"Encrypted\",\"port\":61111335,\"provisioningState\":\"Failed\",\"resourceState\":\"Running\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"AllKeysRandom\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":true,\"aofFrequency\":\"always\",\"rdbFrequency\":\"6h\"},\"modules\":[{\"name\":\"xaqwoochcbonqv\",\"args\":\"vlrxnjeaseiph\",\"version\":\"f\"}],\"geoReplication\":{\"groupNickname\":\"eyy\",\"linkedDatabases\":[{\"id\":\"bdlwtgrhpdjpj\",\"state\":\"Unlinking\"}]}}") + .toObject(DatabaseProperties.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(61111335, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.ALL_KEYS_RANDOM, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(true, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.SIXH, model.persistence().rdbFrequency()); + Assertions.assertEquals("xaqwoochcbonqv", model.modules().get(0).name()); + Assertions.assertEquals("vlrxnjeaseiph", model.modules().get(0).args()); + Assertions.assertEquals("eyy", model.geoReplication().groupNickname()); + Assertions.assertEquals("bdlwtgrhpdjpj", model.geoReplication().linkedDatabases().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DatabaseProperties model = + new DatabaseProperties() + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(61111335) + .withClusteringPolicy(ClusteringPolicy.OSSCLUSTER) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_RANDOM) + .withPersistence( + new Persistence() + .withAofEnabled(true) + .withRdbEnabled(true) + .withAofFrequency(AofFrequency.ALWAYS) + .withRdbFrequency(RdbFrequency.SIXH)) + .withModules(Arrays.asList(new Module().withName("xaqwoochcbonqv").withArgs("vlrxnjeaseiph"))) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("eyy") + .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId("bdlwtgrhpdjpj")))); + model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(61111335, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.ALL_KEYS_RANDOM, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(true, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.SIXH, model.persistence().rdbFrequency()); + Assertions.assertEquals("xaqwoochcbonqv", model.modules().get(0).name()); + Assertions.assertEquals("vlrxnjeaseiph", model.modules().get(0).args()); + Assertions.assertEquals("eyy", model.geoReplication().groupNickname()); + Assertions.assertEquals("bdlwtgrhpdjpj", model.geoReplication().linkedDatabases().get(0).id()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseUpdateTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseUpdateTests.java new file mode 100644 index 000000000000..b3064decc012 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabaseUpdateTests.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.generated; + +import com.azure.core.util.BinaryData; +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.DatabaseUpdate; +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.RdbFrequency; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DatabaseUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DatabaseUpdate model = + BinaryData + .fromString( + "{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":1222672575,\"provisioningState\":\"Creating\",\"resourceState\":\"Disabled\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"NoEviction\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"always\",\"rdbFrequency\":\"1h\"},\"modules\":[{\"name\":\"lazjdyggdtjixhbk\",\"args\":\"fqweykhmene\",\"version\":\"yexfwh\"},{\"name\":\"bcibvyvdcsitynn\",\"args\":\"mdectehfiqscjey\",\"version\":\"hezrkgq\"}],\"geoReplication\":{\"groupNickname\":\"refovgmkqsleyyvx\",\"linkedDatabases\":[]}}}") + .toObject(DatabaseUpdate.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(1222672575, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.NO_EVICTION, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(false, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONEH, model.persistence().rdbFrequency()); + Assertions.assertEquals("lazjdyggdtjixhbk", model.modules().get(0).name()); + Assertions.assertEquals("fqweykhmene", model.modules().get(0).args()); + Assertions.assertEquals("refovgmkqsleyyvx", model.geoReplication().groupNickname()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DatabaseUpdate model = + new DatabaseUpdate() + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(1222672575) + .withClusteringPolicy(ClusteringPolicy.OSSCLUSTER) + .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withPersistence( + new Persistence() + .withAofEnabled(true) + .withRdbEnabled(false) + .withAofFrequency(AofFrequency.ALWAYS) + .withRdbFrequency(RdbFrequency.ONEH)) + .withModules( + Arrays + .asList( + new Module().withName("lazjdyggdtjixhbk").withArgs("fqweykhmene"), + new Module().withName("bcibvyvdcsitynn").withArgs("mdectehfiqscjey"))) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("refovgmkqsleyyvx") + .withLinkedDatabases(Arrays.asList())); + model = BinaryData.fromObject(model).toObject(DatabaseUpdate.class); + Assertions.assertEquals(Protocol.ENCRYPTED, model.clientProtocol()); + Assertions.assertEquals(1222672575, model.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, model.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.NO_EVICTION, model.evictionPolicy()); + Assertions.assertEquals(true, model.persistence().aofEnabled()); + Assertions.assertEquals(false, model.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONEH, model.persistence().rdbFrequency()); + Assertions.assertEquals("lazjdyggdtjixhbk", model.modules().get(0).name()); + Assertions.assertEquals("fqweykhmene", model.modules().get(0).args()); + Assertions.assertEquals("refovgmkqsleyyvx", model.geoReplication().groupNickname()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateMockTests.java new file mode 100644 index 000000000000..1d026883e806 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateMockTests.java @@ -0,0 +1,102 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +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.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesCreateMockTests { + @Test + public void testCreate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":1688847935,\"provisioningState\":\"Succeeded\",\"resourceState\":\"CreateFailed\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"VolatileLFU\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"1s\",\"rdbFrequency\":\"12h\"},\"modules\":[],\"geoReplication\":{\"groupNickname\":\"qaqtdoqmcbxvwvxy\",\"linkedDatabases\":[]}},\"id\":\"bhsfxob\",\"name\":\"ytkblmpew\",\"type\":\"wfbkrvrns\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Database response = + manager + .databases() + .define("pfqbuaceopzf") + .withExistingRedisEnterprise("pkteo", "llwptfdy") + .withClientProtocol(Protocol.ENCRYPTED) + .withPort(350693240) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) + .withEvictionPolicy(EvictionPolicy.VOLATILE_LFU) + .withPersistence( + new Persistence() + .withAofEnabled(true) + .withRdbEnabled(true) + .withAofFrequency(AofFrequency.ONES) + .withRdbFrequency(RdbFrequency.ONEH)) + .withModules(Arrays.asList()) + .withGeoReplication( + new DatabasePropertiesGeoReplication() + .withGroupNickname("gbkdmoizpos") + .withLinkedDatabases(Arrays.asList())) + .create(); + + Assertions.assertEquals(Protocol.ENCRYPTED, response.clientProtocol()); + Assertions.assertEquals(1688847935, response.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, response.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.VOLATILE_LFU, response.evictionPolicy()); + Assertions.assertEquals(true, response.persistence().aofEnabled()); + Assertions.assertEquals(false, response.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ONES, response.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONE_TWOH, response.persistence().rdbFrequency()); + Assertions.assertEquals("qaqtdoqmcbxvwvxy", response.geoReplication().groupNickname()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteMockTests.java new file mode 100644 index 000000000000..35e3751ef932 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteMockTests.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.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.databases().delete("aloayqcgwrtzju", "gwyzm", "txon", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportMockTests.java new file mode 100644 index 000000000000..7571027a5ed3 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportMockTests.java @@ -0,0 +1,69 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesExportMockTests { + @Test + public void testExport() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .databases() + .export( + "us", + "ttouwaboekqvkel", + "smv", + new ExportClusterParameters().withSasUri("xwyjsflhhc"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushMockTests.java new file mode 100644 index 000000000000..3f68e7a662de --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesFlushMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.FlushParameters; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesFlushMockTests { + @Test + public void testFlush() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .databases() + .flush( + "tfolhbnx", + "nalaulppg", + "dtpnapnyiropuhp", + new FlushParameters().withIds(Arrays.asList("pgylg", "git", "medjvcslynqwwncw", "zhxgktrmgucn")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkMockTests.java new file mode 100644 index 000000000000..e588496574d9 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceUnlinkMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesForceUnlinkMockTests { + @Test + public void testForceUnlink() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .databases() + .forceUnlink( + "aln", + "ixisxyawjoy", + "qcslyjpkiid", + new ForceUnlinkParameters().withIds(Arrays.asList("exznelixhnr")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetWithResponseMockTests.java new file mode 100644 index 000000000000..e44c59e23dae --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetWithResponseMockTests.java @@ -0,0 +1,83 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"clientProtocol\":\"Plaintext\",\"port\":96984034,\"provisioningState\":\"Succeeded\",\"resourceState\":\"DeleteFailed\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"NoEviction\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":true,\"aofFrequency\":\"always\",\"rdbFrequency\":\"12h\"},\"modules\":[],\"geoReplication\":{\"groupNickname\":\"blcg\",\"linkedDatabases\":[]}},\"id\":\"vlvqhjkbegi\",\"name\":\"t\",\"type\":\"mxiebw\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Database response = + manager + .databases() + .getWithResponse("pow", "wpr", "qlveualupjmkh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(Protocol.PLAINTEXT, response.clientProtocol()); + Assertions.assertEquals(96984034, response.port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, response.clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.NO_EVICTION, response.evictionPolicy()); + Assertions.assertEquals(true, response.persistence().aofEnabled()); + Assertions.assertEquals(true, response.persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, response.persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONE_TWOH, response.persistence().rdbFrequency()); + Assertions.assertEquals("blcg", response.geoReplication().groupNickname()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodMockTests.java new file mode 100644 index 000000000000..e1dece8e9b95 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesImportMethodMockTests { + @Test + public void testImportMethod() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .databases() + .importMethod( + "awjvzunluthnnp", + "nxipeil", + "jzuaejxdultskzbb", + new ImportClusterParameters().withSasUris(Arrays.asList("zumveekgpwo", "uh", "fpbsjyofdxl")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterMockTests.java new file mode 100644 index 000000000000..e4ae57805bfc --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterMockTests.java @@ -0,0 +1,81 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class DatabasesListByClusterMockTests { + @Test + public void testListByCluster() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"clientProtocol\":\"Encrypted\",\"port\":838785311,\"provisioningState\":\"Creating\",\"resourceState\":\"Creating\",\"clusteringPolicy\":\"OSSCluster\",\"evictionPolicy\":\"AllKeysRandom\",\"persistence\":{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"always\",\"rdbFrequency\":\"6h\"},\"modules\":[],\"geoReplication\":{\"groupNickname\":\"cg\",\"linkedDatabases\":[]}},\"id\":\"ndnhj\",\"name\":\"auwhvylwzbtdhx\",\"type\":\"jznb\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.databases().listByCluster("hzceuojgjrwjue", "otwmcdyt", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(Protocol.ENCRYPTED, response.iterator().next().clientProtocol()); + Assertions.assertEquals(838785311, response.iterator().next().port()); + Assertions.assertEquals(ClusteringPolicy.OSSCLUSTER, response.iterator().next().clusteringPolicy()); + Assertions.assertEquals(EvictionPolicy.ALL_KEYS_RANDOM, response.iterator().next().evictionPolicy()); + Assertions.assertEquals(true, response.iterator().next().persistence().aofEnabled()); + Assertions.assertEquals(false, response.iterator().next().persistence().rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, response.iterator().next().persistence().aofFrequency()); + Assertions.assertEquals(RdbFrequency.SIXH, response.iterator().next().persistence().rdbFrequency()); + Assertions.assertEquals("cg", response.iterator().next().geoReplication().groupNickname()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ExportClusterParametersTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ExportClusterParametersTests.java new file mode 100644 index 000000000000..9590cb888fc5 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ExportClusterParametersTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; +import org.junit.jupiter.api.Assertions; + +public final class ExportClusterParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExportClusterParameters model = + BinaryData.fromString("{\"sasUri\":\"mdajv\"}").toObject(ExportClusterParameters.class); + Assertions.assertEquals("mdajv", model.sasUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ExportClusterParameters model = new ExportClusterParameters().withSasUri("mdajv"); + model = BinaryData.fromObject(model).toObject(ExportClusterParameters.class); + Assertions.assertEquals("mdajv", model.sasUri()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/FlushParametersTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/FlushParametersTests.java new file mode 100644 index 000000000000..5b48bf4dfa7a --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/FlushParametersTests.java @@ -0,0 +1,26 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.FlushParameters; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FlushParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlushParameters model = + BinaryData.fromString("{\"ids\":[\"yp\",\"rbpizc\",\"r\",\"j\"]}").toObject(FlushParameters.class); + Assertions.assertEquals("yp", model.ids().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlushParameters model = new FlushParameters().withIds(Arrays.asList("yp", "rbpizc", "r", "j")); + model = BinaryData.fromObject(model).toObject(FlushParameters.class); + Assertions.assertEquals("yp", model.ids().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceUnlinkParametersTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceUnlinkParametersTests.java new file mode 100644 index 000000000000..eabac60a4c47 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceUnlinkParametersTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ForceUnlinkParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ForceUnlinkParameters model = + BinaryData + .fromString("{\"ids\":[\"udwtiukbl\",\"ngkpocipazy\",\"o\",\"gukgjnpiucgygevq\"]}") + .toObject(ForceUnlinkParameters.class); + Assertions.assertEquals("udwtiukbl", model.ids().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ForceUnlinkParameters model = + new ForceUnlinkParameters().withIds(Arrays.asList("udwtiukbl", "ngkpocipazy", "o", "gukgjnpiucgygevq")); + model = BinaryData.fromObject(model).toObject(ForceUnlinkParameters.class); + Assertions.assertEquals("udwtiukbl", model.ids().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ImportClusterParametersTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ImportClusterParametersTests.java new file mode 100644 index 000000000000..288858100d8f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ImportClusterParametersTests.java @@ -0,0 +1,26 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ImportClusterParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImportClusterParameters model = + BinaryData.fromString("{\"sasUris\":[\"tpngjcrcczsqpjh\"]}").toObject(ImportClusterParameters.class); + Assertions.assertEquals("tpngjcrcczsqpjh", model.sasUris().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImportClusterParameters model = new ImportClusterParameters().withSasUris(Arrays.asList("tpngjcrcczsqpjh")); + model = BinaryData.fromObject(model).toObject(ImportClusterParameters.class); + Assertions.assertEquals("tpngjcrcczsqpjh", model.sasUris().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LinkedDatabaseTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LinkedDatabaseTests.java new file mode 100644 index 000000000000..5c53a83717ef --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LinkedDatabaseTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import org.junit.jupiter.api.Assertions; + +public final class LinkedDatabaseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LinkedDatabase model = + BinaryData.fromString("{\"id\":\"mohctb\",\"state\":\"Unlinking\"}").toObject(LinkedDatabase.class); + Assertions.assertEquals("mohctb", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LinkedDatabase model = new LinkedDatabase().withId("mohctb"); + model = BinaryData.fromObject(model).toObject(LinkedDatabase.class); + Assertions.assertEquals("mohctb", model.id()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LocationInfoTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LocationInfoTests.java new file mode 100644 index 000000000000..8d035589a9a9 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/LocationInfoTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.Capability; +import com.azure.resourcemanager.redisenterprise.models.LocationInfo; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class LocationInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LocationInfo model = + BinaryData + .fromString( + "{\"location\":\"iyqzrnk\",\"capabilities\":[{\"name\":\"xlwhzlsicoh\",\"value\":false},{\"name\":\"wvl\",\"value\":true},{\"name\":\"w\",\"value\":false},{\"name\":\"nmmqhgyxzkon\",\"value\":false}]}") + .toObject(LocationInfo.class); + Assertions.assertEquals("iyqzrnk", model.location()); + Assertions.assertEquals("xlwhzlsicoh", model.capabilities().get(0).name()); + Assertions.assertEquals(false, model.capabilities().get(0).value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LocationInfo model = + new LocationInfo() + .withLocation("iyqzrnk") + .withCapabilities( + Arrays + .asList( + new Capability().withName("xlwhzlsicoh").withValue(false), + new Capability().withName("wvl").withValue(true), + new Capability().withName("w").withValue(false), + new Capability().withName("nmmqhgyxzkon").withValue(false))); + model = BinaryData.fromObject(model).toObject(LocationInfo.class); + Assertions.assertEquals("iyqzrnk", model.location()); + Assertions.assertEquals("xlwhzlsicoh", model.capabilities().get(0).name()); + Assertions.assertEquals(false, model.capabilities().get(0).value()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ManagedServiceIdentityTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..adac2042033e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,48 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = + BinaryData + .fromString( + "{\"principalId\":\"838f920c-5523-44e0-8a86-937be793c446\",\"tenantId\":\"ffda8c00-51be-45bf-b8ac-8e0113802def\",\"type\":\"SystemAssigned," + + " UserAssigned\",\"userAssignedIdentities\":{\"xaolth\":{\"principalId\":\"3ad3458b-b23b-481e-aa4f-4230fffebd72\",\"clientId\":\"c723dd18-e9e1-48a1-9acf-410a3bd44809\"},\"gqjbpfzfsin\":{\"principalId\":\"9eb6c23c-222e-48fd-a3c5-0e3583d52498\",\"clientId\":\"b132f769-c9d3-44ca-9978-8930e2b2c944\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("xaolth", new UserAssignedIdentity(), "gqjbpfzfsin", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @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/test/java/com/azure/resourcemanager/redisenterprise/generated/ModuleTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ModuleTests.java new file mode 100644 index 000000000000..af73ca64f355 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ModuleTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.Module; +import org.junit.jupiter.api.Assertions; + +public final class ModuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Module model = + BinaryData.fromString("{\"name\":\"e\",\"args\":\"alhbx\",\"version\":\"e\"}").toObject(Module.class); + Assertions.assertEquals("e", model.name()); + Assertions.assertEquals("alhbx", model.args()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Module model = new Module().withName("e").withArgs("alhbx"); + model = BinaryData.fromObject(model).toObject(Module.class); + Assertions.assertEquals("e", model.name()); + Assertions.assertEquals("alhbx", model.args()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationDisplayTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..30619a60b740 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationDisplayTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = + BinaryData + .fromString( + "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + .toObject(OperationDisplay.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationDisplay model = new OperationDisplay(); + model = BinaryData.fromObject(model).toObject(OperationDisplay.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationInnerTests.java new file mode 100644 index 000000000000..4310fe891b13 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationInnerTests.java @@ -0,0 +1,26 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; +import com.azure.resourcemanager.redisenterprise.models.OperationDisplay; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = + BinaryData + .fromString( + "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); + model = BinaryData.fromObject(model).toObject(OperationInner.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationListResultTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationListResultTests.java new file mode 100644 index 000000000000..1b0b23c23456 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationListResultTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.OperationListResult; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + .toObject(OperationListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationListResult model = new OperationListResult(); + model = BinaryData.fromObject(model).toObject(OperationListResult.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationStatusInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationStatusInnerTests.java new file mode 100644 index 000000000000..3368f76057d5 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationStatusInnerTests.java @@ -0,0 +1,42 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; +import org.junit.jupiter.api.Assertions; + +public final class OperationStatusInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationStatusInner model = + BinaryData + .fromString( + "{\"id\":\"a\",\"name\":\"th\",\"startTime\":\"hab\",\"endTime\":\"pikxwczbyscnpqxu\",\"status\":\"vyq\"}") + .toObject(OperationStatusInner.class); + Assertions.assertEquals("a", model.id()); + Assertions.assertEquals("th", model.name()); + Assertions.assertEquals("hab", model.startTime()); + Assertions.assertEquals("pikxwczbyscnpqxu", model.endTime()); + Assertions.assertEquals("vyq", model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationStatusInner model = + new OperationStatusInner() + .withId("a") + .withName("th") + .withStartTime("hab") + .withEndTime("pikxwczbyscnpqxu") + .withStatus("vyq"); + model = BinaryData.fromObject(model).toObject(OperationStatusInner.class); + Assertions.assertEquals("a", model.id()); + Assertions.assertEquals("th", model.name()); + Assertions.assertEquals("hab", model.startTime()); + Assertions.assertEquals("pikxwczbyscnpqxu", model.endTime()); + Assertions.assertEquals("vyq", model.status()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..ba33e9507fea --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsListMockTests.java @@ -0,0 +1,64 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Operation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"name\":\"ypewrmjmwvvjekt\",\"isDataAction\":false,\"display\":{\"provider\":\"hwlrsf\",\"resource\":\"zpwv\",\"operation\":\"dqgbiqylihkaetc\",\"description\":\"vfcivfsnkymuc\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetWithResponseMockTests.java new file mode 100644 index 000000000000..06dcd7a9cb7c --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetWithResponseMockTests.java @@ -0,0 +1,74 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.OperationStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsStatusGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"id\":\"hfnljkyq\",\"name\":\"vuujq\",\"startTime\":\"dokgjl\",\"endTime\":\"oxgvclt\",\"status\":\"sncghkjeszz\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + OperationStatus response = + manager + .operationsStatus() + .getWithResponse("bebrjcxerfuwuttt", "fvjrbirphxepcy", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("hfnljkyq", response.id()); + Assertions.assertEquals("vuujq", response.name()); + Assertions.assertEquals("dokgjl", response.startTime()); + Assertions.assertEquals("oxgvclt", response.endTime()); + Assertions.assertEquals("sncghkjeszz", response.status()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PersistenceTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PersistenceTests.java new file mode 100644 index 000000000000..d55a1c70ed64 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PersistenceTests.java @@ -0,0 +1,41 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; +import org.junit.jupiter.api.Assertions; + +public final class PersistenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Persistence model = + BinaryData + .fromString( + "{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"always\",\"rdbFrequency\":\"12h\"}") + .toObject(Persistence.class); + Assertions.assertEquals(true, model.aofEnabled()); + Assertions.assertEquals(false, model.rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONE_TWOH, model.rdbFrequency()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Persistence model = + new Persistence() + .withAofEnabled(true) + .withRdbEnabled(false) + .withAofFrequency(AofFrequency.ALWAYS) + .withRdbFrequency(RdbFrequency.ONE_TWOH); + model = BinaryData.fromObject(model).toObject(Persistence.class); + Assertions.assertEquals(true, model.aofEnabled()); + Assertions.assertEquals(false, model.rdbEnabled()); + Assertions.assertEquals(AofFrequency.ALWAYS, model.aofFrequency()); + Assertions.assertEquals(RdbFrequency.ONE_TWOH, model.rdbFrequency()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..6cd32544b5f1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionInnerTests.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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = + BinaryData + .fromString( + "{\"properties\":{\"privateEndpoint\":{\"id\":\"podepoo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"vamih\",\"actionsRequired\":\"gnarxzxtheo\"},\"provisioningState\":\"Succeeded\"},\"id\":\"vyevcciqi\",\"name\":\"nhungbw\",\"type\":\"zrnf\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("vamih", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("gnarxzxtheo", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model = + new PrivateEndpointConnectionInner() + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("vamih") + .withActionsRequired("gnarxzxtheo")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("vamih", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("gnarxzxtheo", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionListResultTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionListResultTests.java new file mode 100644 index 000000000000..4ab89f86798f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionListResultTests.java @@ -0,0 +1,35 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionListResult; +import java.util.Arrays; + +public final class PrivateEndpointConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"canoaeupf\",\"name\":\"yhltrpmopjmcm\",\"type\":\"tuo\"},{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"uaodsfcpk\",\"name\":\"xodpuozmyzydagfu\",\"type\":\"xbezyiuokktwh\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"wqsmbsur\",\"name\":\"xim\",\"type\":\"ryocfsfksymdd\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"uxh\",\"name\":\"yudxorrqnbp\",\"type\":\"czvyifq\"}]}") + .toObject(PrivateEndpointConnectionListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionListResult model = + new PrivateEndpointConnectionListResult() + .withValue( + Arrays + .asList( + new PrivateEndpointConnectionInner(), + new PrivateEndpointConnectionInner(), + new PrivateEndpointConnectionInner(), + new PrivateEndpointConnectionInner())); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..df218cb4d445 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionPropertiesTests.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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = + BinaryData + .fromString( + "{\"privateEndpoint\":{\"id\":\"gispemvtzfkufubl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"qeof\",\"actionsRequired\":\"e\"},\"provisioningState\":\"Deleting\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qeof", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("e", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model = + new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("qeof") + .withActionsRequired("e")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("qeof", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("e", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..569799298932 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java @@ -0,0 +1,63 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .privateEndpointConnections() + .deleteWithResponse("lfmmdnbbglzpswi", "d", "cwyhzdxssa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..4558d341901d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,75 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"privateEndpoint\":{\"id\":\"thnzd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"gnayqigynduh\",\"actionsRequired\":\"hqlkthumaqo\"},\"provisioningState\":\"Creating\"},\"id\":\"cdui\",\"name\":\"r\",\"type\":\"gccymvaolpssl\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnection response = + manager + .privateEndpointConnections() + .getWithResponse("tjrybnwjewgdr", "ervnaenqpehi", "doy", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("gnayqigynduh", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("hqlkthumaqo", response.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListMockTests.java new file mode 100644 index 000000000000..9aff5ed5cd0a --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListMockTests.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.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"sub\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"irx\",\"actionsRequired\":\"ybsrfbjfdtwss\"},\"provisioningState\":\"Deleting\"},\"id\":\"pvjzbe\",\"name\":\"ilzznfqqnvwp\",\"type\":\"qtaruoujmkcjhwq\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.privateEndpointConnections().list("shqjohxcrsbf", "vasrruvwb", com.azure.core.util.Context.NONE); + + Assertions + .assertEquals( + PrivateEndpointServiceConnectionStatus.PENDING, + response.iterator().next().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("irx", response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions + .assertEquals( + "ybsrfbjfdtwss", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..e3c58a78aa85 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointTests.java @@ -0,0 +1,21 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"jbasvmsmjqulngs\"}").toObject(PrivateEndpoint.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint(); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..d785a22925e7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = + BinaryData + .fromString( + "{\"properties\":{\"groupId\":\"uo\",\"requiredMembers\":[\"kg\",\"sauuimj\",\"vxieduugidyj\"],\"requiredZoneNames\":[\"byao\"]},\"id\":\"e\",\"name\":\"csonpclhoco\",\"type\":\"slkevle\"}") + .toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("byao", model.requiredZoneNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkResourceInner model = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("byao")); + model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("byao", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceListResultTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceListResultTests.java new file mode 100644 index 000000000000..1fb137970057 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourceListResultTests.java @@ -0,0 +1,33 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResourceListResult; +import java.util.Arrays; + +public final class PrivateLinkResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"jsllrmv\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"atkpnp\",\"name\":\"lexxbczwtru\",\"type\":\"iqzbq\"},{\"properties\":{\"groupId\":\"ovm\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"cspkwlhzdobpxjmf\",\"name\":\"bvvnchrkcciw\",\"type\":\"zjuqkhrsaj\"}]}") + .toObject(PrivateLinkResourceListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkResourceListResult model = + new PrivateLinkResourceListResult() + .withValue( + Arrays + .asList( + new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()), + new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()))); + model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcePropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..9d8eaf83c242 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,31 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = + BinaryData + .fromString( + "{\"groupId\":\"zfbuhf\",\"requiredMembers\":[\"axkffei\",\"th\",\"vmezy\"],\"requiredZoneNames\":[\"xmzsbbzogg\",\"grxwbu\",\"vjxxjnsp\",\"dptkoenkouk\"]}") + .toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("xmzsbbzogg", model.requiredZoneNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkResourceProperties model = + new PrivateLinkResourceProperties() + .withRequiredZoneNames(Arrays.asList("xmzsbbzogg", "grxwbu", "vjxxjnsp", "dptkoenkouk")); + model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("xmzsbbzogg", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterMockTests.java new file mode 100644 index 000000000000..bd162feb4a6d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterMockTests.java @@ -0,0 +1,68 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResource; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesListByClusterMockTests { + @Test + public void testListByCluster() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"groupId\":\"bncblylpstdbhhx\",\"requiredMembers\":[\"dzu\",\"erscdntne\",\"fiwjmygtdssls\",\"tmweriofzpyq\"],\"requiredZoneNames\":[\"wab\",\"ets\",\"hszhedplvwiwu\",\"mwmbes\"]},\"id\":\"nkww\",\"name\":\"pp\",\"type\":\"flcxoga\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.privateLinkResources().listByCluster("bzmnvdfznud", "od", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wab", response.iterator().next().requiredZoneNames().get(0)); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..87ed5d97b7b1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkServiceConnectionStateTests.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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model = + BinaryData + .fromString( + "{\"status\":\"Pending\",\"description\":\"ybkzgcwr\",\"actionsRequired\":\"lxxwrljdouskc\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("ybkzgcwr", model.description()); + Assertions.assertEquals("lxxwrljdouskc", model.actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model = + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("ybkzgcwr") + .withActionsRequired("lxxwrljdouskc"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("ybkzgcwr", model.description()); + Assertions.assertEquals("lxxwrljdouskc", model.actionsRequired()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesCreateMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesCreateMockTests.java new file mode 100644 index 000000000000..a254a94eb4c0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesCreateMockTests.java @@ -0,0 +1,107 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class RedisEnterprisesCreateMockTests { + @Test + public void testCreate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"EnterpriseFlash_F1500\",\"capacity\":946722582},\"zones\":[\"ehhseyvjusrts\",\"hspkdeemao\",\"mx\",\"gkvtmelmqkrhah\"],\"identity\":{\"principalId\":\"b53db8cd-73cc-4a07-9f77-6f6a08af5380\",\"tenantId\":\"e419fddd-8c53-446b-9e1f-d3fba9a9f15d\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.2\",\"encryption\":{},\"hostName\":\"mdua\",\"provisioningState\":\"Succeeded\",\"resourceState\":\"Updating\",\"redisVersion\":\"vfadmws\",\"privateEndpointConnections\":[]},\"location\":\"vxpvgomz\",\"tags\":{\"ali\":\"isgwbnbbeldawkz\",\"hashsfwxosow\":\"urqhaka\"},\"id\":\"xcug\",\"name\":\"cjooxdjebwpucwwf\",\"type\":\"ovbvmeueciv\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Cluster response = + manager + .redisEnterprises() + .define("kphywpnvjto") + .withRegion("kqujidsuyono") + .withExistingResourceGroup("nxdhbt") + .withSku(new Sku().withName(SkuName.ENTERPRISE_E20).withCapacity(963875156)) + .withTags(mapOf("dxyt", "aocqxtccmgy", "txhdzh", "moyrxvwfudwpz", "rxsbkyvp", "rqjbhckfrl")) + .withZones(Arrays.asList("lfplp")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf())) + .withMinimumTlsVersion(TlsVersion.ONE_ONE) + .withEncryption(new ClusterPropertiesEncryption()) + .create(); + + Assertions.assertEquals("vxpvgomz", response.location()); + Assertions.assertEquals("isgwbnbbeldawkz", response.tags().get("ali")); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F1500, response.sku().name()); + Assertions.assertEquals(946722582, response.sku().capacity()); + Assertions.assertEquals("ehhseyvjusrts", response.zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertEquals(TlsVersion.ONE_TWO, response.minimumTlsVersion()); + } + + @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/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesDeleteMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesDeleteMockTests.java new file mode 100644 index 000000000000..6778b7b1679b --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesDeleteMockTests.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.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class RedisEnterprisesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.redisEnterprises().delete("ijhtxf", "gx", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesGetByResourceGroupWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..1446610dc48a --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesGetByResourceGroupWithResponseMockTests.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.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class RedisEnterprisesGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"Enterprise_E10\",\"capacity\":68854326},\"zones\":[\"qkkrb\",\"pukgriwflzlfb\"],\"identity\":{\"principalId\":\"683484b8-3815-4216-b15f-8cc6b7d760ea\",\"tenantId\":\"71074008-1763-479c-99f8-60b7331876a2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.2\",\"encryption\":{},\"hostName\":\"ahmgkbrp\",\"provisioningState\":\"Canceled\",\"resourceState\":\"Enabling\",\"redisVersion\":\"nuqqkpikadrgvt\",\"privateEndpointConnections\":[]},\"location\":\"buynhijggm\",\"tags\":{\"zzmhjrunmpxttd\":\"siarbutrcvpn\",\"nbtkcxywnytnr\":\"hrbnlankxmyskpbh\",\"qidybyx\":\"yn\"},\"id\":\"zfcl\",\"name\":\"aaxdbabphlwrq\",\"type\":\"fkts\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Cluster response = + manager + .redisEnterprises() + .getByResourceGroupWithResponse("fsm", "nehmpvecx", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("buynhijggm", response.location()); + Assertions.assertEquals("siarbutrcvpn", response.tags().get("zzmhjrunmpxttd")); + Assertions.assertEquals(SkuName.ENTERPRISE_E10, response.sku().name()); + Assertions.assertEquals(68854326, response.sku().capacity()); + Assertions.assertEquals("qkkrb", response.zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertEquals(TlsVersion.ONE_TWO, response.minimumTlsVersion()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListByResourceGroupMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListByResourceGroupMockTests.java new file mode 100644 index 000000000000..08915aa929a1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListByResourceGroupMockTests.java @@ -0,0 +1,78 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class RedisEnterprisesListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"EnterpriseFlash_F700\",\"capacity\":1572561560},\"zones\":[\"t\"],\"identity\":{\"principalId\":\"4675628b-6fa6-4f01-abc5-2c378c489f70\",\"tenantId\":\"819032f2-13cf-4bea-8411-02464c307339\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.1\",\"encryption\":{},\"hostName\":\"zywbiex\",\"provisioningState\":\"Failed\",\"resourceState\":\"UpdateFailed\",\"redisVersion\":\"axibxujw\",\"privateEndpointConnections\":[]},\"location\":\"almuzyoxaepdkzja\",\"tags\":{\"zt\":\"xrhdwbavxbniwdjs\"},\"id\":\"dbpgnxytxhp\",\"name\":\"xbzpfzab\",\"type\":\"lcuhxwtctyqiklb\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.redisEnterprises().listByResourceGroup("hsucoc", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("almuzyoxaepdkzja", response.iterator().next().location()); + Assertions.assertEquals("xrhdwbavxbniwdjs", response.iterator().next().tags().get("zt")); + Assertions.assertEquals(SkuName.ENTERPRISE_FLASH_F700, response.iterator().next().sku().name()); + Assertions.assertEquals(1572561560, response.iterator().next().sku().capacity()); + Assertions.assertEquals("t", response.iterator().next().zones().get(0)); + Assertions + .assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(TlsVersion.ONE_ONE, response.iterator().next().minimumTlsVersion()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListMockTests.java new file mode 100644 index 000000000000..e4f92d84e2bb --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListMockTests.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.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class RedisEnterprisesListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"Enterprise_E100\",\"capacity\":946920071},\"zones\":[\"zbhvgyuguosv\",\"kfssxqukkf\",\"l\"],\"identity\":{\"principalId\":\"5b904191-a7d7-4904-b66d-a194fc806976\",\"tenantId\":\"5cb9b608-c4e4-49ed-9e44-cc02cabaa830\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"minimumTlsVersion\":\"1.2\",\"encryption\":{},\"hostName\":\"lpvlopw\",\"provisioningState\":\"Canceled\",\"resourceState\":\"CreateFailed\",\"redisVersion\":\"pkdwzbai\",\"privateEndpointConnections\":[]},\"location\":\"a\",\"tags\":{\"mtxpsiebtfh\":\"yqupedeojnabckh\",\"htldwk\":\"pesapskrdqmhjj\",\"otogtwrupqs\":\"zxuutkncwscwsvl\",\"cykvceo\":\"vnm\"},\"id\":\"eil\",\"name\":\"vnotyfjfcnj\",\"type\":\"k\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.redisEnterprises().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("a", response.iterator().next().location()); + Assertions.assertEquals("yqupedeojnabckh", response.iterator().next().tags().get("mtxpsiebtfh")); + Assertions.assertEquals(SkuName.ENTERPRISE_E100, response.iterator().next().sku().name()); + Assertions.assertEquals(946920071, response.iterator().next().sku().capacity()); + Assertions.assertEquals("zbhvgyuguosv", response.iterator().next().zones().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(TlsVersion.ONE_TWO, response.iterator().next().minimumTlsVersion()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailInnerTests.java new file mode 100644 index 000000000000..c63592f75938 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailInnerTests.java @@ -0,0 +1,52 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.azure.resourcemanager.redisenterprise.models.Capability; +import com.azure.resourcemanager.redisenterprise.models.LocationInfo; +import com.azure.resourcemanager.redisenterprise.models.Name; +import com.azure.resourcemanager.redisenterprise.models.SkuDetail; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RegionSkuDetailInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RegionSkuDetailInner model = + BinaryData + .fromString( + "{\"resourceType\":\"jdeyeamdpha\",\"locationInfo\":{\"location\":\"pbuxwgipwhon\",\"capabilities\":[{\"name\":\"shwankixzbinje\",\"value\":true},{\"name\":\"mryw\",\"value\":true}]},\"skuDetails\":{\"name\":\"Enterprise_E10\"}}") + .toObject(RegionSkuDetailInner.class); + Assertions.assertEquals("jdeyeamdpha", model.resourceType()); + Assertions.assertEquals("pbuxwgipwhon", model.locationInfo().location()); + Assertions.assertEquals("shwankixzbinje", model.locationInfo().capabilities().get(0).name()); + Assertions.assertEquals(true, model.locationInfo().capabilities().get(0).value()); + Assertions.assertEquals(Name.ENTERPRISE_E10, model.skuDetails().name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RegionSkuDetailInner model = + new RegionSkuDetailInner() + .withResourceType("jdeyeamdpha") + .withLocationInfo( + new LocationInfo() + .withLocation("pbuxwgipwhon") + .withCapabilities( + Arrays + .asList( + new Capability().withName("shwankixzbinje").withValue(true), + new Capability().withName("mryw").withValue(true)))) + .withSkuDetails(new SkuDetail().withName(Name.ENTERPRISE_E10)); + model = BinaryData.fromObject(model).toObject(RegionSkuDetailInner.class); + Assertions.assertEquals("jdeyeamdpha", model.resourceType()); + Assertions.assertEquals("pbuxwgipwhon", model.locationInfo().location()); + Assertions.assertEquals("shwankixzbinje", model.locationInfo().capabilities().get(0).name()); + Assertions.assertEquals(true, model.locationInfo().capabilities().get(0).value()); + Assertions.assertEquals(Name.ENTERPRISE_E10, model.skuDetails().name()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailsTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailsTests.java new file mode 100644 index 000000000000..beacb35fd42c --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RegionSkuDetailsTests.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.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.RegionSkuDetailInner; +import com.azure.resourcemanager.redisenterprise.models.LocationInfo; +import com.azure.resourcemanager.redisenterprise.models.Name; +import com.azure.resourcemanager.redisenterprise.models.RegionSkuDetails; +import com.azure.resourcemanager.redisenterprise.models.SkuDetail; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RegionSkuDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RegionSkuDetails model = + BinaryData + .fromString( + "{\"value\":[{\"resourceType\":\"dnfyhxdeoejzicwi\",\"locationInfo\":{\"location\":\"ttgzfbis\",\"capabilities\":[]},\"skuDetails\":{\"name\":\"Enterprise_E20\"}}]}") + .toObject(RegionSkuDetails.class); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.value().get(0).resourceType()); + Assertions.assertEquals("ttgzfbis", model.value().get(0).locationInfo().location()); + Assertions.assertEquals(Name.ENTERPRISE_E20, model.value().get(0).skuDetails().name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RegionSkuDetails model = + new RegionSkuDetails() + .withValue( + Arrays + .asList( + new RegionSkuDetailInner() + .withResourceType("dnfyhxdeoejzicwi") + .withLocationInfo( + new LocationInfo().withLocation("ttgzfbis").withCapabilities(Arrays.asList())) + .withSkuDetails(new SkuDetail().withName(Name.ENTERPRISE_E20)))); + model = BinaryData.fromObject(model).toObject(RegionSkuDetails.class); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.value().get(0).resourceType()); + Assertions.assertEquals("ttgzfbis", model.value().get(0).locationInfo().location()); + Assertions.assertEquals(Name.ENTERPRISE_E20, model.value().get(0).skuDetails().name()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailTests.java new file mode 100644 index 000000000000..425c12f15778 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.Name; +import com.azure.resourcemanager.redisenterprise.models.SkuDetail; +import org.junit.jupiter.api.Assertions; + +public final class SkuDetailTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuDetail model = BinaryData.fromString("{\"name\":\"Enterprise_E100\"}").toObject(SkuDetail.class); + Assertions.assertEquals(Name.ENTERPRISE_E100, model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SkuDetail model = new SkuDetail().withName(Name.ENTERPRISE_E100); + model = BinaryData.fromObject(model).toObject(SkuDetail.class); + Assertions.assertEquals(Name.ENTERPRISE_E100, model.name()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuTests.java new file mode 100644 index 000000000000..445d576836c0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import org.junit.jupiter.api.Assertions; + +public final class SkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Sku model = BinaryData.fromString("{\"name\":\"Enterprise_E20\",\"capacity\":1041872032}").toObject(Sku.class); + Assertions.assertEquals(SkuName.ENTERPRISE_E20, model.name()); + Assertions.assertEquals(1041872032, model.capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Sku model = new Sku().withName(SkuName.ENTERPRISE_E20).withCapacity(1041872032); + model = BinaryData.fromObject(model).toObject(Sku.class); + Assertions.assertEquals(SkuName.ENTERPRISE_E20, model.name()); + Assertions.assertEquals(1041872032, model.capacity()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkusListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkusListMockTests.java new file mode 100644 index 000000000000..b4e4d03748aa --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkusListMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Name; +import com.azure.resourcemanager.redisenterprise.models.RegionSkuDetail; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class SkusListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"resourceType\":\"kqze\",\"locationInfo\":{\"location\":\"dltfz\",\"capabilities\":[]},\"skuDetails\":{\"name\":\"EnterpriseFlash_F1500\"}}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + RedisEnterpriseManager manager = + RedisEnterpriseManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.skus().list("konzmnsik", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kqze", response.iterator().next().resourceType()); + Assertions.assertEquals("dltfz", response.iterator().next().locationInfo().location()); + Assertions.assertEquals(Name.ENTERPRISE_FLASH_F1500, response.iterator().next().skuDetails().name()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/UserAssignedIdentityTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..8eb4542b2c20 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/UserAssignedIdentityTests.java @@ -0,0 +1,25 @@ +// 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.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = + BinaryData + .fromString( + "{\"principalId\":\"fb154a55-9c4d-45b3-8277-601485e63df9\",\"clientId\":\"af13bd8f-ba5c-4812-8bdc-c31b70670cd8\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 000000000000..1f0955d450f0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline