diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md index 97204f152b7a..850a4a12814e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md @@ -1,14 +1,234 @@ # Release History -## 2.2.0-beta.1 (Unreleased) +## 2.2.0-beta.1 (2026-06-12) -### Features Added +- Azure Resource Manager Redis Enterprise client library for Java. This package contains Microsoft Azure SDK for Redis Enterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package api-version 2026-02-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.PrivateLinkResourceListResult` was removed + +#### `models.PrivateEndpointConnectionListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.AccessPolicyAssignmentList` was removed + +#### `models.ClusterList` was removed + +#### `models.DatabaseList` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `validate()` was removed +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` +* `java.util.UUID principalId()` -> `java.lang.String principalId()` + +#### `models.ClusterUpdate` was modified + +* `validate()` was removed + +#### `models.ForceLinkParametersGeoReplication` was modified + +* `validate()` was removed + +#### `models.ForceUnlinkParameters` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `java.util.UUID principalId()` -> `java.lang.String principalId()` +* `java.util.UUID clientId()` -> `java.lang.String clientId()` +* `validate()` was removed + +#### `models.DatabaseUpdate` was modified + +* `validate()` was removed + +#### `models.Module` was modified + +* `validate()` was removed + +#### `models.PrivateEndpoint` was modified + +* `validate()` was removed + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.ClusterPropertiesEncryption` was modified + +* `validate()` was removed + +#### `models.AccessPolicyAssignmentPropertiesUser` was modified + +* `validate()` was removed + +#### `models.DatabasePropertiesGeoReplication` was modified + +* `validate()` was removed + +#### `models.RegenerateKeyParameters` was modified + +* `validate()` was removed + +#### `models.LinkedDatabase` was modified + +* `validate()` was removed + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `validate()` was removed + +#### `models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity` was modified + +* `validate()` was removed + +#### `models.ImportClusterParameters` was modified + +* `validate()` was removed + +#### `models.ClusterCommonProperties` was modified + +* `validate()` was removed + +#### `models.ForceLinkParameters` was modified + +* `validate()` was removed + +#### `models.FlushParameters` was modified + +* `validate()` was removed + +#### `models.DatabaseCommonProperties` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.ExportClusterParameters` was modified + +* `validate()` was removed + +#### `models.Persistence` was modified + +* `validate()` was removed + +#### `models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption` was modified + +* `validate()` was removed + +#### `models.SkuDetails` was modified + +* `SkuDetails()` was changed to private access +* `validate()` was removed + +### Features Added + +* `models.MaintenanceWindowSchedule` was added + +* `models.MigrationValidationRequest` was added + +* `models.SourceType` was added + +* `models.MaintenanceWindowType` was added + +* `models.MaintenanceDayOfWeek` was added + +* `models.MigrationProvisioningState` was added + +* `models.MigrationValidationError` was added + +* `models.MaintenanceConfiguration` was added + +* `models.MaintenanceWindow` was added + +* `models.AzureCacheForRedisMigrationProperties` was added + +* `models.MigrationProperties` was added + +* `models.MigrationOperations` was added + +* `models.Migration` was added + +* `models.MigrationValidationResponse` was added + +* `models.Migrations` was added + +* `models.MigrationValidationDisparity` was added + +* `models.MigrationValidationWarning` was added + +#### `models.ClusterUpdate` was modified + +* `migratedEndpoint()` was added +* `withMaintenanceConfiguration(models.MaintenanceConfiguration)` was added +* `maintenanceConfiguration()` was added + +#### `models.PrivateLinkResource` was modified + +* `systemData()` was added + +#### `models.DatabaseUpdate` was modified + +* `notifyKeyspaceEvents()` was added +* `withNotifyKeyspaceEvents(java.lang.String)` was added + +#### `models.Cluster$Update` was modified + +* `withMaintenanceConfiguration(models.MaintenanceConfiguration)` was added + +#### `RedisEnterpriseManager` was modified + +* `migrations()` was added +* `migrationOperations()` was added -### Other Changes +#### `models.Database$Definition` was modified + +* `withNotifyKeyspaceEvents(java.lang.String)` was added + +#### `models.Cluster$Definition` was modified + +* `withMaintenanceConfiguration(models.MaintenanceConfiguration)` was added + +#### `models.ClusterCommonProperties` was modified + +* `migratedEndpoint()` was added +* `withMaintenanceConfiguration(models.MaintenanceConfiguration)` was added +* `maintenanceConfiguration()` was added + +#### `models.Database$Update` was modified + +* `withNotifyKeyspaceEvents(java.lang.String)` was added + +#### `models.AccessPolicyAssignment` was modified + +* `systemData()` was added + +#### `models.Database` was modified + +* `notifyKeyspaceEvents()` was added + +#### `models.DatabaseCommonProperties` was modified + +* `notifyKeyspaceEvents()` was added +* `withNotifyKeyspaceEvents(java.lang.String)` was added + +#### `models.PrivateEndpointConnection` was modified + +* `systemData()` was added +* `groupIds()` was added + +#### `models.Cluster` was modified + +* `systemData()` was added +* `migratedEndpoint()` was added +* `maintenanceConfiguration()` was added ## 2.1.0 (2025-10-15) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md index 1e053c4631b4..f0c55b33fd1a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager RedisEnterprise client library for Java +# Azure Resource Manager Redis Enterprise client library for Java -Azure Resource Manager RedisEnterprise client library for Java. +Azure Resource Manager Redis Enterprise 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-2025-07-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 Redis Enterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package api-version 2026-02-01-preview. 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 - 2.1.0 + 2.2.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md index a8d0a9293569..fd468cdb86e0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md @@ -24,6 +24,17 @@ - [Update](#databases_update) - [UpgradeDBRedisVersion](#databases_upgradedbredisversion) +## MigrationOperation + +- [Cancel](#migrationoperation_cancel) +- [Get](#migrationoperation_get) +- [List](#migrationoperation_list) +- [Start](#migrationoperation_start) + +## Migrations + +- [Validate](#migrations_validate) + ## Operations - [List](#operations_list) @@ -62,9 +73,7 @@ import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentPr */ public final class AccessPolicyAssignmentCreateUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentCreateUpdate. @@ -91,9 +100,7 @@ public final class AccessPolicyAssignmentCreateUpdateSamples { */ public final class AccessPolicyAssignmentDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentDelete.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentDelete. @@ -116,9 +123,7 @@ public final class AccessPolicyAssignmentDeleteSamples { */ public final class AccessPolicyAssignmentGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentGet.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentGet. @@ -142,9 +147,7 @@ public final class AccessPolicyAssignmentGetSamples { */ public final class AccessPolicyAssignmentListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentsList.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentsList.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentList. @@ -178,9 +181,7 @@ import java.util.Arrays; */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesNoClusterCacheCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesNoClusterCacheCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate No Cluster Cache. @@ -196,13 +197,12 @@ public final class DatabasesCreateSamples { .withPort(10000) .withClusteringPolicy(ClusteringPolicy.NO_CLUSTER) .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withNotifyKeyspaceEvents("") .create(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate. @@ -214,6 +214,7 @@ public final class DatabasesCreateSamples { manager.databases() .define("default") .withExistingRedisEnterprise("rg1", "cache1") + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withPort(10000) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) @@ -223,14 +224,12 @@ public final class DatabasesCreateSamples { new Module().withName("RedisTimeSeries").withArgs("RETENTION_POLICY 20"), new Module().withName("RediSearch"))) .withDeferUpgrade(DeferUpgradeSetting.NOT_DEFERRED) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .create(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesCreateWithGeoReplication.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesCreateWithGeoReplication.json */ /** * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. @@ -242,6 +241,7 @@ public final class DatabasesCreateSamples { manager.databases() .define("default") .withExistingRedisEnterprise("rg1", "cache1") + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withPort(10000) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) @@ -251,7 +251,7 @@ public final class DatabasesCreateSamples { "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), new LinkedDatabase().withId( "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")))) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .create(); } } @@ -265,9 +265,7 @@ public final class DatabasesCreateSamples { */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesDelete.json */ /** * Sample code: RedisEnterpriseDatabasesDelete. @@ -291,9 +289,7 @@ import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; */ public final class DatabasesExportSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesExport.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesExport.json */ /** * Sample code: RedisEnterpriseDatabasesExport. @@ -322,9 +318,7 @@ import java.util.Arrays; */ public final class DatabasesFlushSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesFlush.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesFlush.json */ /** * Sample code: How to flush all the keys in the database. @@ -354,9 +348,7 @@ import java.util.Arrays; */ public final class DatabasesForceLinkToReplicationGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesForceLink.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesForceLink.json */ /** * Sample code: How to relink a database after a regional outage. @@ -389,9 +381,7 @@ import java.util.Arrays; */ public final class DatabasesForceUnlinkSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesForceUnlink.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesForceUnlink.json */ /** * Sample code: How to unlink a database during a regional outage. @@ -416,9 +406,7 @@ public final class DatabasesForceUnlinkSamples { */ public final class DatabasesGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesGet.json */ /** * Sample code: RedisEnterpriseDatabasesGet. @@ -443,9 +431,7 @@ import java.util.Arrays; */ public final class DatabasesImportMethodSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesImport.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesImport.json */ /** * Sample code: RedisEnterpriseDatabasesImport. @@ -472,9 +458,7 @@ public final class DatabasesImportMethodSamples { */ public final class DatabasesListByClusterSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesListByCluster.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesListByCluster.json */ /** * Sample code: RedisEnterpriseDatabasesListByCluster. @@ -496,9 +480,7 @@ public final class DatabasesListByClusterSamples { */ public final class DatabasesListKeysSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesListKeys.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesListKeys.json */ /** * Sample code: RedisEnterpriseDatabasesListKeys. @@ -523,9 +505,7 @@ import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; */ public final class DatabasesRegenerateKeySamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesRegenerateKey.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesRegenerateKey.json */ /** * Sample code: RedisEnterpriseDatabasesRegenerateKey. @@ -557,9 +537,7 @@ import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; */ public final class DatabasesUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate Clustering on No Cluster Cache. @@ -575,13 +553,12 @@ public final class DatabasesUpdateSamples { .withClientProtocol(Protocol.ENCRYPTED) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withNotifyKeyspaceEvents("") .apply(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesUpdate.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate. @@ -594,10 +571,11 @@ public final class DatabasesUpdateSamples { .getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE) .getValue(); resource.update() + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .apply(); } } @@ -611,9 +589,7 @@ public final class DatabasesUpdateSamples { */ public final class DatabasesUpgradeDBRedisVersionSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesUpgradeDBRedisVersion.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json */ /** * Sample code: How to upgrade your database Redis version. @@ -627,6 +603,131 @@ public final class DatabasesUpgradeDBRedisVersionSamples { } ``` +### MigrationOperation_Cancel + +```java +/** + * Samples for MigrationOperation Cancel. + */ +public final class MigrationOperationCancelSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationCancel.json + */ + /** + * Sample code: RedisEnterpriseMigrationCancel. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationCancel(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().cancel("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationOperation_Get + +```java +/** + * Samples for MigrationOperation Get. + */ +public final class MigrationOperationGetSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationGet.json + */ + /** + * Sample code: RedisEnterpriseMigrationGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().getWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationOperation_List + +```java +/** + * Samples for MigrationOperation List. + */ +public final class MigrationOperationListSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationList.json + */ + /** + * Sample code: RedisEnterpriseMigrationList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationOperation_Start + +```java +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.AzureCacheForRedisMigrationProperties; + +/** + * Samples for MigrationOperation Start. + */ +public final class MigrationOperationStartSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationStart.json + */ + /** + * Sample code: RedisEnterpriseMigrationStart. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationStart(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations() + .start("rg1", "cache1", + new MigrationInner().withProperties(new AzureCacheForRedisMigrationProperties().withSourceResourceId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1") + .withSwitchDns(true) + .withSkipDataMigration(true)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Migrations_Validate + +```java +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; + +/** + * Samples for Migrations Validate. + */ +public final class MigrationsValidateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationValidate.json + */ + /** + * Sample code: RedisEnterpriseMigrationValidate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationValidate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrations() + .validateWithResponse("rg1", "cache1", new MigrationValidationRequest().withSourceResourceId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1") + .withSkipDataMigration(true) + .withForceMigrate(false), com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -635,9 +736,7 @@ public final class DatabasesUpgradeDBRedisVersionSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * OperationsList.json + * x-ms-original-file: 2026-02-01-preview/OperationsList.json */ /** * Sample code: OperationsList. @@ -658,9 +757,7 @@ public final class OperationsListSamples { */ public final class OperationsStatusGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * OperationsStatusGet.json + * x-ms-original-file: 2026-02-01-preview/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. @@ -681,9 +778,7 @@ public final class OperationsStatusGetSamples { */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDeletePrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDeletePrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. @@ -705,9 +800,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseGetPrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseGetPrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseGetPrivateEndpointConnection. @@ -730,9 +823,7 @@ public final class PrivateEndpointConnectionsGetSamples { */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListPrivateEndpointConnections.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListPrivateEndpointConnections.json */ /** * Sample code: RedisEnterpriseListPrivateEndpointConnections. @@ -757,9 +848,7 @@ import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnec */ public final class PrivateEndpointConnectionsPutSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterprisePutPrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterprisePutPrivateEndpointConnection.json */ /** * Sample code: RedisEnterprisePutPrivateEndpointConnection. @@ -787,9 +876,7 @@ public final class PrivateEndpointConnectionsPutSamples { */ public final class PrivateLinkResourcesListByClusterSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListPrivateLinkResources.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListPrivateLinkResources.json */ /** * Sample code: RedisEnterpriseListPrivateLinkResources. @@ -810,6 +897,11 @@ import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncrypt 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.MaintenanceConfiguration; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; @@ -826,9 +918,7 @@ import java.util.Map; */ public final class RedisEnterpriseCreateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseCreate.json */ /** * Sample code: RedisEnterpriseCreate. @@ -856,6 +946,19 @@ public final class RedisEnterpriseCreateSamples { "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity") .withIdentityType(CmkIdentityType.USER_ASSIGNED_IDENTITY)) .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) + .withMaintenanceConfiguration(new MaintenanceConfiguration().withMaintenanceWindows(Arrays.asList( + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.MONDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.TUESDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.WEDNESDAY))))) .create(); } @@ -881,9 +984,7 @@ public final class RedisEnterpriseCreateSamples { */ public final class RedisEnterpriseDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDelete.json */ /** * Sample code: RedisEnterpriseDelete. @@ -904,9 +1005,7 @@ public final class RedisEnterpriseDeleteSamples { */ public final class RedisEnterpriseGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseGet.json */ /** * Sample code: RedisEnterpriseGet. @@ -927,9 +1026,7 @@ public final class RedisEnterpriseGetByResourceGroupSamples { */ public final class RedisEnterpriseListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseList.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseList.json */ /** * Sample code: RedisEnterpriseList. @@ -950,9 +1047,7 @@ public final class RedisEnterpriseListSamples { */ public final class RedisEnterpriseListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListByResourceGroup.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListByResourceGroup.json */ /** * Sample code: RedisEnterpriseListByResourceGroup. @@ -974,9 +1069,7 @@ public final class RedisEnterpriseListByResourceGroupSamples { */ public final class RedisEnterpriseListSkusForScalingSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListSkusForScaling.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListSkusForScaling.json */ /** * Sample code: RedisEnterpriseListSkusForScaling. @@ -994,10 +1087,16 @@ public final class RedisEnterpriseListSkusForScalingSamples { ```java import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; 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; @@ -1006,9 +1105,7 @@ import java.util.Map; */ public final class RedisEnterpriseUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseUpdate.json */ /** * Sample code: RedisEnterpriseUpdate. @@ -1024,6 +1121,19 @@ public final class RedisEnterpriseUpdateSamples { .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withMaintenanceConfiguration(new MaintenanceConfiguration().withMaintenanceWindows(Arrays.asList( + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.MONDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.TUESDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.WEDNESDAY))))) .apply(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index 64534fb9e51c..d5c5984c31e6 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -17,8 +17,8 @@ 2.2.0-beta.1 jar - Microsoft Azure SDK for RedisEnterprise Management - This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2025-07-01. + Microsoft Azure SDK for Redis Enterprise Management + This package contains Microsoft Azure SDK for Redis Enterprise 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 api-version 2026-02-01-preview. https://github.com/Azure/azure-sdk-for-java 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 2f902dec57ce..d236089b5a3b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise; @@ -27,6 +27,8 @@ import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterpriseManagementClient; import com.azure.resourcemanager.redisenterprise.implementation.AccessPolicyAssignmentsImpl; import com.azure.resourcemanager.redisenterprise.implementation.DatabasesImpl; +import com.azure.resourcemanager.redisenterprise.implementation.MigrationOperationsImpl; +import com.azure.resourcemanager.redisenterprise.implementation.MigrationsImpl; import com.azure.resourcemanager.redisenterprise.implementation.OperationsImpl; import com.azure.resourcemanager.redisenterprise.implementation.OperationsStatusImpl; import com.azure.resourcemanager.redisenterprise.implementation.PrivateEndpointConnectionsImpl; @@ -35,6 +37,8 @@ import com.azure.resourcemanager.redisenterprise.implementation.RedisEnterprisesImpl; import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignments; import com.azure.resourcemanager.redisenterprise.models.Databases; +import com.azure.resourcemanager.redisenterprise.models.MigrationOperations; +import com.azure.resourcemanager.redisenterprise.models.Migrations; import com.azure.resourcemanager.redisenterprise.models.Operations; import com.azure.resourcemanager.redisenterprise.models.OperationsStatus; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnections; @@ -55,17 +59,21 @@ public final class RedisEnterpriseManager { private Operations operations; - private OperationsStatus operationsStatus; + private Databases databases; + + private PrivateEndpointConnections privateEndpointConnections; + + private Migrations migrations; private RedisEnterprises redisEnterprises; - private Databases databases; + private PrivateLinkResources privateLinkResources; private AccessPolicyAssignments accessPolicyAssignments; - private PrivateEndpointConnections privateEndpointConnections; + private MigrationOperations migrationOperations; - private PrivateLinkResources privateLinkResources; + private OperationsStatus operationsStatus; private final RedisEnterpriseManagementClient clientObject; @@ -80,11 +88,11 @@ private RedisEnterpriseManager(HttpPipeline httpPipeline, AzureProfile profile, } /** - * Creates an instance of RedisEnterprise service API entry point. + * Creates an instance of Redis Enterprise service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the RedisEnterprise service API instance. + * @return the Redis Enterprise service API instance. */ public static RedisEnterpriseManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -93,11 +101,11 @@ public static RedisEnterpriseManager authenticate(TokenCredential credential, Az } /** - * Creates an instance of RedisEnterprise service API entry point. + * Creates an instance of Redis Enterprise service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the RedisEnterprise service API instance. + * @return the Redis Enterprise service API instance. */ public static RedisEnterpriseManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -219,11 +227,11 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of RedisEnterprise service API entry point. + * Creates an instance of Redis Enterprise service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the RedisEnterprise service API instance. + * @return the Redis Enterprise service API instance. */ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -295,15 +303,40 @@ public Operations operations() { } /** - * Gets the resource collection API of OperationsStatus. + * Gets the resource collection API of Databases. It manages Database. * - * @return Resource collection API of OperationsStatus. + * @return Resource collection API of Databases. */ - public OperationsStatus operationsStatus() { - if (this.operationsStatus == null) { - this.operationsStatus = new OperationsStatusImpl(clientObject.getOperationsStatus(), this); + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); } - return operationsStatus; + return databases; + } + + /** + * 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 + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of Migrations. + * + * @return Resource collection API of Migrations. + */ + public Migrations migrations() { + if (this.migrations == null) { + this.migrations = new MigrationsImpl(clientObject.getMigrations(), this); + } + return migrations; } /** @@ -319,15 +352,15 @@ public RedisEnterprises redisEnterprises() { } /** - * Gets the resource collection API of Databases. It manages Database. + * Gets the resource collection API of PrivateLinkResources. * - * @return Resource collection API of Databases. + * @return Resource collection API of PrivateLinkResources. */ - public Databases databases() { - if (this.databases == null) { - this.databases = new DatabasesImpl(clientObject.getDatabases(), this); + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); } - return databases; + return privateLinkResources; } /** @@ -344,28 +377,27 @@ public AccessPolicyAssignments accessPolicyAssignments() { } /** - * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * Gets the resource collection API of MigrationOperations. * - * @return Resource collection API of PrivateEndpointConnections. + * @return Resource collection API of MigrationOperations. */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + public MigrationOperations migrationOperations() { + if (this.migrationOperations == null) { + this.migrationOperations = new MigrationOperationsImpl(clientObject.getMigrationOperations(), this); } - return privateEndpointConnections; + return migrationOperations; } /** - * Gets the resource collection API of PrivateLinkResources. + * Gets the resource collection API of OperationsStatus. * - * @return Resource collection API of PrivateLinkResources. + * @return Resource collection API of OperationsStatus. */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + public OperationsStatus operationsStatus() { + if (this.operationsStatus == null) { + this.operationsStatus = new OperationsStatusImpl(clientObject.getOperationsStatus(), this); } - return privateLinkResources; + return operationsStatus; } /** diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/AccessPolicyAssignmentsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/AccessPolicyAssignmentsClient.java index d7fc33028485..528955525058 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/AccessPolicyAssignmentsClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/AccessPolicyAssignmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -18,45 +18,39 @@ */ public interface AccessPolicyAssignmentsClient { /** - * Creates/Updates a particular access policy assignment for a database. + * Gets information about access policy assignment for database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise database. * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @param parameters Parameters supplied to the create access policy assignment for 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 the {@link SyncPoller} for polling of describes the access policy assignment of Redis Enterprise - * database. + * @return information about access policy assignment for database along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccessPolicyAssignmentInner> beginCreateUpdate( - String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, - AccessPolicyAssignmentInner parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, + String databaseName, String accessPolicyAssignmentName, Context context); /** - * Creates/Updates a particular access policy assignment for a database. + * Gets information about access policy assignment for database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise database. * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @param parameters Parameters supplied to the create access policy assignment for 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 the {@link SyncPoller} for polling of describes the access policy assignment of Redis Enterprise - * database. + * @return information about access policy assignment for database. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccessPolicyAssignmentInner> beginCreateUpdate( - String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, - AccessPolicyAssignmentInner parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + AccessPolicyAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, + String accessPolicyAssignmentName); /** * Creates/Updates a particular access policy assignment for a database. @@ -70,11 +64,13 @@ SyncPoller, AccessPolicyAssignmentInner> * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the access policy assignment of Redis Enterprise database. + * @return the {@link SyncPoller} for polling of describes the access policy assignment of Redis Enterprise + * database. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String clusterName, String databaseName, - String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessPolicyAssignmentInner> beginCreateUpdate( + String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, + AccessPolicyAssignmentInner parameters); /** * Creates/Updates a particular access policy assignment for a database. @@ -89,46 +85,50 @@ AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String cluste * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the access policy assignment of Redis Enterprise database. + * @return the {@link SyncPoller} for polling of describes the access policy assignment of Redis Enterprise + * database. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String clusterName, String databaseName, - String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessPolicyAssignmentInner> beginCreateUpdate( + String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, + AccessPolicyAssignmentInner parameters, Context context); /** - * Gets information about access policy assignment for database. + * Creates/Updates a particular access policy assignment for a database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise database. * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to the create access policy assignment for database. * @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 access policy assignment for database along with {@link Response}. + * @return describes the access policy assignment of Redis Enterprise database. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String clusterName, - String databaseName, String accessPolicyAssignmentName, Context context); + AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String clusterName, String databaseName, + String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters); /** - * Gets information about access policy assignment for database. + * Creates/Updates a particular access policy assignment for a database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise database. * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. + * @param parameters Parameters supplied to the create access policy assignment for 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 access policy assignment for database. + * @return describes the access policy assignment of Redis Enterprise database. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessPolicyAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, - String accessPolicyAssignmentName); + AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String clusterName, String databaseName, + String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters, Context context); /** * Deletes a single access policy assignment. 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 ea48f2f8ff97..a7d846eb4eab 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -26,33 +26,36 @@ */ public interface DatabasesClient { /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + * @return information about a database in a Redis Enterprise cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCluster(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, + Context context); /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param context The context to associate with this operation. + * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + * @return information about a database in a Redis Enterprise cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner get(String resourceGroupName, String clusterName, String databaseName); /** * Creates a database. @@ -193,36 +196,36 @@ DatabaseInner update(String resourceGroupName, String clusterName, String databa Context context); /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 Redis Enterprise cluster along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String databaseName); /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 Redis Enterprise cluster. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner get(String resourceGroupName, String clusterName, String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String databaseName, + Context context); /** * Deletes a single database. @@ -234,10 +237,9 @@ Response getWithResponse(String resourceGroupName, String cluster * @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> beginDelete(String resourceGroupName, String clusterName, String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String databaseName); /** * Deletes a single database. @@ -250,40 +252,38 @@ Response getWithResponse(String resourceGroupName, String cluster * @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> beginDelete(String resourceGroupName, String clusterName, String databaseName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String databaseName, Context context); /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String databaseName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String databaseName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieves the access keys for the Redis Enterprise database. @@ -296,7 +296,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @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 the secret access keys used for authenticating connections to redis along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse(String resourceGroupName, String clusterName, String databaseName, @@ -312,7 +312,7 @@ Response listKeysWithResponse(String resourceGroupName, String * @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 the secret access keys used for authenticating connections to redis. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -328,7 +328,7 @@ Response listKeysWithResponse(String resourceGroupName, String * @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 access keys. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey(String resourceGroupName, @@ -346,7 +346,7 @@ SyncPoller, AccessKeysInner> beginRegenerateKey(Stri * @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 access keys. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey(String resourceGroupName, @@ -363,7 +363,7 @@ SyncPoller, AccessKeysInner> beginRegenerateKey(Stri * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey(String resourceGroupName, String clusterName, String databaseName, @@ -381,7 +381,7 @@ AccessKeysInner regenerateKey(String resourceGroupName, String clusterName, Stri * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey(String resourceGroupName, String clusterName, String databaseName, diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationOperationsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationOperationsClient.java new file mode 100644 index 000000000000..592fb8924cb7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationOperationsClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; + +/** + * An instance of this class provides access to all the operations defined in MigrationOperationsClient. + */ +public interface MigrationOperationsClient { + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationInner get(String resourceGroupName, String clusterName); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationInner> beginStart(String resourceGroupName, String clusterName, + MigrationInner parameters); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 {@link SyncPoller} for polling of describes the current migration operation on a Redis Enterprise + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationInner> beginStart(String resourceGroupName, String clusterName, + MigrationInner parameters, Context context); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationInner start(String resourceGroupName, String clusterName, MigrationInner parameters); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationInner start(String resourceGroupName, String clusterName, MigrationInner parameters, Context context); + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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> beginCancel(String resourceGroupName, String clusterName); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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> beginCancel(String resourceGroupName, String clusterName, Context context); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationsClient.java new file mode 100644 index 000000000000..0c1d8b8dd86b --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationsClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; + +/** + * An instance of this class provides access to all the operations defined in MigrationsClient. + */ +public interface MigrationsClient { + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse(String resourceGroupName, String clusterName, + MigrationValidationRequest body, Context context); + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationValidationResponseInner validate(String resourceGroupName, String clusterName, + MigrationValidationRequest body); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java index 1e0faa8ee6b0..9123b75911a0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; 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 ff0d88d8857d..d95184256bd1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -17,7 +17,7 @@ public interface OperationsStatusClient { /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. @@ -31,7 +31,7 @@ public interface OperationsStatusClient { /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. 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 87dd760bd957..7d68e3de7a0a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -17,37 +17,6 @@ * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String clusterName); - - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String clusterName, Context context); - /** * Gets the specified private endpoint connection associated with the Redis Enterprise cluster. * @@ -225,4 +194,35 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java index aa64deea1acc..1864c83dde41 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; 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 297f788b7258..e6ceda134d4a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -12,26 +12,26 @@ */ public interface RedisEnterpriseManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -54,11 +54,25 @@ public interface RedisEnterpriseManagementClient { OperationsClient getOperations(); /** - * Gets the OperationsStatusClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the OperationsStatusClient object. + * @return the DatabasesClient object. */ - OperationsStatusClient getOperationsStatus(); + DatabasesClient getDatabases(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the MigrationsClient object to access its operations. + * + * @return the MigrationsClient object. + */ + MigrationsClient getMigrations(); /** * Gets the RedisEnterprisesClient object to access its operations. @@ -68,11 +82,11 @@ public interface RedisEnterpriseManagementClient { RedisEnterprisesClient getRedisEnterprises(); /** - * Gets the DatabasesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the DatabasesClient object. + * @return the PrivateLinkResourcesClient object. */ - DatabasesClient getDatabases(); + PrivateLinkResourcesClient getPrivateLinkResources(); /** * Gets the AccessPolicyAssignmentsClient object to access its operations. @@ -82,16 +96,16 @@ public interface RedisEnterpriseManagementClient { AccessPolicyAssignmentsClient getAccessPolicyAssignments(); /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the MigrationOperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the MigrationOperationsClient object. */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + MigrationOperationsClient getMigrationOperations(); /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the OperationsStatusClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the OperationsStatusClient object. */ - PrivateLinkResourcesClient getPrivateLinkResources(); + OperationsStatusClient getOperationsStatus(); } 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 18cb840eb01b..2d62bda9b8c1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent; @@ -19,6 +19,36 @@ * An instance of this class provides access to all the operations defined in RedisEnterprisesClient. */ public interface RedisEnterprisesClient { + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + /** * Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster. * @@ -203,36 +233,6 @@ SyncPoller, ClusterInner> beginUpdate(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String clusterName, Context context); - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, - Context context); - - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); - /** * Lists all Redis Enterprise clusters in a resource group. * 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 ee149706c334..f8c531b89ec7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; @@ -12,8 +12,6 @@ import java.io.IOException; /** - * Access keys - * * The secret access keys used for authenticating connections to redis. */ @Immutable @@ -31,7 +29,7 @@ public final class AccessKeysInner implements JsonSerializable /** * Creates an instance of AccessKeysInner class. */ - public AccessKeysInner() { + private AccessKeysInner() { } /** @@ -52,14 +50,6 @@ public String secondaryKey() { return this.secondaryKey; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentInner.java index 5b13cb1f290a..7a21b8e61e39 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -23,6 +24,11 @@ public final class AccessPolicyAssignmentInner extends ProxyResource { */ private AccessPolicyAssignmentProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -53,6 +59,15 @@ private AccessPolicyAssignmentProperties 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 type property: The type of the resource. * @@ -140,17 +155,6 @@ public AccessPolicyAssignmentInner withUser(AccessPolicyAssignmentPropertiesUser return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -186,6 +190,8 @@ public static AccessPolicyAssignmentInner fromJson(JsonReader jsonReader) throws } else if ("properties".equals(fieldName)) { deserializedAccessPolicyAssignmentInner.innerProperties = AccessPolicyAssignmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccessPolicyAssignmentInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentProperties.java index 20d86543af27..bea3e9cdd534 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,8 +14,6 @@ import java.io.IOException; /** - * Redis Enterprise database access policy assignment properties - * * Properties of Redis Enterprise database access policy assignment. */ @Fluent @@ -93,28 +90,6 @@ public AccessPolicyAssignmentProperties withUser(AccessPolicyAssignmentPropertie return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (accessPolicyName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property accessPolicyName in model AccessPolicyAssignmentProperties")); - } - if (user() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property user in model AccessPolicyAssignmentProperties")); - } else { - user().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AccessPolicyAssignmentProperties.class); - /** * {@inheritDoc} */ 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 c551264b5d1e..379222ceb884 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 @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; import com.azure.resourcemanager.redisenterprise.models.HighAvailability; import com.azure.resourcemanager.redisenterprise.models.Kind; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; @@ -29,6 +30,11 @@ */ @Fluent public final class ClusterInner extends Resource { + /* + * Other properties of the cluster. + */ + private ClusterProperties innerProperties; + /* * Distinguishes the kind of cluster. Read-only. */ @@ -40,19 +46,19 @@ public final class ClusterInner extends Resource { private Sku sku; /* - * The Availability Zones where this cluster will be deployed. + * The availability zones. */ private List zones; /* - * The identity of the resource. + * The managed service identities assigned to this resource. */ private ManagedServiceIdentity identity; /* - * Other properties of the cluster. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private ClusterProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -75,6 +81,15 @@ public final class ClusterInner extends Resource { public ClusterInner() { } + /** + * Get the innerProperties property: Other properties of the cluster. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + /** * Get the kind property: Distinguishes the kind of cluster. Read-only. * @@ -105,7 +120,7 @@ public ClusterInner withSku(Sku sku) { } /** - * Get the zones property: The Availability Zones where this cluster will be deployed. + * Get the zones property: The availability zones. * * @return the zones value. */ @@ -114,7 +129,7 @@ public List zones() { } /** - * Set the zones property: The Availability Zones where this cluster will be deployed. + * Set the zones property: The availability zones. * * @param zones the zones value to set. * @return the ClusterInner object itself. @@ -125,7 +140,7 @@ public ClusterInner withZones(List zones) { } /** - * Get the identity property: The identity of the resource. + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -134,7 +149,7 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: The identity of the resource. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the ClusterInner object itself. @@ -145,12 +160,12 @@ public ClusterInner withIdentity(ManagedServiceIdentity identity) { } /** - * Get the innerProperties property: Other properties of the cluster. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private ClusterProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -303,6 +318,29 @@ public ClusterInner withEncryption(ClusterPropertiesEncryption encryption) { return this; } + /** + * Get the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @return the maintenanceConfiguration value. + */ + public MaintenanceConfiguration maintenanceConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceConfiguration(); + } + + /** + * Set the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @param maintenanceConfiguration the maintenanceConfiguration value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withMaintenanceConfiguration(maintenanceConfiguration); + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -360,27 +398,15 @@ public List privateEndpointConnections() { } /** - * Validates the instance. + * Get the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property sku in model ClusterInner")); - } else { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } + * @return the migratedEndpoint value. + */ + public String migratedEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().migratedEndpoint(); } - private static final ClientLogger LOGGER = new ClientLogger(ClusterInner.class); - /** * {@inheritDoc} */ @@ -390,9 +416,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -425,6 +451,8 @@ public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { deserializedClusterInner.withTags(tags); } else if ("sku".equals(fieldName)) { deserializedClusterInner.sku = Sku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedClusterInner.innerProperties = ClusterProperties.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedClusterInner.kind = Kind.fromString(reader.getString()); } else if ("zones".equals(fieldName)) { @@ -432,8 +460,8 @@ public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { deserializedClusterInner.zones = zones; } else if ("identity".equals(fieldName)) { deserializedClusterInner.identity = ManagedServiceIdentity.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedClusterInner.innerProperties = ClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 74f2bac2995e..3d6ea3d009d4 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 @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.redisenterprise.models.ClusterCommonProperties; import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; import com.azure.resourcemanager.redisenterprise.models.HighAvailability; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; import com.azure.resourcemanager.redisenterprise.models.RedundancyMode; @@ -21,8 +21,6 @@ import java.util.List; /** - * Redis Enterprise cluster properties for create operations - * * Properties of Redis Enterprise clusters for create operations. */ @Fluent @@ -33,6 +31,12 @@ public final class ClusterProperties extends ClusterCommonProperties { */ private PublicNetworkAccess publicNetworkAccess; + /* + * The endpoint of the source resource that is currently pointing to this resource as a result of an ACR/ACRE to AMR + * migration. + */ + private String migratedEndpoint; + /* * List of private endpoint connections associated with the specified Redis Enterprise cluster */ @@ -93,6 +97,17 @@ public ClusterProperties withPublicNetworkAccess(PublicNetworkAccess publicNetwo return this; } + /** + * Get the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. + * + * @return the migratedEndpoint value. + */ + @Override + public String migratedEndpoint() { + return this.migratedEndpoint; + } + /** * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified * Redis Enterprise cluster. @@ -183,27 +198,14 @@ public ClusterProperties withEncryption(ClusterPropertiesEncryption encryption) } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (publicNetworkAccess() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property publicNetworkAccess in model ClusterProperties")); - } - if (encryption() != null) { - encryption().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } + public ClusterProperties withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + super.withMaintenanceConfiguration(maintenanceConfiguration); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(ClusterProperties.class); - /** * {@inheritDoc} */ @@ -215,6 +217,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("minimumTlsVersion", minimumTlsVersion() == null ? null : minimumTlsVersion().toString()); jsonWriter.writeJsonField("encryption", encryption()); + jsonWriter.writeJsonField("maintenanceConfiguration", maintenanceConfiguration()); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); return jsonWriter.writeEndObject(); @@ -242,6 +245,9 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedClusterProperties.withMinimumTlsVersion(TlsVersion.fromString(reader.getString())); } else if ("encryption".equals(fieldName)) { deserializedClusterProperties.withEncryption(ClusterPropertiesEncryption.fromJson(reader)); + } else if ("maintenanceConfiguration".equals(fieldName)) { + deserializedClusterProperties + .withMaintenanceConfiguration(MaintenanceConfiguration.fromJson(reader)); } else if ("hostName".equals(fieldName)) { deserializedClusterProperties.hostname = reader.getString(); } else if ("provisioningState".equals(fieldName)) { @@ -256,6 +262,8 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedClusterProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("migratedEndpoint".equals(fieldName)) { + deserializedClusterProperties.migratedEndpoint = reader.getString(); } else if ("publicNetworkAccess".equals(fieldName)) { deserializedClusterProperties.publicNetworkAccess = PublicNetworkAccess.fromString(reader.getString()); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterUpdateProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterUpdateProperties.java index 16994ce267bf..bd241b23be23 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterUpdateProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; @@ -11,6 +11,7 @@ import com.azure.resourcemanager.redisenterprise.models.ClusterCommonProperties; import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; import com.azure.resourcemanager.redisenterprise.models.HighAvailability; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; import com.azure.resourcemanager.redisenterprise.models.RedundancyMode; @@ -20,8 +21,6 @@ import java.util.List; /** - * Redis Enterprise cluster properties for update operations - * * Properties of Redis Enterprise clusters for update operations. */ @Fluent @@ -32,6 +31,12 @@ public final class ClusterUpdateProperties extends ClusterCommonProperties { */ private PublicNetworkAccess publicNetworkAccess; + /* + * The endpoint of the source resource that is currently pointing to this resource as a result of an ACR/ACRE to AMR + * migration. + */ + private String migratedEndpoint; + /* * List of private endpoint connections associated with the specified Redis Enterprise cluster */ @@ -92,6 +97,17 @@ public ClusterUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publi return this; } + /** + * Get the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. + * + * @return the migratedEndpoint value. + */ + @Override + public String migratedEndpoint() { + return this.migratedEndpoint; + } + /** * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified * Redis Enterprise cluster. @@ -182,18 +198,12 @@ public ClusterUpdateProperties withEncryption(ClusterPropertiesEncryption encryp } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (encryption() != null) { - encryption().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } + public ClusterUpdateProperties withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + super.withMaintenanceConfiguration(maintenanceConfiguration); + return this; } /** @@ -207,6 +217,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("minimumTlsVersion", minimumTlsVersion() == null ? null : minimumTlsVersion().toString()); jsonWriter.writeJsonField("encryption", encryption()); + jsonWriter.writeJsonField("maintenanceConfiguration", maintenanceConfiguration()); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); return jsonWriter.writeEndObject(); @@ -235,6 +246,9 @@ public static ClusterUpdateProperties fromJson(JsonReader jsonReader) throws IOE .withMinimumTlsVersion(TlsVersion.fromString(reader.getString())); } else if ("encryption".equals(fieldName)) { deserializedClusterUpdateProperties.withEncryption(ClusterPropertiesEncryption.fromJson(reader)); + } else if ("maintenanceConfiguration".equals(fieldName)) { + deserializedClusterUpdateProperties + .withMaintenanceConfiguration(MaintenanceConfiguration.fromJson(reader)); } else if ("hostName".equals(fieldName)) { deserializedClusterUpdateProperties.hostname = reader.getString(); } else if ("provisioningState".equals(fieldName)) { @@ -250,6 +264,8 @@ public static ClusterUpdateProperties fromJson(JsonReader jsonReader) throws IOE List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedClusterUpdateProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("migratedEndpoint".equals(fieldName)) { + deserializedClusterUpdateProperties.migratedEndpoint = reader.getString(); } else if ("publicNetworkAccess".equals(fieldName)) { deserializedClusterUpdateProperties.publicNetworkAccess = PublicNetworkAccess.fromString(reader.getString()); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseCreateProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseCreateProperties.java index c0bd666e40b2..dc32f82bd61f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseCreateProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseCreateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; @@ -23,12 +23,16 @@ import java.util.List; /** - * Redis Enterprise database create properties - * * Properties for creating Redis Enterprise databases. */ @Fluent public final class DatabaseCreateProperties extends DatabaseCommonProperties { + /* + * This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even + * after database is created. Default is Disabled. + */ + private AccessKeysAuthentication accessKeysAuthentication; + /* * Version of Redis the database is running on, e.g. '6.0' */ @@ -50,6 +54,28 @@ public final class DatabaseCreateProperties extends DatabaseCommonProperties { public DatabaseCreateProperties() { } + /** + * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @return the accessKeysAuthentication value. + */ + public AccessKeysAuthentication accessKeysAuthentication() { + return this.accessKeysAuthentication; + } + + /** + * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @return the DatabaseCreateProperties object itself. + */ + public DatabaseCreateProperties withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + this.accessKeysAuthentication = accessKeysAuthentication; + return this; + } + /** * Get the redisVersion property: Version of Redis the database is running on, e.g. '6.0'. * @@ -156,29 +182,11 @@ public DatabaseCreateProperties withDeferUpgrade(DeferUpgradeSetting deferUpgrad * {@inheritDoc} */ @Override - public DatabaseCreateProperties withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { - super.withAccessKeysAuthentication(accessKeysAuthentication); + public DatabaseCreateProperties withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { + super.withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); - } - if (geoReplication() != null) { - geoReplication().validate(); - } - } - /** * {@inheritDoc} */ @@ -194,8 +202,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("modules", modules(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("geoReplication", geoReplication()); jsonWriter.writeStringField("deferUpgrade", deferUpgrade() == null ? null : deferUpgrade().toString()); + jsonWriter.writeStringField("notifyKeyspaceEvents", notifyKeyspaceEvents()); jsonWriter.writeStringField("accessKeysAuthentication", - accessKeysAuthentication() == null ? null : accessKeysAuthentication().toString()); + this.accessKeysAuthentication == null ? null : this.accessKeysAuthentication.toString()); return jsonWriter.writeEndObject(); } @@ -242,9 +251,11 @@ public static DatabaseCreateProperties fromJson(JsonReader jsonReader) throws IO } else if ("deferUpgrade".equals(fieldName)) { deserializedDatabaseCreateProperties .withDeferUpgrade(DeferUpgradeSetting.fromString(reader.getString())); + } else if ("notifyKeyspaceEvents".equals(fieldName)) { + deserializedDatabaseCreateProperties.withNotifyKeyspaceEvents(reader.getString()); } else if ("accessKeysAuthentication".equals(fieldName)) { - deserializedDatabaseCreateProperties - .withAccessKeysAuthentication(AccessKeysAuthentication.fromString(reader.getString())); + deserializedDatabaseCreateProperties.accessKeysAuthentication + = AccessKeysAuthentication.fromString(reader.getString()); } else { reader.skipChildren(); } 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 3166368a0c67..f6f00d2e014c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; @@ -107,6 +107,31 @@ public String id() { return this.id; } + /** + * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @return the accessKeysAuthentication value. + */ + public AccessKeysAuthentication accessKeysAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().accessKeysAuthentication(); + } + + /** + * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @return the DatabaseInner object itself. + */ + public DatabaseInner withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseCreateProperties(); + } + this.innerProperties().withAccessKeysAuthentication(accessKeysAuthentication); + return this; + } + /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. @@ -331,41 +356,34 @@ public DatabaseInner withDeferUpgrade(DeferUpgradeSetting deferUpgrade) { } /** - * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * Get the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * - * @return the accessKeysAuthentication value. + * @return the notifyKeyspaceEvents value. */ - public AccessKeysAuthentication accessKeysAuthentication() { - return this.innerProperties() == null ? null : this.innerProperties().accessKeysAuthentication(); + public String notifyKeyspaceEvents() { + return this.innerProperties() == null ? null : this.innerProperties().notifyKeyspaceEvents(); } /** - * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * Set the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * - * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @param notifyKeyspaceEvents the notifyKeyspaceEvents value to set. * @return the DatabaseInner object itself. */ - public DatabaseInner withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + public DatabaseInner withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { if (this.innerProperties() == null) { this.innerProperties = new DatabaseCreateProperties(); } - this.innerProperties().withAccessKeysAuthentication(accessKeysAuthentication); + this.innerProperties().withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseUpdateProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseUpdateProperties.java index 1238bcd80c10..769a0a597189 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseUpdateProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; @@ -23,12 +23,16 @@ import java.util.List; /** - * Redis Enterprise database update properties - * * Properties for updating Redis Enterprise databases. */ @Fluent public final class DatabaseUpdateProperties extends DatabaseCommonProperties { + /* + * This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even + * after database is created. Default is Disabled. + */ + private AccessKeysAuthentication accessKeysAuthentication; + /* * Version of Redis the database is running on, e.g. '6.0' */ @@ -50,6 +54,28 @@ public final class DatabaseUpdateProperties extends DatabaseCommonProperties { public DatabaseUpdateProperties() { } + /** + * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @return the accessKeysAuthentication value. + */ + public AccessKeysAuthentication accessKeysAuthentication() { + return this.accessKeysAuthentication; + } + + /** + * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @return the DatabaseUpdateProperties object itself. + */ + public DatabaseUpdateProperties withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + this.accessKeysAuthentication = accessKeysAuthentication; + return this; + } + /** * Get the redisVersion property: Version of Redis the database is running on, e.g. '6.0'. * @@ -156,29 +182,11 @@ public DatabaseUpdateProperties withDeferUpgrade(DeferUpgradeSetting deferUpgrad * {@inheritDoc} */ @Override - public DatabaseUpdateProperties withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { - super.withAccessKeysAuthentication(accessKeysAuthentication); + public DatabaseUpdateProperties withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { + super.withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); - } - if (geoReplication() != null) { - geoReplication().validate(); - } - } - /** * {@inheritDoc} */ @@ -194,8 +202,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("modules", modules(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("geoReplication", geoReplication()); jsonWriter.writeStringField("deferUpgrade", deferUpgrade() == null ? null : deferUpgrade().toString()); + jsonWriter.writeStringField("notifyKeyspaceEvents", notifyKeyspaceEvents()); jsonWriter.writeStringField("accessKeysAuthentication", - accessKeysAuthentication() == null ? null : accessKeysAuthentication().toString()); + this.accessKeysAuthentication == null ? null : this.accessKeysAuthentication.toString()); return jsonWriter.writeEndObject(); } @@ -242,9 +251,11 @@ public static DatabaseUpdateProperties fromJson(JsonReader jsonReader) throws IO } else if ("deferUpgrade".equals(fieldName)) { deserializedDatabaseUpdateProperties .withDeferUpgrade(DeferUpgradeSetting.fromString(reader.getString())); + } else if ("notifyKeyspaceEvents".equals(fieldName)) { + deserializedDatabaseUpdateProperties.withNotifyKeyspaceEvents(reader.getString()); } else if ("accessKeysAuthentication".equals(fieldName)) { - deserializedDatabaseUpdateProperties - .withAccessKeysAuthentication(AccessKeysAuthentication.fromString(reader.getString())); + deserializedDatabaseUpdateProperties.accessKeysAuthentication + = AccessKeysAuthentication.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationInner.java new file mode 100644 index 000000000000..270c11f47f6a --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redisenterprise.models.MigrationProperties; +import java.io.IOException; + +/** + * Describes the current migration operation on a Redis Enterprise cluster. + */ +@Fluent +public final class MigrationInner extends ProxyResource { + /* + * Properties of the migration operation. + */ + private MigrationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MigrationInner class. + */ + public MigrationInner() { + } + + /** + * Get the properties property: Properties of the migration operation. + * + * @return the properties value. + */ + public MigrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the migration operation. + * + * @param properties the properties value to set. + * @return the MigrationInner object itself. + */ + public MigrationInner withProperties(MigrationProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationInner. + */ + public static MigrationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationInner deserializedMigrationInner = new MigrationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMigrationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMigrationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMigrationInner.properties = MigrationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMigrationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationInner; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationValidationResponseInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationValidationResponseInner.java new file mode 100644 index 000000000000..6c1811582291 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationValidationResponseInner.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationError; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationWarning; +import java.io.IOException; +import java.util.List; + +/** + * Response for migration validation operation. + */ +@Immutable +public final class MigrationValidationResponseInner implements JsonSerializable { + /* + * Indicates whether the migration validation passed. + */ + private boolean isValid; + + /* + * List of validation errors that prevent migration. + */ + private List errors; + + /* + * List of validation warnings that may impact migration. + */ + private List warnings; + + /** + * Creates an instance of MigrationValidationResponseInner class. + */ + private MigrationValidationResponseInner() { + } + + /** + * Get the isValid property: Indicates whether the migration validation passed. + * + * @return the isValid value. + */ + public boolean isValid() { + return this.isValid; + } + + /** + * Get the errors property: List of validation errors that prevent migration. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the warnings property: List of validation warnings that may impact migration. + * + * @return the warnings value. + */ + public List warnings() { + return this.warnings; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isValid", this.isValid); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationValidationResponseInner. + */ + public static MigrationValidationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationResponseInner deserializedMigrationValidationResponseInner + = new MigrationValidationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isValid".equals(fieldName)) { + deserializedMigrationValidationResponseInner.isValid = reader.getBoolean(); + } else if ("errors".equals(fieldName)) { + List errors + = reader.readArray(reader1 -> MigrationValidationError.fromJson(reader1)); + deserializedMigrationValidationResponseInner.errors = errors; + } else if ("warnings".equals(fieldName)) { + List warnings + = reader.readArray(reader1 -> MigrationValidationWarning.fromJson(reader1)); + deserializedMigrationValidationResponseInner.warnings = warnings; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationResponseInner; + }); + } +} 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 46b7a132eafc..02027d31111a 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,7 +19,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +28,8 @@ public final class OperationInner implements JsonSerializable { 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 Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +45,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +67,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +84,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". @@ -106,8 +95,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ @@ -115,17 +104,6 @@ public ActionType actionType() { return this.actionType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ 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 a8c0055d5b0d..d26165afe40e 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * The status of a long-running operation. */ -@Fluent +@Immutable public final class OperationStatusInner implements JsonSerializable { /* * The operation's unique id. @@ -50,7 +50,7 @@ public final class OperationStatusInner implements JsonSerializable groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. * * @return the privateEndpoint value. */ @@ -94,7 +119,7 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. + * Set the privateEndpoint property: The private endpoint resource. * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. @@ -142,17 +167,6 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -189,6 +203,8 @@ public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) thr } else if ("properties".equals(fieldName)) { deserializedPrivateEndpointConnectionInner.innerProperties = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 25f7f204421c..61205e1e3133 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,15 +13,21 @@ import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; import java.io.IOException; +import java.util.List; /** - * Properties of the PrivateEndpointConnectProperties. + * Properties of the private endpoint connection. */ @Fluent public final class PrivateEndpointConnectionProperties implements JsonSerializable { /* - * The resource of private end point. + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The private endpoint resource. */ private PrivateEndpoint privateEndpoint; @@ -43,7 +48,16 @@ public PrivateEndpointConnectionProperties() { } /** - * Get the privateEndpoint property: The resource of private end point. + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. * * @return the privateEndpoint value. */ @@ -52,7 +66,7 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. + * Set the privateEndpoint property: The private endpoint resource. * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. @@ -94,26 +108,6 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { return this.provisioningState; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - /** * {@inheritDoc} */ @@ -145,6 +139,9 @@ public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader if ("privateLinkServiceConnectionState".equals(fieldName)) { deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; } else if ("privateEndpoint".equals(fieldName)) { deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { 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 341751b991d9..4b6f40e6f1b7 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -15,13 +16,18 @@ /** * A private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ private PrivateLinkResourceProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -40,7 +46,7 @@ public final class PrivateLinkResourceInner extends ProxyResource { /** * Creates an instance of PrivateLinkResourceInner class. */ - public PrivateLinkResourceInner() { + private PrivateLinkResourceInner() { } /** @@ -52,6 +58,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 type property: The type of the resource. * @@ -101,7 +116,7 @@ public List requiredMembers() { } /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * Get the requiredZoneNames property: The private link resource private link DNS zone name. * * @return the requiredZoneNames value. */ @@ -109,31 +124,6 @@ public List requiredZoneNames() { return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -169,6 +159,8 @@ public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IO } else if ("properties".equals(fieldName)) { deserializedPrivateLinkResourceInner.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 a2c3bc6b562c..b546d621c37a 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Properties of a private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. @@ -28,14 +28,14 @@ public final class PrivateLinkResourceProperties implements JsonSerializable requiredMembers; /* - * The private link resource Private link DNS zone name. + * The private link resource private link DNS zone name. */ private List requiredZoneNames; /** * Creates an instance of PrivateLinkResourceProperties class. */ - public PrivateLinkResourceProperties() { + private PrivateLinkResourceProperties() { } /** @@ -57,7 +57,7 @@ public List requiredMembers() { } /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * Get the requiredZoneNames property: The private link resource private link DNS zone name. * * @return the requiredZoneNames value. */ @@ -65,25 +65,6 @@ public List requiredZoneNames() { return this.requiredZoneNames; } - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/SkuDetailsListInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/SkuDetailsListInner.java index b8d0af654f2b..dec7e3c6099d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/SkuDetailsListInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/SkuDetailsListInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The response of a listSkusForScaling operation. */ -@Fluent +@Immutable public final class SkuDetailsListInner implements JsonSerializable { /* * List of SKUS available to scale up or scale down. @@ -26,7 +26,7 @@ public final class SkuDetailsListInner implements JsonSerializable skus() { return this.skus; } - /** - * Set the skus property: List of SKUS available to scale up or scale down. - * - * @param skus the skus value to set. - * @return the SkuDetailsListInner object itself. - */ - public SkuDetailsListInner withSkus(List skus) { - this.skus = skus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skus() != null) { - skus().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/package-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/package-info.java index c35ee78e5751..795b69aa40b7 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/package-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for RedisEnterpriseManagementClient. + * Package containing the inner data models for RedisEnterprise. * REST API for managing Redis Enterprise resources in Azure. */ package com.azure.resourcemanager.redisenterprise.fluent.models; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/package-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/package-info.java index b7f1c60d0a1e..a4649d7f7e05 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/package-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for RedisEnterpriseManagementClient. + * Package containing the service clients for RedisEnterprise. * REST API for managing Redis Enterprise resources in Azure. */ package com.azure.resourcemanager.redisenterprise.fluent; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java index 461b023af555..a6682ece1d03 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentImpl.java index f985bc88dca0..cb2390e6c766 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.AccessPolicyAssignmentInner; import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignment; @@ -28,6 +29,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsClientImpl.java index a2711db000b4..9daa09372d62 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.AccessPolicyAssignmentInner; -import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentList; +import com.azure.resourcemanager.redisenterprise.implementation.models.AccessPolicyAssignmentList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,84 +68,78 @@ public final class AccessPolicyAssignmentsClientImpl implements AccessPolicyAssi * The interface defining all the services for RedisEnterpriseManagementClientAccessPolicyAssignments to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientAccessPolicyAssignments") public interface AccessPolicyAssignmentsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AccessPolicyAssignmentInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AccessPolicyAssignmentInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccessPolicyAssignmentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccessPolicyAssignmentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, - @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, - @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @@ -155,7 +148,7 @@ Mono> list(@HostParam("$host") String endpo @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @@ -165,7 +158,7 @@ Response listSync(@HostParam("$host") String endpoin @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -173,10 +166,97 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Gets information about access policy assignment for database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. + * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. + * @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 access policy assignment for database along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String clusterName, String databaseName, String accessPolicyAssignmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, + accessPolicyAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about access policy assignment for database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. + * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. + * @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 access policy assignment for database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, + String databaseName, String accessPolicyAssignmentName) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about access policy assignment for database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. + * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. + * @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 access policy assignment for database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, + String databaseName, String accessPolicyAssignmentName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, accept, context); + } + + /** + * Gets information about access policy assignment for database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. + * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. + * @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 access policy assignment for database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessPolicyAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, + String accessPolicyAssignmentName) { + return getWithResponse(resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, Context.NONE) + .getValue(); + } + /** * Creates/Updates a particular access policy assignment for a database. * @@ -195,38 +275,12 @@ Response listNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters) { - 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 (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 (accessPolicyAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter accessPolicyAssignmentName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), - parameters, accept, context)) + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, + accessPolicyAssignmentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -247,43 +301,11 @@ private Mono>> createUpdateWithResponseAsync(String re @ServiceMethod(returns = ReturnType.SINGLE) private Response createUpdateWithResponse(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), parameters, accept, - Context.NONE); + return service.createUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, + contentType, accept, parameters, Context.NONE); } /** @@ -305,43 +327,11 @@ private Response createUpdateWithResponse(String resourceGroupName, private Response createUpdateWithResponse(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, AccessPolicyAssignmentInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), parameters, accept, - context); + return service.createUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, + contentType, accept, parameters, context); } /** @@ -486,142 +476,6 @@ public AccessPolicyAssignmentInner createUpdate(String resourceGroupName, String context).getFinalResult(); } - /** - * Gets information about access policy assignment for database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. - * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @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 access policy assignment for database along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String clusterName, String databaseName, String accessPolicyAssignmentName) { - 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 (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 (accessPolicyAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about access policy assignment for database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. - * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @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 access policy assignment for database on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String clusterName, - String databaseName, String accessPolicyAssignmentName) { - return getWithResponseAsync(resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about access policy assignment for database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. - * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @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 access policy assignment for database along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String clusterName, - String databaseName, String accessPolicyAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets information about access policy assignment for database. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. - * @param accessPolicyAssignmentName The name of the Redis Enterprise database access policy assignment. - * @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 access policy assignment for database. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessPolicyAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, - String accessPolicyAssignmentName) { - return getWithResponse(resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, Context.NONE) - .getValue(); - } - /** * Deletes a single access policy assignment. * @@ -638,33 +492,10 @@ public AccessPolicyAssignmentInner get(String resourceGroupName, String clusterN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName) { - 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 (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 (accessPolicyAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, + accessPolicyAssignmentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -684,36 +515,9 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, + Context.NONE); } /** @@ -733,36 +537,9 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName, String accessPolicyAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter accessPolicyAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, databaseName, accessPolicyAssignmentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, + context); } /** @@ -902,24 +679,6 @@ public void delete(String resourceGroupName, String clusterName, String database @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String clusterName, String databaseName) { - 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 (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.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -963,28 +722,6 @@ private PagedFlux listAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String clusterName, String databaseName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -1009,28 +746,6 @@ private PagedResponse listSinglePage(String resourc @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String clusterName, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -1089,13 +804,6 @@ public PagedIterable list(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1114,15 +822,6 @@ private Mono> listNextSinglePageAsync */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1142,21 +841,10 @@ private PagedResponse listNextSinglePage(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(AccessPolicyAssignmentsClientImpl.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsImpl.java index 175841a1636e..9b6f380f3ef7 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName String databaseName, String accessPolicyAssignmentName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessPolicyAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessPolicyAssignmentImpl(inner.getValue(), this.manager())); } public AccessPolicyAssignment get(String resourceGroupName, String clusterName, String databaseName, 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 2d5f40b8da58..7e3ce99eb837 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; import com.azure.core.http.rest.Response; 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; @@ -14,6 +15,7 @@ import com.azure.resourcemanager.redisenterprise.models.ClusterUpdate; import com.azure.resourcemanager.redisenterprise.models.HighAvailability; import com.azure.resourcemanager.redisenterprise.models.Kind; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; @@ -79,6 +81,10 @@ public ManagedServiceIdentity identity() { return this.innerModel().identity(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public PublicNetworkAccess publicNetworkAccess() { return this.innerModel().publicNetworkAccess(); } @@ -95,6 +101,10 @@ public ClusterPropertiesEncryption encryption() { return this.innerModel().encryption(); } + public MaintenanceConfiguration maintenanceConfiguration() { + return this.innerModel().maintenanceConfiguration(); + } + public String hostname() { return this.innerModel().hostname(); } @@ -126,6 +136,10 @@ public List privateEndpointConnections() { } } + public String migratedEndpoint() { + return this.innerModel().migratedEndpoint(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -314,6 +328,16 @@ public ClusterImpl withEncryption(ClusterPropertiesEncryption encryption) { } } + public ClusterImpl withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + if (isInCreateMode()) { + this.innerModel().withMaintenanceConfiguration(maintenanceConfiguration); + return this; + } else { + this.updateParameters.withMaintenanceConfiguration(maintenanceConfiguration); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel() == null || 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 a8ce62043694..2151d9e4b9e2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -51,6 +51,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public AccessKeysAuthentication accessKeysAuthentication() { + return this.innerModel().accessKeysAuthentication(); + } + public Protocol clientProtocol() { return this.innerModel().clientProtocol(); } @@ -100,8 +104,8 @@ public DeferUpgradeSetting deferUpgrade() { return this.innerModel().deferUpgrade(); } - public AccessKeysAuthentication accessKeysAuthentication() { - return this.innerModel().accessKeysAuthentication(); + public String notifyKeyspaceEvents() { + return this.innerModel().notifyKeyspaceEvents(); } public String resourceGroupName() { @@ -261,6 +265,16 @@ public void upgradeDBRedisVersion(Context context) { serviceManager.databases().upgradeDBRedisVersion(resourceGroupName, clusterName, databaseName, context); } + public DatabaseImpl withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + if (isInCreateMode()) { + this.innerModel().withAccessKeysAuthentication(accessKeysAuthentication); + return this; + } else { + this.updateParameters.withAccessKeysAuthentication(accessKeysAuthentication); + return this; + } + } + public DatabaseImpl withClientProtocol(Protocol clientProtocol) { if (isInCreateMode()) { this.innerModel().withClientProtocol(clientProtocol); @@ -326,12 +340,12 @@ public DatabaseImpl withDeferUpgrade(DeferUpgradeSetting deferUpgrade) { } } - public DatabaseImpl withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + public DatabaseImpl withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { if (isInCreateMode()) { - this.innerModel().withAccessKeysAuthentication(accessKeysAuthentication); + this.innerModel().withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } else { - this.updateParameters.withAccessKeysAuthentication(accessKeysAuthentication); + this.updateParameters.withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } } 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 e44d49fb1991..8c0752098899 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -32,13 +32,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.AccessKeysInner; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; -import com.azure.resourcemanager.redisenterprise.models.DatabaseList; +import com.azure.resourcemanager.redisenterprise.implementation.models.DatabaseList; import com.azure.resourcemanager.redisenterprise.models.DatabaseUpdate; import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; import com.azure.resourcemanager.redisenterprise.models.FlushParameters; @@ -79,455 +78,351 @@ public final class DatabasesClientImpl implements DatabasesClient { * The interface defining all the services for RedisEnterpriseManagementClientDatabases to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientDatabases") public interface DatabasesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCluster(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByClusterSync(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") DatabaseInner parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseInner parameters, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") DatabaseInner parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseInner parameters, + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DatabaseUpdate parameters, @HeaderParam("Accept") String accept, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseUpdate parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DatabaseUpdate parameters, @HeaderParam("Accept") String accept, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DatabaseUpdate parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono> listByCluster(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response listByClusterSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listKeysSync(@HostParam("$host") String endpoint, + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> regenerateKey(@HostParam("$host") String endpoint, + Mono>> regenerateKey(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateKeyParameters parameters, @HeaderParam("Accept") String accept, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response regenerateKeySync(@HostParam("$host") String endpoint, + Response regenerateKeySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateKeyParameters parameters, @HeaderParam("Accept") String accept, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> importMethod(@HostParam("$host") String endpoint, + Mono>> importMethod(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImportClusterParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImportClusterParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response importMethodSync(@HostParam("$host") String endpoint, + Response importMethodSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImportClusterParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImportClusterParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> export(@HostParam("$host") String endpoint, + Mono>> export(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExportClusterParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ExportClusterParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response exportSync(@HostParam("$host") String endpoint, + Response exportSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExportClusterParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ExportClusterParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceUnlink") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> forceUnlink(@HostParam("$host") String endpoint, + Mono>> forceUnlink(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ForceUnlinkParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ForceUnlinkParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceUnlink") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response forceUnlinkSync(@HostParam("$host") String endpoint, + Response forceUnlinkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ForceUnlinkParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ForceUnlinkParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceLinkToReplicationGroup") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> forceLinkToReplicationGroup(@HostParam("$host") String endpoint, + Mono>> forceLinkToReplicationGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ForceLinkParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ForceLinkParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceLinkToReplicationGroup") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response forceLinkToReplicationGroupSync(@HostParam("$host") String endpoint, + Response forceLinkToReplicationGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ForceLinkParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ForceLinkParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> flush(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @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, + @PathParam("databaseName") String databaseName, @BodyParam("application/json") FlushParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/flush") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response flushSync(@HostParam("$host") String endpoint, + Response flushSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @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, + @PathParam("databaseName") String databaseName, @BodyParam("application/json") FlushParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/upgradeDBRedisVersion") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> upgradeDBRedisVersion(@HostParam("$host") String endpoint, + Mono>> upgradeDBRedisVersion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/upgradeDBRedisVersion") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response upgradeDBRedisVersionSync(@HostParam("$host") String endpoint, + Response upgradeDBRedisVersionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByClusterNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listByClusterNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster along with {@link PagedResponse} on successful + * @return information about a database in a Redis Enterprise cluster along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByClusterSinglePageAsync(String resourceGroupName, - String clusterName) { - 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 (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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + String databaseName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all databases in the specified Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePageAsync(nextLink)); - } - - /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster along with {@link PagedResponse}. + * @return information about a database in a Redis Enterprise cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getAsync(String resourceGroupName, String clusterName, String databaseName) { + return getWithResponseAsync(resourceGroupName, clusterName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster along with {@link PagedResponse}. + * @return information about a database in a Redis Enterprise cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName, + public Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets all databases in the specified Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), - nextLink -> listByClusterNextSinglePage(nextLink)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, databaseName, accept, context); } /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param context The context to associate with this operation. + * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + * @return information about a database in a Redis Enterprise cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), - nextLink -> listByClusterNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { + return getWithResponse(resourceGroupName, clusterName, databaseName, Context.NONE).getValue(); } /** @@ -547,34 +442,12 @@ public PagedIterable listByCluster(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -594,37 +467,11 @@ private Mono>> createWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, Context.NONE); } /** @@ -644,37 +491,11 @@ private Response createWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context); } /** @@ -819,34 +640,12 @@ public DatabaseInner create(String resourceGroupName, String clusterName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -866,37 +665,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, Context.NONE); } /** @@ -916,37 +689,11 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context); } /** @@ -1075,7 +822,7 @@ public DatabaseInner update(String resourceGroupName, String clusterName, String } /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed @@ -1084,39 +831,19 @@ public DatabaseInner update(String resourceGroupName, String clusterName, String * @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 Redis Enterprise cluster along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String databaseName) { - 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.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed @@ -1125,16 +852,16 @@ private Mono> getWithResponseAsync(String resourceGroupN * @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 Redis Enterprise cluster on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String clusterName, String databaseName) { - return getWithResponseAsync(resourceGroupName, clusterName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, Context.NONE); } /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed @@ -1144,40 +871,17 @@ private Mono getAsync(String resourceGroupName, String clusterNam * @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 Redis Enterprise cluster along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, + private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, context); } /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed @@ -1186,11 +890,14 @@ public Response getWithResponse(String resourceGroupName, String * @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 Redis Enterprise cluster. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { - return getWithResponse(resourceGroupName, clusterName, databaseName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String databaseName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, databaseName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** @@ -1203,34 +910,13 @@ public DatabaseInner get(String resourceGroupName, String clusterName, String da * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String databaseName) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response response = deleteWithResponse(resourceGroupName, clusterName, databaseName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1240,38 +926,17 @@ private Mono>> deleteWithResponseAsync(String resource * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 the response body along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String databaseName, Context context) { + Response response = deleteWithResponse(resourceGroupName, clusterName, databaseName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1281,40 +946,15 @@ private Response deleteWithResponse(String resourceGroupName, String * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 the response body along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String clusterName, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + private Mono deleteAsync(String resourceGroupName, String clusterName, String databaseName) { + return beginDeleteAsync(resourceGroupName, clusterName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1327,14 +967,10 @@ private Response deleteWithResponse(String resourceGroupName, String * @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> beginDeleteAsync(String resourceGroupName, String clusterName, - String databaseName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, databaseName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String databaseName) { + beginDelete(resourceGroupName, clusterName, databaseName).getFinalResult(); } /** @@ -1344,87 +980,132 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String databaseName) { - Response response = deleteWithResponse(resourceGroupName, clusterName, databaseName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String databaseName, Context context) { + beginDelete(resourceGroupName, clusterName, databaseName, context).getFinalResult(); } /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise 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 the {@link SyncPoller} for polling of long-running operation. + * @return all databases in the specified Redis Enterprise cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String databaseName, Context context) { - Response response = deleteWithResponse(resourceGroupName, clusterName, databaseName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String databaseName) { - return beginDeleteAsync(resourceGroupName, clusterName, databaseName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all databases in the specified Redis Enterprise cluster along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String databaseName) { - beginDelete(resourceGroupName, clusterName, databaseName).getFinalResult(); + private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String databaseName, Context context) { - beginDelete(resourceGroupName, clusterName, databaseName, context).getFinalResult(); + private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + Response res = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all databases in the specified Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); + } + + /** + * Gets all databases in the specified Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); } /** @@ -1437,33 +1118,16 @@ public void delete(String resourceGroupName, String clusterName, String database * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys along with {@link Response} on successful completion of {@link Mono}. + * @return the secret access keys used for authenticating connections to redis along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync(String resourceGroupName, String clusterName, String databaseName) { - 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.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1477,7 +1141,8 @@ private Mono> listKeysWithResponseAsync(String resourc * @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 on successful completion of {@link Mono}. + * @return the secret access keys used for authenticating connections to redis on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync(String resourceGroupName, String clusterName, String databaseName) { @@ -1496,36 +1161,14 @@ private Mono listKeysAsync(String resourceGroupName, String clu * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys along with {@link Response}. + * @return the secret access keys used for authenticating connections to redis along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listKeysSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, accept, context); } /** @@ -1538,7 +1181,7 @@ public Response listKeysWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys. + * @return the secret access keys used for authenticating connections to redis. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName) { @@ -1556,39 +1199,17 @@ public AccessKeysInner listKeys(String resourceGroupName, String clusterName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateKey(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context)) + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1603,42 +1224,16 @@ private Mono>> regenerateKeyWithResponseAsync(String r * @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 the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response regenerateKeyWithResponse(String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.regenerateKeySync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, Context.NONE); } /** @@ -1653,42 +1248,16 @@ private Response regenerateKeyWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response regenerateKeyWithResponse(String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.regenerateKeySync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, accept, + parameters, context); } /** @@ -1702,7 +1271,7 @@ private Response regenerateKeyWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of access keys. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccessKeysInner> beginRegenerateKeyAsync(String resourceGroupName, @@ -1724,7 +1293,7 @@ private PollerFlux, AccessKeysInner> beginRegenerate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of access keys. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey(String resourceGroupName, @@ -1747,7 +1316,7 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of access keys. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey(String resourceGroupName, @@ -1769,7 +1338,7 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return access keys on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync(String resourceGroupName, String clusterName, String databaseName, @@ -1789,7 +1358,7 @@ private Mono regenerateKeyAsync(String resourceGroupName, Strin * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey(String resourceGroupName, String clusterName, String databaseName, @@ -1809,7 +1378,7 @@ public AccessKeysInner regenerateKey(String resourceGroupName, String clusterNam * @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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey(String resourceGroupName, String clusterName, String databaseName, @@ -1833,34 +1402,11 @@ public AccessKeysInner regenerateKey(String resourceGroupName, String clusterNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importMethodWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters 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"; + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.importMethod(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.importMethod(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1880,37 +1426,10 @@ private Mono>> importMethodWithResponseAsync(String re @ServiceMethod(returns = ReturnType.SINGLE) private Response importMethodWithResponse(String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.importMethodSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + final String contentType = "application/json"; + return service.importMethodSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + Context.NONE); } /** @@ -1930,37 +1449,10 @@ private Response importMethodWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response importMethodWithResponse(String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.importMethodSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + final String contentType = "application/json"; + return service.importMethodSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context); } /** @@ -2101,34 +1593,11 @@ public void importMethod(String resourceGroupName, String clusterName, String da @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters 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"; + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.export(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.export(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2148,37 +1617,10 @@ private Mono>> exportWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response exportWithResponse(String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.exportSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + final String contentType = "application/json"; + return service.exportSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + Context.NONE); } /** @@ -2198,37 +1640,10 @@ private Response exportWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response exportWithResponse(String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.exportSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + final String contentType = "application/json"; + return service.exportSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context); } /** @@ -2368,34 +1783,11 @@ public void export(String resourceGroupName, String clusterName, String database @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> forceUnlinkWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext( - context -> service.forceUnlink(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.forceUnlink(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2415,37 +1807,10 @@ private Mono>> forceUnlinkWithResponseAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) private Response forceUnlinkWithResponse(String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.forceUnlinkSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + final String contentType = "application/json"; + return service.forceUnlinkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + Context.NONE); } /** @@ -2465,37 +1830,10 @@ private Response forceUnlinkWithResponse(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Response forceUnlinkWithResponse(String resourceGroupName, String clusterName, String databaseName, ForceUnlinkParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.forceUnlinkSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + final String contentType = "application/json"; + return service.forceUnlinkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context); } /** @@ -2638,34 +1976,11 @@ public void forceUnlink(String resourceGroupName, String clusterName, String dat @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> forceLinkToReplicationGroupWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, ForceLinkParameters 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"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.forceLinkToReplicationGroup(this.client.getEndpoint(), resourceGroupName, - clusterName, databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, - accept, context)) + .withContext(context -> service.forceLinkToReplicationGroup(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + databaseName, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2687,37 +2002,9 @@ private Mono>> forceLinkToReplicationGroupWithResponse @ServiceMethod(returns = ReturnType.SINGLE) private Response forceLinkToReplicationGroupWithResponse(String resourceGroupName, String clusterName, String databaseName, ForceLinkParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.forceLinkToReplicationGroupSync(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + final String contentType = "application/json"; + return service.forceLinkToReplicationGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, Context.NONE); } @@ -2740,37 +2027,10 @@ private Response forceLinkToReplicationGroupWithResponse(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Response forceLinkToReplicationGroupWithResponse(String resourceGroupName, String clusterName, String databaseName, ForceLinkParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return service.forceLinkToReplicationGroupSync(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + final String contentType = "application/json"; + return service.forceLinkToReplicationGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, contentType, parameters, + context); } /** @@ -2924,32 +2184,9 @@ public void forceLinkToReplicationGroup(String resourceGroupName, String cluster @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) { - 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)) + .withContext(context -> service.flush(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2969,34 +2206,8 @@ private Mono>> flushWithResponseAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) private Response flushWithResponse(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - return service.flushSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.flushSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, parameters, Context.NONE); } /** @@ -3016,34 +2227,8 @@ private Response flushWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response flushWithResponse(String resourceGroupName, String clusterName, String databaseName, FlushParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters != null) { - parameters.validate(); - } - final String accept = "application/json"; - return service.flushSync(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.flushSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, parameters, context); } /** @@ -3242,29 +2427,10 @@ public void flush(String resourceGroupName, String clusterName, String databaseN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> upgradeDBRedisVersionWithResponseAsync(String resourceGroupName, String clusterName, String databaseName) { - 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.")); - } - final String accept = "application/json"; return FluxUtil .withContext( - context -> service.upgradeDBRedisVersion(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + context -> service.upgradeDBRedisVersion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3283,31 +2449,8 @@ private Mono>> upgradeDBRedisVersionWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Response upgradeDBRedisVersionWithResponse(String resourceGroupName, String clusterName, String databaseName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.upgradeDBRedisVersionSync(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.upgradeDBRedisVersionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, Context.NONE); } /** @@ -3326,31 +2469,8 @@ private Response upgradeDBRedisVersionWithResponse(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Response upgradeDBRedisVersionWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (databaseName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.upgradeDBRedisVersionSync(this.client.getEndpoint(), resourceGroupName, clusterName, - databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.upgradeDBRedisVersionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, databaseName, context); } /** @@ -3478,13 +2598,6 @@ public void upgradeDBRedisVersion(String resourceGroupName, String clusterName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -3504,15 +2617,6 @@ private Mono> listByClusterNextSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByClusterNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -3532,21 +2636,10 @@ private PagedResponse listByClusterNextSinglePage(String nextLink */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(DatabasesClientImpl.class); } 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 0fb8b9f31b66..ef99e5d96e58 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -35,27 +35,12 @@ public DatabasesImpl(DatabasesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); - } - - public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - PagedIterable inner - = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, clusterName, databaseName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DatabaseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseImpl(inner.getValue(), this.manager())); } public Database get(String resourceGroupName, String clusterName, String databaseName) { @@ -75,16 +60,23 @@ public void delete(String resourceGroupName, String clusterName, String database this.serviceClient().delete(resourceGroupName, clusterName, databaseName, context); } + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner + = this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); + } + public Response listKeysWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context) { Response inner = this.serviceClient().listKeysWithResponse(resourceGroupName, clusterName, databaseName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } public AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationImpl.java new file mode 100644 index 000000000000..81a3bf98ef3e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.Migration; +import com.azure.resourcemanager.redisenterprise.models.MigrationProperties; + +public final class MigrationImpl implements Migration { + private MigrationInner innerObject; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + MigrationImpl(MigrationInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MigrationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MigrationInner 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/MigrationOperationsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsClientImpl.java new file mode 100644 index 000000000000..54212b1f6171 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsClientImpl.java @@ -0,0 +1,747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.core.annotation.BodyParam; +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.Post; +import com.azure.core.annotation.Put; +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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.implementation.models.MigrationList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MigrationOperationsClient. + */ +public final class MigrationOperationsClientImpl implements MigrationOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MigrationOperationsService service; + + /** + * The service client containing this operation class. + */ + private final RedisEnterpriseManagementClientImpl client; + + /** + * Initializes an instance of MigrationOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationOperationsClientImpl(RedisEnterpriseManagementClientImpl client) { + this.service = RestProxy.create(MigrationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisEnterpriseManagementClientMigrationOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedisEnterpriseManagementClientMigrationOperations") + public interface MigrationOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MigrationInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MigrationInner parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default/cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); + } + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationInner get(String resourceGroupName, String clusterName) { + return getWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String clusterName, + MigrationInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String clusterName, + MigrationInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + Context.NONE); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String clusterName, + MigrationInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationInner> beginStartAsync(String resourceGroupName, + String clusterName, MigrationInner parameters) { + Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MigrationInner.class, MigrationInner.class, this.client.getContext()); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationInner> beginStart(String resourceGroupName, + String clusterName, MigrationInner parameters) { + Response response = startWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, MigrationInner.class, + MigrationInner.class, Context.NONE); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 {@link SyncPoller} for polling of describes the current migration operation on a Redis Enterprise + * cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationInner> beginStart(String resourceGroupName, + String clusterName, MigrationInner parameters, Context context) { + Response response = startWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, MigrationInner.class, + MigrationInner.class, context); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String clusterName, MigrationInner parameters) { + return beginStartAsync(resourceGroupName, clusterName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationInner start(String resourceGroupName, String clusterName, MigrationInner parameters) { + return beginStart(resourceGroupName, clusterName, parameters).getFinalResult(); + } + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationInner start(String resourceGroupName, String clusterName, MigrationInner parameters, + Context context) { + return beginStart(resourceGroupName, clusterName, parameters, context).getFinalResult(); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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>> cancelWithResponseAsync(String resourceGroupName, String clusterName) { + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String resourceGroupName, String clusterName) { + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, Context.NONE); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelWithResponse(String resourceGroupName, String clusterName, Context context) { + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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> beginCancelAsync(String resourceGroupName, String clusterName) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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> beginCancel(String resourceGroupName, String clusterName) { + Response response = cancelWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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> beginCancel(String resourceGroupName, String clusterName, + Context context) { + Response response = cancelWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancelAsync(String resourceGroupName, String clusterName) { + return beginCancelAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName) { + beginCancel(resourceGroupName, clusterName).getFinalResult(); + } + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName, Context context) { + beginCancel(resourceGroupName, clusterName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all migrations attempts in a Redis Enterprise cluster along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsImpl.java new file mode 100644 index 000000000000..64a0e003c392 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.Migration; +import com.azure.resourcemanager.redisenterprise.models.MigrationOperations; + +public final class MigrationOperationsImpl implements MigrationOperations { + private static final ClientLogger LOGGER = new ClientLogger(MigrationOperationsImpl.class); + + private final MigrationOperationsClient innerClient; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + public MigrationOperationsImpl(MigrationOperationsClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String clusterName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, clusterName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MigrationImpl(inner.getValue(), this.manager())); + } + + public Migration get(String resourceGroupName, String clusterName) { + MigrationInner inner = this.serviceClient().get(resourceGroupName, clusterName); + if (inner != null) { + return new MigrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Migration start(String resourceGroupName, String clusterName, MigrationInner parameters) { + MigrationInner inner = this.serviceClient().start(resourceGroupName, clusterName, parameters); + if (inner != null) { + return new MigrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Migration start(String resourceGroupName, String clusterName, MigrationInner parameters, Context context) { + MigrationInner inner = this.serviceClient().start(resourceGroupName, clusterName, parameters, context); + if (inner != null) { + return new MigrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationImpl(inner1, this.manager())); + } + + public void cancel(String resourceGroupName, String clusterName) { + this.serviceClient().cancel(resourceGroupName, clusterName); + } + + public void cancel(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().cancel(resourceGroupName, clusterName, context); + } + + private MigrationOperationsClient 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/implementation/MigrationValidationResponseImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationValidationResponseImpl.java new file mode 100644 index 000000000000..d1f06cc5c34e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationValidationResponseImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationError; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationResponse; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationWarning; +import java.util.Collections; +import java.util.List; + +public final class MigrationValidationResponseImpl implements MigrationValidationResponse { + private MigrationValidationResponseInner innerObject; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + MigrationValidationResponseImpl(MigrationValidationResponseInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public boolean isValid() { + return this.innerModel().isValid(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List warnings() { + List inner = this.innerModel().warnings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MigrationValidationResponseInner 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/MigrationsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsClientImpl.java new file mode 100644 index 000000000000..da4cbfbcdfd4 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsClientImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +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.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.MigrationsClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MigrationsClient. + */ +public final class MigrationsClientImpl implements MigrationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MigrationsService service; + + /** + * The service client containing this operation class. + */ + private final RedisEnterpriseManagementClientImpl client; + + /** + * Initializes an instance of MigrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationsClientImpl(RedisEnterpriseManagementClientImpl client) { + this.service + = RestProxy.create(MigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisEnterpriseManagementClientMigrations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedisEnterpriseManagementClientMigrations") + public interface MigrationsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default/validate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MigrationValidationRequest body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default/validate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MigrationValidationRequest body, Context context); + } + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync(String resourceGroupName, + String clusterName, MigrationValidationRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync(String resourceGroupName, String clusterName, + MigrationValidationRequest body) { + return validateWithResponseAsync(resourceGroupName, clusterName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse(String resourceGroupName, String clusterName, + MigrationValidationRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationValidationResponseInner validate(String resourceGroupName, String clusterName, + MigrationValidationRequest body) { + return validateWithResponse(resourceGroupName, clusterName, body, Context.NONE).getValue(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsImpl.java new file mode 100644 index 000000000000..07d484669ca8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.MigrationsClient; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationResponse; +import com.azure.resourcemanager.redisenterprise.models.Migrations; + +public final class MigrationsImpl implements Migrations { + private static final ClientLogger LOGGER = new ClientLogger(MigrationsImpl.class); + + private final MigrationsClient innerClient; + + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; + + public MigrationsImpl(MigrationsClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response validateWithResponse(String resourceGroupName, String clusterName, + MigrationValidationRequest body, Context context) { + Response inner + = this.serviceClient().validateWithResponse(resourceGroupName, clusterName, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MigrationValidationResponseImpl(inner.getValue(), this.manager())); + } + + public MigrationValidationResponse validate(String resourceGroupName, String clusterName, + MigrationValidationRequest body) { + MigrationValidationResponseInner inner = this.serviceClient().validate(resourceGroupName, clusterName, body); + if (inner != null) { + return new MigrationValidationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private MigrationsClient 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/implementation/OperationImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java index 4215b23540a4..532e0a317394 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java index d837f905a090..872932057b89 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; 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 e700306c50ca..6af6049a764b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.OperationsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; -import com.azure.resourcemanager.redisenterprise.models.OperationListResult; +import com.azure.resourcemanager.redisenterprise.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -60,21 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for RedisEnterpriseManagementClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Cache/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Cache/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -82,14 +81,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -102,10 +101,6 @@ Response listNextSync(@PathParam(value = "nextLink", encode */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -137,11 +132,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); @@ -160,11 +150,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); @@ -212,13 +197,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -237,15 +215,6 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -265,20 +234,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java index 9cb9e05d9e00..3babc9cb5385 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; 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 18b742b00bbc..bd6bf374687f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -21,7 +21,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; import reactor.core.publisher.Mono; @@ -55,32 +54,32 @@ public final class OperationsStatusClientImpl implements OperationsStatusClient * The interface defining all the services for RedisEnterpriseManagementClientOperationsStatus to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientOperationsStatus") public interface OperationsStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("location") String location, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("location") String location, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. @@ -89,31 +88,17 @@ Response getSync(@HostParam("$host") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId 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.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, operationId, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), location, + this.client.getSubscriptionId(), operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. @@ -128,7 +113,7 @@ private Mono getAsync(String location, String operationId) /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. @@ -138,33 +123,15 @@ private Mono getAsync(String location, String operationId) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (operationId == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), location, operationId, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), location, + this.client.getSubscriptionId(), operationId, accept, context); } /** * Gets the status of operation. * - * @param location The name of Azure region. + * @param location The name of the 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. @@ -175,6 +142,4 @@ public Response getWithResponse(String location, String op public OperationStatusInner get(String location, String operationId) { return getWithResponse(location, operationId, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsStatusClientImpl.class); } 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 dfb047f0e3f0..d7264f85984a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -28,12 +28,8 @@ public OperationsStatusImpl(OperationsStatusClient innerClient, public Response getWithResponse(String location, String operationId, Context context) { Response inner = this.serviceClient().getWithResponse(location, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); } public OperationStatus get(String location, String operationId) { 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 603aeff69844..2174bbbe058d 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 @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { @@ -29,6 +32,19 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public PrivateEndpoint privateEndpoint() { return this.innerModel().privateEndpoint(); } 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 5ee1b2e2ff94..9b2fa9ebc1fa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.redisenterprise.implementation.models.PrivateEndpointConnectionListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,262 +68,100 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * The interface defining all the services for RedisEnterpriseManagementClientPrivateEndpointConnections to be used * by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> put(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono>> put(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response putSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Response putSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), 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())); - } - - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); - } - - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - null, null); - } - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 list of private endpoint connection associated with the specified storage account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String clusterName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - null, null); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String clusterName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String clusterName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -344,29 +181,10 @@ public PagedIterable list(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - 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 (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName 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.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, clusterName, - privateEndpointConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -410,32 +228,9 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, clusterName, privateEndpointConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, privateEndpointConnectionName, accept, context); } /** @@ -475,35 +270,12 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String clust @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putWithResponseAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, - accept, context)) + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, + contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -524,38 +296,11 @@ private Mono>> putWithResponseAsync(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) private Response putWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), privateEndpointConnectionName, properties, accept, Context.NONE); + return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, privateEndpointConnectionName, contentType, accept, properties, + Context.NONE); } /** @@ -576,38 +321,10 @@ private Response putWithResponse(String resourceGroupName, String cl @ServiceMethod(returns = ReturnType.SINGLE) private Response putWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), resourceGroupName, clusterName, this.client.getApiVersion(), - this.client.getSubscriptionId(), privateEndpointConnectionName, properties, accept, context); + return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, privateEndpointConnectionName, contentType, accept, properties, context); } /** @@ -763,30 +480,8 @@ public PrivateEndpointConnectionInner put(String resourceGroupName, String clust @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, - context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -806,32 +501,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE); } @@ -852,33 +523,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, - context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, privateEndpointConnectionName, context); } /** @@ -1001,5 +647,182 @@ public void delete(String resourceGroupName, String clusterName, String privateE beginDelete(resourceGroupName, clusterName, privateEndpointConnectionName, context).getFinalResult(); } - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } } 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 7f78bdf3b079..d8b38a28b63c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -27,28 +27,12 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String clusterName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String clusterName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, clusterName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } public PrivateEndpointConnection get(String resourceGroupName, String clusterName, @@ -71,6 +55,18 @@ public void delete(String resourceGroupName, String clusterName, String privateE this.serviceClient().delete(resourceGroupName, clusterName, privateEndpointConnectionName, context); } + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + public PrivateEndpointConnection getById(String id) { String resourceGroupName = ResourceManagerUtils.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 50c7942b345a..c3bcc950fd0a 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -32,6 +33,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 f45c7d374031..925853418028 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.redisenterprise.implementation.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** @@ -60,25 +59,41 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource * The interface defining all the services for RedisEnterpriseManagementClientPrivateLinkResources to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientPrivateLinkResources") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCluster(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono> listByCluster(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByClusterSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Response listByClusterSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByClusterNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -97,27 +112,12 @@ Response listByClusterSync(@HostParam("$host") St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByClusterSinglePageAsync(String resourceGroupName, String clusterName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCluster(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -135,7 +135,8 @@ private Mono> listByClusterSinglePageAsy */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName)); + return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); } /** @@ -153,30 +154,12 @@ private PagedFlux listByClusterAsync(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listByClusterSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - null, null); + res.getValue().nextLink(), null); } /** @@ -195,30 +178,12 @@ private PagedResponse listByClusterSinglePage(String r @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByClusterSinglePage(String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listByClusterSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + = service.listByClusterSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - null, null); + res.getValue().nextLink(), null); } /** @@ -235,7 +200,8 @@ private PagedResponse listByClusterSinglePage(String r */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName) { - return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePage(nextLink)); } /** @@ -254,8 +220,66 @@ public PagedIterable listByCluster(String resourceGrou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context)); + return new PagedIterable<>(() -> listByClusterSinglePage(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Redis Enterprise cluster along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesClientImpl.class); + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Redis Enterprise cluster along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 private link resources that need to be created for a Redis Enterprise cluster along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByClusterNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByClusterNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java index 9e219d1a9f8f..fcb27a8afea6 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; 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 e2b871b84a9a..97505d347102 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { RedisEnterpriseManagementClientImpl.class }) public final class RedisEnterpriseManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the RedisEnterpriseManagementClientBuilder. */ - public RedisEnterpriseManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public RedisEnterpriseManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the RedisEnterpriseManagementClientBuilder. */ - public RedisEnterpriseManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public RedisEnterpriseManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public RedisEnterpriseManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); RedisEnterpriseManagementClientImpl client = new RedisEnterpriseManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); 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 85b0c406dcc1..cf55942e53c9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -28,6 +28,8 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient; import com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient; +import com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient; +import com.azure.resourcemanager.redisenterprise.fluent.MigrationsClient; import com.azure.resourcemanager.redisenterprise.fluent.OperationsClient; import com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient; import com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient; @@ -49,26 +51,12 @@ @ServiceClient(builder = RedisEnterpriseManagementClientBuilder.class) public final class RedisEnterpriseManagementClientImpl implements RedisEnterpriseManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -77,12 +65,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -90,6 +78,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -147,17 +149,45 @@ public OperationsClient getOperations() { } /** - * The OperationsStatusClient object to access its operations. + * The DatabasesClient object to access its operations. */ - private final OperationsStatusClient operationsStatus; + private final DatabasesClient databases; /** - * Gets the OperationsStatusClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the OperationsStatusClient object. + * @return the DatabasesClient object. */ - public OperationsStatusClient getOperationsStatus() { - return this.operationsStatus; + public DatabasesClient getDatabases() { + return this.databases; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The MigrationsClient object to access its operations. + */ + private final MigrationsClient migrations; + + /** + * Gets the MigrationsClient object to access its operations. + * + * @return the MigrationsClient object. + */ + public MigrationsClient getMigrations() { + return this.migrations; } /** @@ -175,17 +205,17 @@ public RedisEnterprisesClient getRedisEnterprises() { } /** - * The DatabasesClient object to access its operations. + * The PrivateLinkResourcesClient object to access its operations. */ - private final DatabasesClient databases; + private final PrivateLinkResourcesClient privateLinkResources; /** - * Gets the DatabasesClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the DatabasesClient object. + * @return the PrivateLinkResourcesClient object. */ - public DatabasesClient getDatabases() { - return this.databases; + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; } /** @@ -203,31 +233,31 @@ public AccessPolicyAssignmentsClient getAccessPolicyAssignments() { } /** - * The PrivateEndpointConnectionsClient object to access its operations. + * The MigrationOperationsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; + private final MigrationOperationsClient migrationOperations; /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the MigrationOperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the MigrationOperationsClient object. */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; + public MigrationOperationsClient getMigrationOperations() { + return this.migrationOperations; } /** - * The PrivateLinkResourcesClient object to access its operations. + * The OperationsStatusClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; + private final OperationsStatusClient operationsStatus; /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the OperationsStatusClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the OperationsStatusClient object. */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; + public OperationsStatusClient getOperationsStatus() { + return this.operationsStatus; } /** @@ -237,24 +267,26 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ RedisEnterpriseManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2025-07-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-02-01-preview"; this.operations = new OperationsClientImpl(this); - this.operationsStatus = new OperationsStatusClientImpl(this); - this.redisEnterprises = new RedisEnterprisesClientImpl(this); this.databases = new DatabasesClientImpl(this); - this.accessPolicyAssignments = new AccessPolicyAssignmentsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.migrations = new MigrationsClientImpl(this); + this.redisEnterprises = new RedisEnterprisesClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.accessPolicyAssignments = new AccessPolicyAssignmentsClientImpl(this); + this.migrationOperations = new MigrationOperationsClientImpl(this); + this.operationsStatus = new OperationsStatusClientImpl(this); } /** 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 f9d37853e12d..ca8df3aaef10 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -32,13 +32,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import com.azure.resourcemanager.redisenterprise.fluent.models.SkuDetailsListInner; -import com.azure.resourcemanager.redisenterprise.models.ClusterList; +import com.azure.resourcemanager.redisenterprise.implementation.models.ClusterList; import com.azure.resourcemanager.redisenterprise.models.ClusterUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,106 +72,104 @@ public final class RedisEnterprisesClientImpl implements RedisEnterprisesClient * The interface defining all the services for RedisEnterpriseManagementClientRedisEnterprises to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "RedisEnterpriseManagementClientRedisEnterprises") public interface RedisEnterprisesService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterUpdate parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdate parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ClusterUpdate parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterUpdate parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redisEnterprise") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -180,7 +177,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redisEnterprise") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -188,18 +185,18 @@ Response listSync(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/listSkusForScaling") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkusForScaling(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Mono> listSkusForScaling(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/listSkusForScaling") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusForScalingSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Response listSkusForScalingSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -207,7 +204,7 @@ Response listSkusForScalingSync(@HostParam("$host") String @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -215,7 +212,7 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -223,14 +220,89 @@ Response listByResourceGroupNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + } + + /** + * Gets information about a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -249,30 +321,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, ClusterInner 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 (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 contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -291,33 +343,11 @@ private Mono>> createWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String clusterName, ClusterInner parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + Context.NONE); } /** @@ -336,33 +366,10 @@ private Response createWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context); } /** @@ -495,30 +502,10 @@ public ClusterInner create(String resourceGroupName, String clusterName, Cluster @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, ClusterUpdate 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 (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 contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -537,33 +524,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String clusterName, ClusterUpdate parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, + Context.NONE); } /** @@ -582,33 +547,10 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, parameters, context); } /** @@ -739,25 +681,9 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -774,27 +700,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, Context.NONE); } /** @@ -811,27 +718,8 @@ private Response deleteWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context); } /** @@ -935,114 +823,6 @@ public void delete(String resourceGroupName, String clusterName, Context context beginDelete(resourceGroupName, clusterName, context).getFinalResult(); } - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - clusterName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets information about a Redis Enterprise cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed - * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); - } - /** * Lists all Redis Enterprise clusters in a resource group. * @@ -1055,22 +835,10 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1102,23 +870,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1135,23 +889,9 @@ private PagedResponse listByResourceGroupSinglePage(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1197,14 +937,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - 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.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1235,16 +967,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -1263,16 +985,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -1321,25 +1033,10 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusForScalingWithResponseAsync(String resourceGroupName, String clusterName) { - 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSkusForScaling(this.client.getEndpoint(), resourceGroupName, - clusterName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listSkusForScaling(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1375,27 +1072,9 @@ private Mono listSkusForScalingAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response listSkusForScalingWithResponse(String resourceGroupName, String clusterName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSkusForScalingSync(this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.listSkusForScalingSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); } /** @@ -1426,13 +1105,6 @@ public SkuDetailsListInner listSkusForScaling(String resourceGroupName, String c */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -1453,15 +1125,6 @@ private Mono> listByResourceGroupNextSinglePageAsync */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1481,15 +1144,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -1509,13 +1163,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1534,15 +1181,6 @@ private Mono> listNextSinglePageAsync(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), @@ -1561,20 +1199,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RedisEnterprisesClientImpl.class); } 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 8a4c8407dc97..dee97f0cc47b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; @@ -29,24 +29,12 @@ public RedisEnterprisesImpl(RedisEnterprisesClient innerClient, this.serviceManager = serviceManager; } - public void deleteByResourceGroup(String resourceGroupName, String clusterName) { - this.serviceClient().delete(resourceGroupName, clusterName); - } - - public void delete(String resourceGroupName, String clusterName, Context context) { - this.serviceClient().delete(resourceGroupName, clusterName, context); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ClusterImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); } public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { @@ -58,6 +46,14 @@ public Cluster getByResourceGroup(String resourceGroupName, String clusterName) } } + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); @@ -82,12 +78,8 @@ public Response listSkusForScalingWithResponse(String resourceGr Context context) { Response inner = this.serviceClient().listSkusForScalingWithResponse(resourceGroupName, clusterName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SkuDetailsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SkuDetailsListImpl(inner.getValue(), this.manager())); } public SkuDetailsList listSkusForScaling(String resourceGroupName, String clusterName) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ResourceManagerUtils.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ResourceManagerUtils.java index a4737927eb6f..fd6147e35ba4 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ResourceManagerUtils.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkuDetailsListImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkuDetailsListImpl.java index 09e33212c99c..892d1929169a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkuDetailsListImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkuDetailsListImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.implementation; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentList.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/AccessPolicyAssignmentList.java similarity index 72% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentList.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/AccessPolicyAssignmentList.java index 506a4f289673..3e7bcd8c0ebe 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentList.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/AccessPolicyAssignmentList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of a list-all operation. */ -@Fluent +@Immutable public final class AccessPolicyAssignmentList implements JsonSerializable { /* - * List of access policy assignments. + * The AccessPolicyAssignment items on this page */ private List value; /* - * The URI to fetch the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AccessPolicyAssignmentList class. */ - public AccessPolicyAssignmentList() { + private AccessPolicyAssignmentList() { } /** - * Get the value property: List of access policy assignments. + * Get the value property: The AccessPolicyAssignment items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: List of access policy assignments. - * - * @param value the value value to set. - * @return the AccessPolicyAssignmentList object itself. - */ - public AccessPolicyAssignmentList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AccessPolicyAssignmentList if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AccessPolicyAssignmentList. */ public static AccessPolicyAssignmentList fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/ClusterList.java similarity index 72% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterList.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/ClusterList.java index eb66640ef90f..7a0c645a41b7 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/implementation/models/ClusterList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of a list-all operation. */ -@Fluent +@Immutable public final class ClusterList implements JsonSerializable { /* - * List of clusters. + * The Cluster items on this page */ private List value; /* - * The URI to fetch the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ClusterList class. */ - public ClusterList() { + private ClusterList() { } /** - * Get the value property: List of clusters. + * Get the value property: The Cluster items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: List of clusters. - * - * @param value the value value to set. - * @return the ClusterList object itself. - */ - public ClusterList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ClusterList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ClusterList. */ public static ClusterList fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/DatabaseList.java similarity index 72% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseList.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/DatabaseList.java index 46ee392bd226..ea2e1eff1052 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/implementation/models/DatabaseList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of a list-all operation. */ -@Fluent +@Immutable public final class DatabaseList implements JsonSerializable { /* - * List of databases + * The Database items on this page */ private List value; /* - * The URI to fetch the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DatabaseList class. */ - public DatabaseList() { + private DatabaseList() { } /** - * Get the value property: List of databases. + * Get the value property: The Database items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: List of databases. - * - * @param value the value value to set. - * @return the DatabaseList object itself. - */ - public DatabaseList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -81,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DatabaseList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the DatabaseList. */ public static DatabaseList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/MigrationList.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/MigrationList.java new file mode 100644 index 000000000000..14b1a4fcb2c2 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/MigrationList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a list-all migrations. + */ +@Immutable +public final class MigrationList implements JsonSerializable { + /* + * The Migration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MigrationList class. + */ + private MigrationList() { + } + + /** + * Get the value property: The Migration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationList. + */ + public static MigrationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationList deserializedMigrationList = new MigrationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MigrationInner.fromJson(reader1)); + deserializedMigrationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMigrationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationList; + }); + } +} 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/implementation/models/OperationListResult.java similarity index 78% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationListResult.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/OperationListResult.java index a75d2957a41a..8adb84478ed6 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/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -20,23 +20,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -53,23 +53,14 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/PrivateEndpointConnectionListResult.java similarity index 71% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionListResult.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/PrivateEndpointConnectionListResult.java index 4ab8dde59e85..84d7472e2a31 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/implementation/models/PrivateEndpointConnectionListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,24 +14,29 @@ import java.util.List; /** - * List of private endpoint connection associated with the specified storage account. + * The response of a PrivateEndpointConnection list operation. */ -@Fluent +@Immutable public final class PrivateEndpointConnectionListResult implements JsonSerializable { /* - * Array of private endpoint connections + * The PrivateEndpointConnection items on this page */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of PrivateEndpointConnectionListResult class. */ - public PrivateEndpointConnectionListResult() { + private PrivateEndpointConnectionListResult() { } /** - * Get the value property: Array of private endpoint connections. + * Get the value property: The PrivateEndpointConnection items on this page. * * @return the value value. */ @@ -40,25 +45,12 @@ public List value() { } /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. - */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } /** @@ -68,6 +60,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. */ public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { @@ -91,6 +85,8 @@ public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader List value = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } 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/implementation/models/PrivateLinkResourceListResult.java similarity index 77% rename from sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResourceListResult.java rename to sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/PrivateLinkResourceListResult.java index 42dc93923eec..aef7f62419cb 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/implementation/models/PrivateLinkResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.redisenterprise.models; +package com.azure.resourcemanager.redisenterprise.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * A list of private link resources. */ -@Fluent +@Immutable public final class PrivateLinkResourceListResult implements JsonSerializable { /* * Array of private link resources */ private List value; + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + /** * Creates an instance of PrivateLinkResourceListResult class. */ - public PrivateLinkResourceListResult() { + private PrivateLinkResourceListResult() { } /** @@ -39,25 +44,12 @@ public List value() { } /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. - */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. + * Get the nextLink property: URL to get the next set of operation list results (if there are any). * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } /** @@ -90,6 +82,8 @@ public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) thro List value = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/package-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/package-info.java index 2f6dee987cc9..492136666600 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/package-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for RedisEnterpriseManagementClient. + * Package containing the implementations for RedisEnterprise. * REST API for managing Redis Enterprise resources in Azure. */ package com.azure.resourcemanager.redisenterprise.implementation; 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 eb2e145b4f40..9a9c4d07d2fb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -9,12 +9,12 @@ */ public enum AccessKeyType { /** - * Enum value Primary. + * Primary. */ PRIMARY("Primary"), /** - * Enum value Secondary. + * Secondary. */ SECONDARY("Secondary"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeys.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeys.java index 4e45fcd3476a..786faa4af1ef 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeys.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeysAuthentication.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeysAuthentication.java index 15780c2bd30c..5cd87e97c474 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeysAuthentication.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeysAuthentication.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class AccessKeysAuthentication extends ExpandableStringEnum { /** - * Static value Disabled for AccessKeysAuthentication. + * Disabled. */ public static final AccessKeysAuthentication DISABLED = fromString("Disabled"); /** - * Static value Enabled for AccessKeysAuthentication. + * Enabled. */ public static final AccessKeysAuthentication ENABLED = fromString("Enabled"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignment.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignment.java index 95e943f0f63f..f5b8af045171 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignment.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignment.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.AccessPolicyAssignmentInner; @@ -32,6 +33,13 @@ public interface AccessPolicyAssignment { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the provisioningState property: Current provisioning status of the access policy assignment. * diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentPropertiesUser.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentPropertiesUser.java index c5de2e769439..a23f8149f57f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentPropertiesUser.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentPropertiesUser.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -48,14 +48,6 @@ public AccessPolicyAssignmentPropertiesUser withObjectId(String objectId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignments.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignments.java index 8efd50c3d1b6..a3d02037d80a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignments.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; 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 2556a71375ea..624aba657ba0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible 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. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); 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 95209778aacd..1389eedc6a72 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class AofFrequency extends ExpandableStringEnum { /** - * Static value 1s for AofFrequency. + * 1s. */ public static final AofFrequency ONES = fromString("1s"); /** - * Static value always for AofFrequency. + * always. */ public static final AofFrequency ALWAYS = fromString("always"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AzureCacheForRedisMigrationProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AzureCacheForRedisMigrationProperties.java new file mode 100644 index 000000000000..aa3e9dbeae02 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/AzureCacheForRedisMigrationProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties for Redis Enterprise migration operation for Azure Cache for Redis. + */ +@Fluent +public final class AzureCacheForRedisMigrationProperties extends MigrationProperties { + /* + * Describes the source of the migration operation. + */ + private SourceType sourceType = SourceType.AZURE_CACHE_FOR_REDIS; + + /* + * The source resource ID to migrate from. This is the resource ID of the Azure Cache for Redis. + */ + private String sourceResourceId; + + /* + * Sets whether the DNS is switched automatically after the data is transferred from the source cache to the target + * cache. This property must be true during the preview. + */ + private boolean switchDns; + + /* + * Sets whether the data is migrated from source to target or not. This property must be true during the preview. + */ + private boolean skipDataMigration; + + /* + * Sets whether to ignore warnings when performing validation of the migration request. If this property is true, + * warning-level disparities between the source and target resources will be ignored, and the request will only fail + * validation if there are error-level disparities. The default value is false. + */ + private Boolean forceMigrate; + + /** + * Creates an instance of AzureCacheForRedisMigrationProperties class. + */ + public AzureCacheForRedisMigrationProperties() { + } + + /** + * Get the sourceType property: Describes the source of the migration operation. + * + * @return the sourceType value. + */ + @Override + public SourceType sourceType() { + return this.sourceType; + } + + /** + * Get the sourceResourceId property: The source resource ID to migrate from. This is the resource ID of the Azure + * Cache for Redis. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: The source resource ID to migrate from. This is the resource ID of the Azure + * Cache for Redis. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureCacheForRedisMigrationProperties object itself. + */ + public AzureCacheForRedisMigrationProperties withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the switchDns property: Sets whether the DNS is switched automatically after the data is transferred from the + * source cache to the target cache. This property must be true during the preview. + * + * @return the switchDns value. + */ + public boolean switchDns() { + return this.switchDns; + } + + /** + * Set the switchDns property: Sets whether the DNS is switched automatically after the data is transferred from the + * source cache to the target cache. This property must be true during the preview. + * + * @param switchDns the switchDns value to set. + * @return the AzureCacheForRedisMigrationProperties object itself. + */ + public AzureCacheForRedisMigrationProperties withSwitchDns(boolean switchDns) { + this.switchDns = switchDns; + return this; + } + + /** + * Get the skipDataMigration property: Sets whether the data is migrated from source to target or not. This property + * must be true during the preview. + * + * @return the skipDataMigration value. + */ + public boolean skipDataMigration() { + return this.skipDataMigration; + } + + /** + * Set the skipDataMigration property: Sets whether the data is migrated from source to target or not. This property + * must be true during the preview. + * + * @param skipDataMigration the skipDataMigration value to set. + * @return the AzureCacheForRedisMigrationProperties object itself. + */ + public AzureCacheForRedisMigrationProperties withSkipDataMigration(boolean skipDataMigration) { + this.skipDataMigration = skipDataMigration; + return this; + } + + /** + * Get the forceMigrate property: Sets whether to ignore warnings when performing validation of the migration + * request. If this property is true, warning-level disparities between the source and target resources will be + * ignored, and the request will only fail validation if there are error-level disparities. The default value is + * false. + * + * @return the forceMigrate value. + */ + public Boolean forceMigrate() { + return this.forceMigrate; + } + + /** + * Set the forceMigrate property: Sets whether to ignore warnings when performing validation of the migration + * request. If this property is true, warning-level disparities between the source and target resources will be + * ignored, and the request will only fail validation if there are error-level disparities. The default value is + * false. + * + * @param forceMigrate the forceMigrate value to set. + * @return the AzureCacheForRedisMigrationProperties object itself. + */ + public AzureCacheForRedisMigrationProperties withForceMigrate(Boolean forceMigrate) { + this.forceMigrate = forceMigrate; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + jsonWriter.writeBooleanField("switchDns", this.switchDns); + jsonWriter.writeBooleanField("skipDataMigration", this.skipDataMigration); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + jsonWriter.writeBooleanField("forceMigrate", this.forceMigrate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureCacheForRedisMigrationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureCacheForRedisMigrationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureCacheForRedisMigrationProperties. + */ + public static AzureCacheForRedisMigrationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureCacheForRedisMigrationProperties deserializedAzureCacheForRedisMigrationProperties + = new AzureCacheForRedisMigrationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.withTargetResourceId(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties + .withProvisioningState(MigrationProvisioningState.fromString(reader.getString())); + } else if ("statusDetails".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.withStatusDetails(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.withCreationTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.withLastModifiedTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("sourceResourceId".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.sourceResourceId = reader.getString(); + } else if ("switchDns".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.switchDns = reader.getBoolean(); + } else if ("skipDataMigration".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.skipDataMigration = reader.getBoolean(); + } else if ("sourceType".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.sourceType + = SourceType.fromString(reader.getString()); + } else if ("forceMigrate".equals(fieldName)) { + deserializedAzureCacheForRedisMigrationProperties.forceMigrate + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureCacheForRedisMigrationProperties; + }); + } +} 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 4f975a6756d1..a9502c52710c 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.http.rest.Response; 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; @@ -65,19 +66,26 @@ public interface Cluster { Sku sku(); /** - * Gets the zones property: The Availability Zones where this cluster will be deployed. + * Gets the zones property: The availability zones. * * @return the zones value. */ List zones(); /** - * Gets the identity property: The identity of the resource. + * Gets the identity property: The managed service identities assigned to this 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 publicNetworkAccess property: Whether or not public network traffic can access the Redis cluster. Only * 'Enabled' or 'Disabled' can be set. null is returned only for clusters created using an old API version which do @@ -111,6 +119,13 @@ public interface Cluster { */ ClusterPropertiesEncryption encryption(); + /** + * Gets the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @return the maintenanceConfiguration value. + */ + MaintenanceConfiguration maintenanceConfiguration(); + /** * Gets the hostname property: DNS name of the cluster endpoint. * @@ -155,6 +170,14 @@ public interface Cluster { */ List privateEndpointConnections(); + /** + * Gets the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. + * + * @return the migratedEndpoint value. + */ + String migratedEndpoint(); + /** * Gets the region of the resource. * @@ -251,10 +274,10 @@ interface WithSku { * The stage of the Cluster definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithZones, DefinitionStages.WithIdentity, - DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithHighAvailability, - DefinitionStages.WithMinimumTlsVersion, DefinitionStages.WithEncryption { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithZones, + DefinitionStages.WithIdentity, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithHighAvailability, DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithEncryption, DefinitionStages.WithMaintenanceConfiguration { /** * Executes the create request. * @@ -289,9 +312,9 @@ interface WithTags { */ interface WithZones { /** - * Specifies the zones property: The Availability Zones where this cluster will be deployed.. + * Specifies the zones property: The availability zones.. * - * @param zones The Availability Zones where this cluster will be deployed. + * @param zones The availability zones. * @return the next definition stage. */ WithCreate withZones(List zones); @@ -302,9 +325,9 @@ interface WithZones { */ interface WithIdentity { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity The identity of the resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); @@ -371,6 +394,19 @@ interface WithEncryption { */ WithCreate withEncryption(ClusterPropertiesEncryption encryption); } + + /** + * The stage of the Cluster definition allowing to specify maintenanceConfiguration. + */ + interface WithMaintenanceConfiguration { + /** + * Specifies the maintenanceConfiguration property: Cluster-level maintenance configuration.. + * + * @param maintenanceConfiguration Cluster-level maintenance configuration. + * @return the next definition stage. + */ + WithCreate withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration); + } } /** @@ -385,7 +421,7 @@ interface WithEncryption { */ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithHighAvailability, UpdateStages.WithMinimumTlsVersion, - UpdateStages.WithEncryption { + UpdateStages.WithEncryption, UpdateStages.WithMaintenanceConfiguration { /** * Executes the update request. * @@ -437,9 +473,9 @@ interface WithSku { */ interface WithIdentity { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity The identity of the resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); @@ -506,6 +542,19 @@ interface WithEncryption { */ Update withEncryption(ClusterPropertiesEncryption encryption); } + + /** + * The stage of the Cluster update allowing to specify maintenanceConfiguration. + */ + interface WithMaintenanceConfiguration { + /** + * Specifies the maintenanceConfiguration property: Cluster-level maintenance configuration.. + * + * @param maintenanceConfiguration Cluster-level maintenance configuration. + * @return the next definition stage. + */ + Update withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration); + } } /** diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterCommonProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterCommonProperties.java index 5ed089bfee90..f982e0b66442 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterCommonProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterCommonProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -14,8 +14,6 @@ import java.util.List; /** - * Redis Enterprise cluster properties - * * Properties of Redis Enterprise clusters, as opposed to general resource properties like location, tags. */ @Fluent @@ -38,6 +36,11 @@ public class ClusterCommonProperties implements JsonSerializable privateEndpointConnections; + /* + * The endpoint of the source resource that is currently pointing to this resource as a result of an ACR/ACRE to AMR + * migration. + */ + private String migratedEndpoint; + /** * Creates an instance of ClusterCommonProperties class. */ @@ -140,6 +149,26 @@ public ClusterCommonProperties withEncryption(ClusterPropertiesEncryption encryp return this; } + /** + * Get the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @return the maintenanceConfiguration value. + */ + public MaintenanceConfiguration maintenanceConfiguration() { + return this.maintenanceConfiguration; + } + + /** + * Set the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @param maintenanceConfiguration the maintenanceConfiguration value to set. + * @return the ClusterCommonProperties object itself. + */ + public ClusterCommonProperties withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + this.maintenanceConfiguration = maintenanceConfiguration; + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -266,17 +295,25 @@ public List privateEndpointConnections() { } /** - * Validates the instance. + * Get the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. * - * @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()); - } + * @return the migratedEndpoint value. + */ + public String migratedEndpoint() { + return this.migratedEndpoint; + } + + /** + * Set the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. + * + * @param migratedEndpoint the migratedEndpoint value to set. + * @return the ClusterCommonProperties object itself. + */ + ClusterCommonProperties withMigratedEndpoint(String migratedEndpoint) { + this.migratedEndpoint = migratedEndpoint; + return this; } /** @@ -290,6 +327,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("minimumTlsVersion", this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("maintenanceConfiguration", this.maintenanceConfiguration); return jsonWriter.writeEndObject(); } @@ -315,6 +353,9 @@ public static ClusterCommonProperties fromJson(JsonReader jsonReader) throws IOE deserializedClusterCommonProperties.minimumTlsVersion = TlsVersion.fromString(reader.getString()); } else if ("encryption".equals(fieldName)) { deserializedClusterCommonProperties.encryption = ClusterPropertiesEncryption.fromJson(reader); + } else if ("maintenanceConfiguration".equals(fieldName)) { + deserializedClusterCommonProperties.maintenanceConfiguration + = MaintenanceConfiguration.fromJson(reader); } else if ("hostName".equals(fieldName)) { deserializedClusterCommonProperties.hostname = reader.getString(); } else if ("provisioningState".equals(fieldName)) { @@ -330,6 +371,8 @@ public static ClusterCommonProperties fromJson(JsonReader jsonReader) throws IOE List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedClusterCommonProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("migratedEndpoint".equals(fieldName)) { + deserializedClusterCommonProperties.migratedEndpoint = reader.getString(); } else { reader.skipChildren(); } 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 index 460701b23ae3..5fa9f3854330 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -51,17 +51,6 @@ public ClusterPropertiesEncryption withCustomerManagedKeyEncryption( return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customerManagedKeyEncryption() != null) { - customerManagedKeyEncryption().validate(); - } - } - /** * {@inheritDoc} */ 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 index 27a8305620d6..ac83e986cec7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -81,17 +81,6 @@ public ClusterPropertiesEncryptionCustomerManagedKeyEncryption withKeyEncryption return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyEncryptionKeyIdentity() != null) { - keyEncryptionKeyIdentity().validate(); - } - } - /** * {@inheritDoc} */ 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 index 96c8c95410f8..75857894e4f3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -83,14 +83,6 @@ public CmkIdentityType identityType() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 ecfd8f934bc5..60ff4af3000d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -31,7 +31,7 @@ public final class ClusterUpdate implements JsonSerializable { private ClusterUpdateProperties innerProperties; /* - * The identity of the resource. + * The managed service identities assigned to this resource. */ private ManagedServiceIdentity identity; @@ -76,7 +76,7 @@ private ClusterUpdateProperties innerProperties() { } /** - * Get the identity property: The identity of the resource. + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -85,7 +85,7 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: The identity of the resource. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the ClusterUpdate object itself. @@ -217,6 +217,29 @@ public ClusterUpdate withEncryption(ClusterPropertiesEncryption encryption) { return this; } + /** + * Get the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @return the maintenanceConfiguration value. + */ + public MaintenanceConfiguration maintenanceConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().maintenanceConfiguration(); + } + + /** + * Set the maintenanceConfiguration property: Cluster-level maintenance configuration. + * + * @param maintenanceConfiguration the maintenanceConfiguration value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withMaintenanceConfiguration(MaintenanceConfiguration maintenanceConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterUpdateProperties(); + } + this.innerProperties().withMaintenanceConfiguration(maintenanceConfiguration); + return this; + } + /** * Get the hostname property: DNS name of the cluster endpoint. * @@ -274,20 +297,13 @@ public List privateEndpointConnections() { } /** - * Validates the instance. + * Get the migratedEndpoint property: The endpoint of the source resource that is currently pointing to this + * resource as a result of an ACR/ACRE to AMR migration. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the migratedEndpoint value. */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } + public String migratedEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().migratedEndpoint(); } /** 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 8412fcd9eb8e..ee197e282ba8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,17 +13,18 @@ */ public final class ClusteringPolicy extends ExpandableStringEnum { /** - * Static value EnterpriseCluster for ClusteringPolicy. + * Enterprise clustering policy uses only the classic redis protocol, which does not support redis cluster commands. */ public static final ClusteringPolicy ENTERPRISE_CLUSTER = fromString("EnterpriseCluster"); /** - * Static value OSSCluster for ClusteringPolicy. + * OSS clustering policy follows the redis cluster specification, and requires all clients to support redis + * clustering. */ public static final ClusteringPolicy OSSCLUSTER = fromString("OSSCluster"); /** - * Static value NoCluster for ClusteringPolicy. + * The NoCluster policy is used for non-clustered Redis instances that do not require clustering features. */ public static final ClusteringPolicy NO_CLUSTER = fromString("NoCluster"); 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 index 8808308a12f2..a605c970288d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,12 +12,12 @@ */ public final class CmkIdentityType extends ExpandableStringEnum { /** - * Static value systemAssignedIdentity for CmkIdentityType. + * systemAssignedIdentity. */ public static final CmkIdentityType SYSTEM_ASSIGNED_IDENTITY = fromString("systemAssignedIdentity"); /** - * Static value userAssignedIdentity for CmkIdentityType. + * userAssignedIdentity. */ public static final CmkIdentityType USER_ASSIGNED_IDENTITY = fromString("userAssignedIdentity"); 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 36bba05bf950..b7348cff5747 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -42,6 +42,14 @@ public interface Database { */ SystemData systemData(); + /** + * Gets the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with + * the current access keys. Can be updated even after database is created. Default is Disabled. + * + * @return the accessKeysAuthentication value. + */ + AccessKeysAuthentication accessKeysAuthentication(); + /** * Gets the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. @@ -126,12 +134,14 @@ public interface Database { DeferUpgradeSetting deferUpgrade(); /** - * Gets the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with - * the current access keys. Can be updated even after database is created. + * Gets the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * - * @return the accessKeysAuthentication value. + * @return the notifyKeyspaceEvents value. */ - AccessKeysAuthentication accessKeysAuthentication(); + String notifyKeyspaceEvents(); /** * Gets the name of the resource group. @@ -183,10 +193,10 @@ interface WithParentResource { * The stage of the Database definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithClientProtocol, DefinitionStages.WithPort, - DefinitionStages.WithClusteringPolicy, DefinitionStages.WithEvictionPolicy, + interface WithCreate extends DefinitionStages.WithAccessKeysAuthentication, DefinitionStages.WithClientProtocol, + DefinitionStages.WithPort, DefinitionStages.WithClusteringPolicy, DefinitionStages.WithEvictionPolicy, DefinitionStages.WithPersistence, DefinitionStages.WithModules, DefinitionStages.WithGeoReplication, - DefinitionStages.WithDeferUpgrade, DefinitionStages.WithAccessKeysAuthentication { + DefinitionStages.WithDeferUpgrade, DefinitionStages.WithNotifyKeyspaceEvents { /** * Executes the create request. * @@ -203,6 +213,21 @@ interface WithCreate extends DefinitionStages.WithClientProtocol, DefinitionStag Database create(Context context); } + /** + * The stage of the Database definition allowing to specify accessKeysAuthentication. + */ + interface WithAccessKeysAuthentication { + /** + * Specifies the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny + * access with the current access keys. Can be updated even after database is created. Default is Disabled.. + * + * @param accessKeysAuthentication This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * @return the next definition stage. + */ + WithCreate withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication); + } + /** * The stage of the Database definition allowing to specify clientProtocol. */ @@ -320,18 +345,23 @@ interface WithDeferUpgrade { } /** - * The stage of the Database definition allowing to specify accessKeysAuthentication. + * The stage of the Database definition allowing to specify notifyKeyspaceEvents. */ - interface WithAccessKeysAuthentication { + interface WithNotifyKeyspaceEvents { /** - * Specifies the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny - * access with the current access keys. Can be updated even after database is created.. + * Specifies the notifyKeyspaceEvents property: Specifies which keyspace events should trigger + * notifications. Default is an empty string, meaning this feature is disabled. When enabled, at least 'K' + * (keyspace events) or 'E' (keyevent events) must be present. For example, 'AKE' enables all standard + * events. See https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of + * event types.. * - * @param accessKeysAuthentication This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * @param notifyKeyspaceEvents Specifies which keyspace events should trigger notifications. Default is an + * empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' + * (keyevent events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * @return the next definition stage. */ - WithCreate withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication); + WithCreate withNotifyKeyspaceEvents(String notifyKeyspaceEvents); } } @@ -345,9 +375,9 @@ interface WithAccessKeysAuthentication { /** * The template for Database update. */ - interface Update - extends UpdateStages.WithClientProtocol, UpdateStages.WithClusteringPolicy, UpdateStages.WithEvictionPolicy, - UpdateStages.WithPersistence, UpdateStages.WithDeferUpgrade, UpdateStages.WithAccessKeysAuthentication { + interface Update extends UpdateStages.WithAccessKeysAuthentication, UpdateStages.WithClientProtocol, + UpdateStages.WithClusteringPolicy, UpdateStages.WithEvictionPolicy, UpdateStages.WithPersistence, + UpdateStages.WithDeferUpgrade, UpdateStages.WithNotifyKeyspaceEvents { /** * Executes the update request. * @@ -368,6 +398,21 @@ interface Update * The Database update stages. */ interface UpdateStages { + /** + * The stage of the Database update allowing to specify accessKeysAuthentication. + */ + interface WithAccessKeysAuthentication { + /** + * Specifies the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny + * access with the current access keys. Can be updated even after database is created. Default is Disabled.. + * + * @param accessKeysAuthentication This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * @return the next definition stage. + */ + Update withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication); + } + /** * The stage of the Database update allowing to specify clientProtocol. */ @@ -442,18 +487,23 @@ interface WithDeferUpgrade { } /** - * The stage of the Database update allowing to specify accessKeysAuthentication. + * The stage of the Database update allowing to specify notifyKeyspaceEvents. */ - interface WithAccessKeysAuthentication { + interface WithNotifyKeyspaceEvents { /** - * Specifies the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny - * access with the current access keys. Can be updated even after database is created.. + * Specifies the notifyKeyspaceEvents property: Specifies which keyspace events should trigger + * notifications. Default is an empty string, meaning this feature is disabled. When enabled, at least 'K' + * (keyspace events) or 'E' (keyevent events) must be present. For example, 'AKE' enables all standard + * events. See https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of + * event types.. * - * @param accessKeysAuthentication This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * @param notifyKeyspaceEvents Specifies which keyspace events should trigger notifications. Default is an + * empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' + * (keyevent events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * @return the next definition stage. */ - Update withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication); + Update withNotifyKeyspaceEvents(String notifyKeyspaceEvents); } } @@ -479,7 +529,7 @@ interface WithAccessKeysAuthentication { * @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 the secret access keys used for authenticating connections to redis along with {@link Response}. */ Response listKeysWithResponse(Context context); @@ -488,7 +538,7 @@ interface WithAccessKeysAuthentication { * * @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 the secret access keys used for authenticating connections to redis. */ AccessKeys listKeys(); @@ -499,7 +549,7 @@ interface WithAccessKeysAuthentication { * @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 the response. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters); @@ -511,7 +561,7 @@ interface WithAccessKeysAuthentication { * @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 the response. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseCommonProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseCommonProperties.java index 6fc3357dc47a..9e9b0f0f28c5 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseCommonProperties.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseCommonProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,8 +13,6 @@ import java.util.List; /** - * Redis Enterprise database properties - * * Properties of Redis Enterprise databases, as opposed to general resource properties like location, tags. */ @Fluent @@ -83,6 +81,14 @@ public class DatabaseCommonProperties implements JsonSerializable e.validate()); - } - if (geoReplication() != null) { - geoReplication().validate(); - } + * @return the notifyKeyspaceEvents value. + */ + public String notifyKeyspaceEvents() { + return this.notifyKeyspaceEvents; + } + + /** + * Set the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. + * + * @param notifyKeyspaceEvents the notifyKeyspaceEvents value to set. + * @return the DatabaseCommonProperties object itself. + */ + public DatabaseCommonProperties withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { + this.notifyKeyspaceEvents = notifyKeyspaceEvents; + return this; } /** @@ -379,6 +394,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("deferUpgrade", this.deferUpgrade == null ? null : this.deferUpgrade.toString()); jsonWriter.writeStringField("accessKeysAuthentication", this.accessKeysAuthentication == null ? null : this.accessKeysAuthentication.toString()); + jsonWriter.writeStringField("notifyKeyspaceEvents", this.notifyKeyspaceEvents); return jsonWriter.writeEndObject(); } @@ -427,6 +443,8 @@ public static DatabaseCommonProperties fromJson(JsonReader jsonReader) throws IO } else if ("accessKeysAuthentication".equals(fieldName)) { deserializedDatabaseCommonProperties.accessKeysAuthentication = AccessKeysAuthentication.fromString(reader.getString()); + } else if ("notifyKeyspaceEvents".equals(fieldName)) { + deserializedDatabaseCommonProperties.notifyKeyspaceEvents = reader.getString(); } else { reader.skipChildren(); } 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 de3fb4ad135b..93915934466c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -73,17 +73,6 @@ public DatabasePropertiesGeoReplication withLinkedDatabases(List return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (linkedDatabases() != null) { - linkedDatabases().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 3884df924ce4..bff8093c3df4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -38,6 +38,31 @@ private DatabaseUpdateProperties innerProperties() { return this.innerProperties; } + /** + * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @return the accessKeysAuthentication value. + */ + public AccessKeysAuthentication accessKeysAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().accessKeysAuthentication(); + } + + /** + * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the + * current access keys. Can be updated even after database is created. Default is Disabled. + * + * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseUpdateProperties(); + } + this.innerProperties().withAccessKeysAuthentication(accessKeysAuthentication); + return this; + } + /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext * redis protocols. Default is TLS-encrypted. @@ -262,41 +287,34 @@ public DatabaseUpdate withDeferUpgrade(DeferUpgradeSetting deferUpgrade) { } /** - * Get the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * Get the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * - * @return the accessKeysAuthentication value. + * @return the notifyKeyspaceEvents value. */ - public AccessKeysAuthentication accessKeysAuthentication() { - return this.innerProperties() == null ? null : this.innerProperties().accessKeysAuthentication(); + public String notifyKeyspaceEvents() { + return this.innerProperties() == null ? null : this.innerProperties().notifyKeyspaceEvents(); } /** - * Set the accessKeysAuthentication property: This property can be Enabled/Disabled to allow or deny access with the - * current access keys. Can be updated even after database is created. + * Set the notifyKeyspaceEvents property: Specifies which keyspace events should trigger notifications. Default is + * an empty string, meaning this feature is disabled. When enabled, at least 'K' (keyspace events) or 'E' (keyevent + * events) must be present. For example, 'AKE' enables all standard events. See + * https://redis.io/docs/latest/develop/use/keyspace-notifications/ for the complete list of event types. * - * @param accessKeysAuthentication the accessKeysAuthentication value to set. + * @param notifyKeyspaceEvents the notifyKeyspaceEvents value to set. * @return the DatabaseUpdate object itself. */ - public DatabaseUpdate withAccessKeysAuthentication(AccessKeysAuthentication accessKeysAuthentication) { + public DatabaseUpdate withNotifyKeyspaceEvents(String notifyKeyspaceEvents) { if (this.innerProperties() == null) { this.innerProperties = new DatabaseUpdateProperties(); } - this.innerProperties().withAccessKeysAuthentication(accessKeysAuthentication); + this.innerProperties().withNotifyKeyspaceEvents(notifyKeyspaceEvents); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 2a1029db2da0..c97b2d39ac95 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,88 +13,88 @@ */ public interface Databases { /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + * @return information about a database in a Redis Enterprise cluster along with {@link Response}. */ - PagedIterable listByCluster(String resourceGroupName, String clusterName); + Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, + Context context); /** - * Gets all databases in the specified Redis Enterprise cluster. + * Gets information about a database in a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param context The context to associate with this operation. + * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. + * @return information about a database in a Redis Enterprise cluster. */ - PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + Database get(String resourceGroupName, String clusterName, String databaseName); /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 Redis Enterprise cluster along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String clusterName, String databaseName, - Context context); + void delete(String resourceGroupName, String clusterName, String databaseName); /** - * Gets information about a database in a Redis Enterprise cluster. + * Deletes a single database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @param databaseName The name of the Redis Enterprise 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 Redis Enterprise cluster. */ - Database get(String resourceGroupName, String clusterName, String databaseName); + void delete(String resourceGroupName, String clusterName, String databaseName, Context context); /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String clusterName, String databaseName); + PagedIterable listByCluster(String resourceGroupName, String clusterName); /** - * Deletes a single database. + * Gets all databases in the specified Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param databaseName The name of the Redis Enterprise 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 all databases in the specified Redis Enterprise cluster as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String clusterName, String databaseName, Context context); + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); /** * Retrieves the access keys for the Redis Enterprise database. @@ -107,7 +107,7 @@ Response getWithResponse(String resourceGroupName, String clusterName, * @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 the secret access keys used for authenticating connections to redis along with {@link Response}. */ Response listKeysWithResponse(String resourceGroupName, String clusterName, String databaseName, Context context); @@ -122,7 +122,7 @@ Response listKeysWithResponse(String resourceGroupName, String clust * @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 the secret access keys used for authenticating connections to redis. */ AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -137,7 +137,7 @@ Response listKeysWithResponse(String resourceGroupName, String clust * @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 the response. */ AccessKeys regenerateKey(String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters); @@ -154,7 +154,7 @@ AccessKeys regenerateKey(String resourceGroupName, String clusterName, String da * @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 the response. */ AccessKeys regenerateKey(String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters, Context context); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DeferUpgradeSetting.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DeferUpgradeSetting.java index 41aefe004133..96f70aebf6d1 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DeferUpgradeSetting.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DeferUpgradeSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class DeferUpgradeSetting extends ExpandableStringEnum { /** - * Static value Deferred for DeferUpgradeSetting. + * Deferred. */ public static final DeferUpgradeSetting DEFERRED = fromString("Deferred"); /** - * Static value NotDeferred for DeferUpgradeSetting. + * NotDeferred. */ public static final DeferUpgradeSetting NOT_DEFERRED = fromString("NotDeferred"); 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 037b58c0e145..ddb6bcab4a92 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,42 +12,42 @@ */ public final class EvictionPolicy extends ExpandableStringEnum { /** - * Static value AllKeysLFU for EvictionPolicy. + * AllKeysLFU. */ public static final EvictionPolicy ALL_KEYS_LFU = fromString("AllKeysLFU"); /** - * Static value AllKeysLRU for EvictionPolicy. + * AllKeysLRU. */ public static final EvictionPolicy ALL_KEYS_LRU = fromString("AllKeysLRU"); /** - * Static value AllKeysRandom for EvictionPolicy. + * AllKeysRandom. */ public static final EvictionPolicy ALL_KEYS_RANDOM = fromString("AllKeysRandom"); /** - * Static value VolatileLRU for EvictionPolicy. + * VolatileLRU. */ public static final EvictionPolicy VOLATILE_LRU = fromString("VolatileLRU"); /** - * Static value VolatileLFU for EvictionPolicy. + * VolatileLFU. */ public static final EvictionPolicy VOLATILE_LFU = fromString("VolatileLFU"); /** - * Static value VolatileTTL for EvictionPolicy. + * VolatileTTL. */ public static final EvictionPolicy VOLATILE_TTL = fromString("VolatileTTL"); /** - * Static value VolatileRandom for EvictionPolicy. + * VolatileRandom. */ public static final EvictionPolicy VOLATILE_RANDOM = fromString("VolatileRandom"); /** - * Static value NoEviction for EvictionPolicy. + * NoEviction. */ public static final EvictionPolicy NO_EVICTION = fromString("NoEviction"); 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 9c71aae0ca35..05f2f0c2ceb1 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,8 +12,6 @@ import java.io.IOException; /** - * Export an RDB file into a target database - * * Parameters for a Redis Enterprise export operation. */ @Fluent @@ -50,20 +47,6 @@ public ExportClusterParameters withSasUri(String sasUri) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sasUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property sasUri in model ExportClusterParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ExportClusterParameters.class); - /** * {@inheritDoc} */ 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 index 0f29017c93f4..07f09758bcd0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,8 +13,6 @@ 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 @@ -52,14 +50,6 @@ public FlushParameters withIds(List ids) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParameters.java index 7452890b623d..6db20ec9847c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParameters.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -49,23 +48,6 @@ public ForceLinkParameters withGeoReplication(ForceLinkParametersGeoReplication return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (geoReplication() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property geoReplication in model ForceLinkParameters")); - } else { - geoReplication().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForceLinkParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParametersGeoReplication.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParametersGeoReplication.java index 9d611ef50c1b..4b51a6c7d051 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParametersGeoReplication.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParametersGeoReplication.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -81,17 +81,6 @@ public ForceLinkParametersGeoReplication withLinkedDatabases(List e.validate()); - } - } - /** * {@inheritDoc} */ 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 a9adc1a3409d..3ee3b41404c8 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,8 +13,6 @@ import java.util.List; /** - * Forcibly unlink another database from this database. - * * Parameters for a Redis Enterprise Active Geo Replication Force Unlink operation. */ @Fluent @@ -51,20 +48,6 @@ public ForceUnlinkParameters withIds(List ids) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ids() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property ids in model ForceUnlinkParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ForceUnlinkParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/HighAvailability.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/HighAvailability.java index e99af3683e5c..b1db7aa41a61 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/HighAvailability.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/HighAvailability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class HighAvailability extends ExpandableStringEnum { /** - * Static value Enabled for HighAvailability. + * Enabled. */ public static final HighAvailability ENABLED = fromString("Enabled"); /** - * Static value Disabled for HighAvailability. + * Disabled. */ public static final HighAvailability DISABLED = fromString("Disabled"); 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 8abef4db384e..2e8b609a439e 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,8 +13,6 @@ import java.util.List; /** - * Import RDB files into a target database - * * Parameters for a Redis Enterprise import operation. */ @Fluent @@ -51,21 +48,6 @@ public ImportClusterParameters withSasUris(List sasUris) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sasUris() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property sasUris in model ImportClusterParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ImportClusterParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Kind.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Kind.java index e9358c3f059e..eb18125a3bc4 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Kind.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Kind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,12 +12,12 @@ */ public final class Kind extends ExpandableStringEnum { /** - * Static value v1 for Kind. + * v1. */ public static final Kind V1 = fromString("v1"); /** - * Static value v2 for Kind. + * v2. */ public static final Kind V2 = fromString("v2"); 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 91d536badc73..3ab090a621c6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,27 +12,27 @@ */ public final class LinkState extends ExpandableStringEnum { /** - * Static value Linked for LinkState. + * Linked. */ public static final LinkState LINKED = fromString("Linked"); /** - * Static value Linking for LinkState. + * Linking. */ public static final LinkState LINKING = fromString("Linking"); /** - * Static value Unlinking for LinkState. + * Unlinking. */ public static final LinkState UNLINKING = fromString("Unlinking"); /** - * Static value LinkFailed for LinkState. + * LinkFailed. */ public static final LinkState LINK_FAILED = fromString("LinkFailed"); /** - * Static value UnlinkFailed for LinkState. + * UnlinkFailed. */ public static final LinkState UNLINK_FAILED = fromString("UnlinkFailed"); 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 55d3a6f4076d..d94f29241d00 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,8 +12,6 @@ import java.io.IOException; /** - * Linked Database - * * Specifies details of a linked database resource. */ @Fluent @@ -63,14 +61,6 @@ public LinkState state() { return this.state; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceConfiguration.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceConfiguration.java new file mode 100644 index 000000000000..25b533a807c4 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Cluster-level maintenance configuration. + */ +@Fluent +public final class MaintenanceConfiguration implements JsonSerializable { + /* + * Custom maintenance windows that apply to the cluster. + */ + private List maintenanceWindows; + + /** + * Creates an instance of MaintenanceConfiguration class. + */ + public MaintenanceConfiguration() { + } + + /** + * Get the maintenanceWindows property: Custom maintenance windows that apply to the cluster. + * + * @return the maintenanceWindows value. + */ + public List maintenanceWindows() { + return this.maintenanceWindows; + } + + /** + * Set the maintenanceWindows property: Custom maintenance windows that apply to the cluster. + * + * @param maintenanceWindows the maintenanceWindows value to set. + * @return the MaintenanceConfiguration object itself. + */ + public MaintenanceConfiguration withMaintenanceWindows(List maintenanceWindows) { + this.maintenanceWindows = maintenanceWindows; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("maintenanceWindows", this.maintenanceWindows, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceConfiguration. + */ + public static MaintenanceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceConfiguration deserializedMaintenanceConfiguration = new MaintenanceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maintenanceWindows".equals(fieldName)) { + List maintenanceWindows + = reader.readArray(reader1 -> MaintenanceWindow.fromJson(reader1)); + deserializedMaintenanceConfiguration.maintenanceWindows = maintenanceWindows; + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceConfiguration; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceDayOfWeek.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceDayOfWeek.java new file mode 100644 index 000000000000..40c0bbf00872 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceDayOfWeek.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Day of week. Required when the maintenance window type is 'Weekly'. + */ +public final class MaintenanceDayOfWeek extends ExpandableStringEnum { + /** + * Static value Sunday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek SUNDAY = fromString("Sunday"); + + /** + * Static value Monday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek MONDAY = fromString("Monday"); + + /** + * Static value Tuesday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek TUESDAY = fromString("Tuesday"); + + /** + * Static value Wednesday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek WEDNESDAY = fromString("Wednesday"); + + /** + * Static value Thursday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek THURSDAY = fromString("Thursday"); + + /** + * Static value Friday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek FRIDAY = fromString("Friday"); + + /** + * Static value Saturday for MaintenanceDayOfWeek. + */ + public static final MaintenanceDayOfWeek SATURDAY = fromString("Saturday"); + + /** + * Creates a new instance of MaintenanceDayOfWeek value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaintenanceDayOfWeek() { + } + + /** + * Creates or finds a MaintenanceDayOfWeek from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaintenanceDayOfWeek. + */ + public static MaintenanceDayOfWeek fromString(String name) { + return fromString(name, MaintenanceDayOfWeek.class); + } + + /** + * Gets known MaintenanceDayOfWeek values. + * + * @return known MaintenanceDayOfWeek values. + */ + public static Collection values() { + return values(MaintenanceDayOfWeek.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindow.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindow.java new file mode 100644 index 000000000000..e142b1f955bf --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindow.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A single custom maintenance window. + */ +@Fluent +public final class MaintenanceWindow implements JsonSerializable { + /* + * Maintenance window type. + */ + private MaintenanceWindowType type; + + /* + * Duration in ISO-8601 format, for example 'PT5H'. + */ + private String duration; + + /* + * Start hour (0-23) in UTC when the maintenance window begins. + */ + private int startHourUtc; + + /* + * Recurring schedule for the maintenance window. + */ + private MaintenanceWindowSchedule schedule; + + /** + * Creates an instance of MaintenanceWindow class. + */ + public MaintenanceWindow() { + } + + /** + * Get the type property: Maintenance window type. + * + * @return the type value. + */ + public MaintenanceWindowType type() { + return this.type; + } + + /** + * Set the type property: Maintenance window type. + * + * @param type the type value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withType(MaintenanceWindowType type) { + this.type = type; + return this; + } + + /** + * Get the duration property: Duration in ISO-8601 format, for example 'PT5H'. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration in ISO-8601 format, for example 'PT5H'. + * + * @param duration the duration value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Get the startHourUtc property: Start hour (0-23) in UTC when the maintenance window begins. + * + * @return the startHourUtc value. + */ + public int startHourUtc() { + return this.startHourUtc; + } + + /** + * Set the startHourUtc property: Start hour (0-23) in UTC when the maintenance window begins. + * + * @param startHourUtc the startHourUtc value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withStartHourUtc(int startHourUtc) { + this.startHourUtc = startHourUtc; + return this; + } + + /** + * Get the schedule property: Recurring schedule for the maintenance window. + * + * @return the schedule value. + */ + public MaintenanceWindowSchedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Recurring schedule for the maintenance window. + * + * @param schedule the schedule value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withSchedule(MaintenanceWindowSchedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("duration", this.duration); + jsonWriter.writeIntField("startHourUtc", this.startHourUtc); + jsonWriter.writeJsonField("schedule", this.schedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindow if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaintenanceWindow. + */ + public static MaintenanceWindow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindow deserializedMaintenanceWindow = new MaintenanceWindow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedMaintenanceWindow.type = MaintenanceWindowType.fromString(reader.getString()); + } else if ("duration".equals(fieldName)) { + deserializedMaintenanceWindow.duration = reader.getString(); + } else if ("startHourUtc".equals(fieldName)) { + deserializedMaintenanceWindow.startHourUtc = reader.getInt(); + } else if ("schedule".equals(fieldName)) { + deserializedMaintenanceWindow.schedule = MaintenanceWindowSchedule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindow; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowSchedule.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowSchedule.java new file mode 100644 index 000000000000..ab8de684e1a3 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowSchedule.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schedule details for a maintenance window. + */ +@Fluent +public final class MaintenanceWindowSchedule implements JsonSerializable { + /* + * Day of week. Required when the maintenance window type is 'Weekly'. + */ + private MaintenanceDayOfWeek dayOfWeek; + + /** + * Creates an instance of MaintenanceWindowSchedule class. + */ + public MaintenanceWindowSchedule() { + } + + /** + * Get the dayOfWeek property: Day of week. Required when the maintenance window type is 'Weekly'. + * + * @return the dayOfWeek value. + */ + public MaintenanceDayOfWeek dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: Day of week. Required when the maintenance window type is 'Weekly'. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the MaintenanceWindowSchedule object itself. + */ + public MaintenanceWindowSchedule withDayOfWeek(MaintenanceDayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindowSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindowSchedule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceWindowSchedule. + */ + public static MaintenanceWindowSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindowSchedule deserializedMaintenanceWindowSchedule = new MaintenanceWindowSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dayOfWeek".equals(fieldName)) { + deserializedMaintenanceWindowSchedule.dayOfWeek + = MaintenanceDayOfWeek.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindowSchedule; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowType.java new file mode 100644 index 000000000000..8c92b4050415 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Maintenance window type. + */ +public final class MaintenanceWindowType extends ExpandableStringEnum { + /** + * Weekly maintenance window. + */ + public static final MaintenanceWindowType WEEKLY = fromString("Weekly"); + + /** + * Creates a new instance of MaintenanceWindowType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaintenanceWindowType() { + } + + /** + * Creates or finds a MaintenanceWindowType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaintenanceWindowType. + */ + public static MaintenanceWindowType fromString(String name) { + return fromString(name, MaintenanceWindowType.class); + } + + /** + * Gets known MaintenanceWindowType values. + * + * @return known MaintenanceWindowType values. + */ + public static Collection values() { + return values(MaintenanceWindowType.class); + } +} 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 index c6a028845fa3..6c8d5998d0b2 100644 --- 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 @@ -1,18 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Managed service identity (system assigned and/or user assigned identities). @@ -23,24 +21,21 @@ public final class ManagedServiceIdentity implements JsonSerializable userAssignedIdentities; @@ -56,7 +51,7 @@ public ManagedServiceIdentity() { * * @return the principalId value. */ - public UUID principalId() { + public String principalId() { return this.principalId; } @@ -66,13 +61,12 @@ public UUID principalId() { * * @return the tenantId value. */ - public UUID tenantId() { + public String tenantId() { return this.tenantId; } /** - * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Get the type property: The type of managed identity assigned to this resource. * * @return the type value. */ @@ -81,8 +75,7 @@ public ManagedServiceIdentityType type() { } /** - * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Set the type property: The type of managed identity assigned to this resource. * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. @@ -93,10 +86,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { } /** - * 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. + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. * * @return the userAssignedIdentities value. */ @@ -105,10 +95,7 @@ public Map 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. + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. @@ -118,27 +105,6 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); - /** * {@inheritDoc} */ @@ -170,11 +136,9 @@ public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOEx if ("type".equals(fieldName)) { deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("principalId".equals(fieldName)) { - deserializedManagedServiceIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedManagedServiceIdentity.tenantId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.tenantId = reader.getString(); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); 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 index 0288829281da..7dc773636ce4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,22 +12,22 @@ */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { /** - * Static value None for ManagedServiceIdentityType. + * No managed identity. */ public static final ManagedServiceIdentityType NONE = fromString("None"); /** - * Static value SystemAssigned for ManagedServiceIdentityType. + * System assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Static value UserAssigned for ManagedServiceIdentityType. + * User assigned managed identity. */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** - * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + * System and user assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migration.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migration.java new file mode 100644 index 000000000000..f5614e770a20 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; + +/** + * An immutable client-side representation of Migration. + */ +public interface Migration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the migration operation. + * + * @return the properties value. + */ + MigrationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner object. + * + * @return the inner object. + */ + MigrationInner innerModel(); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationOperations.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationOperations.java new file mode 100644 index 000000000000..9578e1900948 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationOperations.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; + +/** + * Resource collection API of MigrationOperations. + */ +public interface MigrationOperations { + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Gets information about a migration in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 migration in a Redis Enterprise cluster. + */ + Migration get(String resourceGroupName, String clusterName); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + Migration start(String resourceGroupName, String clusterName, MigrationInner parameters); + + /** + * Starts a new migration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param parameters Parameters supplied to start a migration 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 describes the current migration operation on a Redis Enterprise cluster. + */ + Migration start(String resourceGroupName, String clusterName, MigrationInner parameters, Context context); + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Gets information about all migrations attempts in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 all migrations attempts in a Redis Enterprise cluster as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName); + + /** + * Cancel or rollback the migration operation in a Redis Enterprise cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 cancel(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProperties.java new file mode 100644 index 000000000000..a29ea2a30000 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProperties.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties for Redis Enterprise migration operation. + */ +@Immutable +public class MigrationProperties implements JsonSerializable { + /* + * Describes the source of the migration operation. + */ + private SourceType sourceType = SourceType.fromString("MigrationProperties"); + + /* + * The Azure resource ID of the Azure Managed Redis destination cache to migrate. + */ + private String targetResourceId; + + /* + * Current provisioning status of the migration + */ + private MigrationProvisioningState provisioningState; + + /* + * Additional details about the migration operation's status in free text format. + */ + private String statusDetails; + + /* + * The timestamp when the migration operation was created. + */ + private OffsetDateTime creationTime; + + /* + * The timestamp when the migration operation was last updated. + */ + private OffsetDateTime lastModifiedTime; + + /** + * Creates an instance of MigrationProperties class. + */ + public MigrationProperties() { + } + + /** + * Get the sourceType property: Describes the source of the migration operation. + * + * @return the sourceType value. + */ + public SourceType sourceType() { + return this.sourceType; + } + + /** + * Get the targetResourceId property: The Azure resource ID of the Azure Managed Redis destination cache to migrate. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The Azure resource ID of the Azure Managed Redis destination cache to migrate. + * + * @param targetResourceId the targetResourceId value to set. + * @return the MigrationProperties object itself. + */ + MigrationProperties withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the provisioningState property: Current provisioning status of the migration. + * + * @return the provisioningState value. + */ + public MigrationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Current provisioning status of the migration. + * + * @param provisioningState the provisioningState value to set. + * @return the MigrationProperties object itself. + */ + MigrationProperties withProvisioningState(MigrationProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the statusDetails property: Additional details about the migration operation's status in free text format. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Set the statusDetails property: Additional details about the migration operation's status in free text format. + * + * @param statusDetails the statusDetails value to set. + * @return the MigrationProperties object itself. + */ + MigrationProperties withStatusDetails(String statusDetails) { + this.statusDetails = statusDetails; + return this; + } + + /** + * Get the creationTime property: The timestamp when the migration operation was created. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: The timestamp when the migration operation was created. + * + * @param creationTime the creationTime value to set. + * @return the MigrationProperties object itself. + */ + MigrationProperties withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the lastModifiedTime property: The timestamp when the migration operation was last updated. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set the lastModifiedTime property: The timestamp when the migration operation was last updated. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the MigrationProperties object itself. + */ + MigrationProperties withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationProperties. + */ + public static MigrationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("sourceType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureCacheForRedis".equals(discriminatorValue)) { + return AzureCacheForRedisMigrationProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MigrationProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationProperties deserializedMigrationProperties = new MigrationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceType".equals(fieldName)) { + deserializedMigrationProperties.sourceType = SourceType.fromString(reader.getString()); + } else if ("targetResourceId".equals(fieldName)) { + deserializedMigrationProperties.targetResourceId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedMigrationProperties.provisioningState + = MigrationProvisioningState.fromString(reader.getString()); + } else if ("statusDetails".equals(fieldName)) { + deserializedMigrationProperties.statusDetails = reader.getString(); + } else if ("creationTime".equals(fieldName)) { + deserializedMigrationProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedMigrationProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationProperties; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProvisioningState.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProvisioningState.java new file mode 100644 index 000000000000..2fac206cdbfe --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProvisioningState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current provisioning status. + */ +public final class MigrationProvisioningState extends ExpandableStringEnum { + /** + * The request has been accepted and the migration operation is being initialized. + */ + public static final MigrationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * The migration operation is in progress. + */ + public static final MigrationProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * The migration operation has completed transferring data and is ready for DNS switch. + */ + public static final MigrationProvisioningState READY_FOR_DNS_SWITCH = fromString("ReadyForDnsSwitch"); + + /** + * The migration operation has completed successfully. + */ + public static final MigrationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The migration operation has failed. + */ + public static final MigrationProvisioningState FAILED = fromString("Failed"); + + /** + * The migration operation is being cancelled. + */ + public static final MigrationProvisioningState CANCELLING = fromString("Cancelling"); + + /** + * The migration operation has been cancelled. + */ + public static final MigrationProvisioningState CANCELLED = fromString("Cancelled"); + + /** + * The migration operation cancellation has failed. + */ + public static final MigrationProvisioningState CANCELLATION_FAILED = fromString("CancellationFailed"); + + /** + * Creates a new instance of MigrationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationProvisioningState() { + } + + /** + * Creates or finds a MigrationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationProvisioningState. + */ + public static MigrationProvisioningState fromString(String name) { + return fromString(name, MigrationProvisioningState.class); + } + + /** + * Gets known MigrationProvisioningState values. + * + * @return known MigrationProvisioningState values. + */ + public static Collection values() { + return values(MigrationProvisioningState.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationDisparity.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationDisparity.java new file mode 100644 index 000000000000..52b40664829d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationDisparity.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a specific validation issue found during migration validation. + */ +@Immutable +public final class MigrationValidationDisparity implements JsonSerializable { + /* + * A localized string denoting the category of the validation issue. Examples are "Region", "Data", "Identity", + * "Clustering Mode", and "TLS". + */ + private String category; + + /* + * Detailed message describing the validation issue. + */ + private String message; + + /** + * Creates an instance of MigrationValidationDisparity class. + */ + private MigrationValidationDisparity() { + } + + /** + * Get the category property: A localized string denoting the category of the validation issue. Examples are + * "Region", "Data", "Identity", "Clustering Mode", and "TLS". + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the message property: Detailed message describing the validation issue. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationDisparity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationDisparity if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationValidationDisparity. + */ + public static MigrationValidationDisparity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationDisparity deserializedMigrationValidationDisparity = new MigrationValidationDisparity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedMigrationValidationDisparity.category = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMigrationValidationDisparity.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationDisparity; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationError.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationError.java new file mode 100644 index 000000000000..0f2427be22bc --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationError.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a validation error that prevents migration. + */ +@Immutable +public final class MigrationValidationError implements JsonSerializable { + /* + * List of specific disparities that cause this error. + */ + private List disparities; + + /** + * Creates an instance of MigrationValidationError class. + */ + private MigrationValidationError() { + } + + /** + * Get the disparities property: List of specific disparities that cause this error. + * + * @return the disparities value. + */ + public List disparities() { + return this.disparities; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("disparities", this.disparities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationError if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationValidationError. + */ + public static MigrationValidationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationError deserializedMigrationValidationError = new MigrationValidationError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disparities".equals(fieldName)) { + List disparities + = reader.readArray(reader1 -> MigrationValidationDisparity.fromJson(reader1)); + deserializedMigrationValidationError.disparities = disparities; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationError; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationRequest.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationRequest.java new file mode 100644 index 000000000000..676223ae31a7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationRequest.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties for validating migration from Azure Cache for Redis to Redis Enterprise. + */ +@Fluent +public final class MigrationValidationRequest implements JsonSerializable { + /* + * The source resource ID to validate migration from. This is the resource ID of the Azure Cache for Redis. + */ + private String sourceResourceId; + + /* + * Sets whether the data is migrated from source to target or not. The default value is true. + */ + private Boolean skipDataMigration; + + /* + * Sets whether to ignore warnings when validating if the source cache can be migrated to the target cache. If this + * property is true, the isValid property in the response will ignore warning-level disparities between the source + * and target resource. The default value is false. + */ + private Boolean forceMigrate; + + /** + * Creates an instance of MigrationValidationRequest class. + */ + public MigrationValidationRequest() { + } + + /** + * Get the sourceResourceId property: The source resource ID to validate migration from. This is the resource ID of + * the Azure Cache for Redis. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: The source resource ID to validate migration from. This is the resource ID of + * the Azure Cache for Redis. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the MigrationValidationRequest object itself. + */ + public MigrationValidationRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the skipDataMigration property: Sets whether the data is migrated from source to target or not. The default + * value is true. + * + * @return the skipDataMigration value. + */ + public Boolean skipDataMigration() { + return this.skipDataMigration; + } + + /** + * Set the skipDataMigration property: Sets whether the data is migrated from source to target or not. The default + * value is true. + * + * @param skipDataMigration the skipDataMigration value to set. + * @return the MigrationValidationRequest object itself. + */ + public MigrationValidationRequest withSkipDataMigration(Boolean skipDataMigration) { + this.skipDataMigration = skipDataMigration; + return this; + } + + /** + * Get the forceMigrate property: Sets whether to ignore warnings when validating if the source cache can be + * migrated to the target cache. If this property is true, the isValid property in the response will ignore + * warning-level disparities between the source and target resource. The default value is false. + * + * @return the forceMigrate value. + */ + public Boolean forceMigrate() { + return this.forceMigrate; + } + + /** + * Set the forceMigrate property: Sets whether to ignore warnings when validating if the source cache can be + * migrated to the target cache. If this property is true, the isValid property in the response will ignore + * warning-level disparities between the source and target resource. The default value is false. + * + * @param forceMigrate the forceMigrate value to set. + * @return the MigrationValidationRequest object itself. + */ + public MigrationValidationRequest withForceMigrate(Boolean forceMigrate) { + this.forceMigrate = forceMigrate; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); + jsonWriter.writeBooleanField("skipDataMigration", this.skipDataMigration); + jsonWriter.writeBooleanField("forceMigrate", this.forceMigrate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationValidationRequest. + */ + public static MigrationValidationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationRequest deserializedMigrationValidationRequest = new MigrationValidationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceResourceId".equals(fieldName)) { + deserializedMigrationValidationRequest.sourceResourceId = reader.getString(); + } else if ("skipDataMigration".equals(fieldName)) { + deserializedMigrationValidationRequest.skipDataMigration + = reader.getNullable(JsonReader::getBoolean); + } else if ("forceMigrate".equals(fieldName)) { + deserializedMigrationValidationRequest.forceMigrate = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationRequest; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationResponse.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationResponse.java new file mode 100644 index 000000000000..e2f8bfdd0c2c --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of MigrationValidationResponse. + */ +public interface MigrationValidationResponse { + /** + * Gets the isValid property: Indicates whether the migration validation passed. + * + * @return the isValid value. + */ + boolean isValid(); + + /** + * Gets the errors property: List of validation errors that prevent migration. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the warnings property: List of validation warnings that may impact migration. + * + * @return the warnings value. + */ + List warnings(); + + /** + * Gets the inner com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner object. + * + * @return the inner object. + */ + MigrationValidationResponseInner innerModel(); +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationWarning.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationWarning.java new file mode 100644 index 000000000000..5ca53323796d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationWarning.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a validation warning that may impact migration. + */ +@Immutable +public final class MigrationValidationWarning implements JsonSerializable { + /* + * List of specific disparities that cause this warning. + */ + private List disparities; + + /** + * Creates an instance of MigrationValidationWarning class. + */ + private MigrationValidationWarning() { + } + + /** + * Get the disparities property: List of specific disparities that cause this warning. + * + * @return the disparities value. + */ + public List disparities() { + return this.disparities; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("disparities", this.disparities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationWarning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationWarning if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationValidationWarning. + */ + public static MigrationValidationWarning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationWarning deserializedMigrationValidationWarning = new MigrationValidationWarning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disparities".equals(fieldName)) { + List disparities + = reader.readArray(reader1 -> MigrationValidationDisparity.fromJson(reader1)); + deserializedMigrationValidationWarning.disparities = disparities; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationWarning; + }); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migrations.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migrations.java new file mode 100644 index 000000000000..d431294d0236 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Migrations.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Migrations. + */ +public interface Migrations { + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation along with {@link Response}. + */ + Response validateWithResponse(String resourceGroupName, String clusterName, + MigrationValidationRequest body, Context context); + + /** + * Validates if a source Azure Cache for Redis resource can be migrated to a target Azure Managed Redis resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed + * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @param body Parameters supplied to validate a migration 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 response for migration validation operation. + */ + MigrationValidationResponse validate(String resourceGroupName, String clusterName, MigrationValidationRequest body); +} 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 a15e5dd2b213..9c7d31d985d2 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,8 +12,6 @@ import java.io.IOException; /** - * Module settings - * * Specifies configuration of a redis module. */ @Fluent @@ -89,19 +86,6 @@ public String version() { return this.version; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Module")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Module.class); - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operation.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operation.java index 1064946ab9f5..36fac7e79b2d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operation.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ 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 d3ce8c8e1dc7..a7eb61f787b3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for an operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); 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 e92cf3e43692..2834f19127e2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,8 +12,6 @@ import java.io.IOException; /** - * Persistence settings - * * Persistence-related configuration for the Redis Enterprise database. */ @Fluent @@ -131,14 +129,6 @@ public Persistence withRdbFrequency(RdbFrequency rdbFrequency) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 49117fa9a236..72a355e857ea 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,12 +12,12 @@ import java.io.IOException; /** - * The Private Endpoint resource. + * The private endpoint resource. */ @Immutable public final class PrivateEndpoint implements JsonSerializable { /* - * The ARM identifier for Private Endpoint + * The resource identifier of the private endpoint */ private String id; @@ -28,7 +28,7 @@ public PrivateEndpoint() { } /** - * Get the id property: The ARM identifier for Private Endpoint. + * Get the id property: The resource identifier of the private endpoint. * * @return the id value. */ @@ -36,14 +36,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 ee33840df7be..0190e62828e5 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 @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; +import java.util.List; /** * An immutable client-side representation of PrivateEndpointConnection. @@ -33,7 +35,21 @@ public interface PrivateEndpointConnection { String type(); /** - * Gets the privateEndpoint property: The resource of private end point. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. * * @return the privateEndpoint value. */ @@ -127,9 +143,9 @@ interface WithCreate */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. + * Specifies the privateEndpoint property: The private endpoint resource.. * - * @param privateEndpoint The resource of private end point. + * @param privateEndpoint The private endpoint resource. * @return the next definition stage. */ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); @@ -188,9 +204,9 @@ interface UpdateStages { */ interface WithPrivateEndpoint { /** - * Specifies the privateEndpoint property: The resource of private end point.. + * Specifies the privateEndpoint property: The private endpoint resource.. * - * @param privateEndpoint The resource of private end point. + * @param privateEndpoint The private endpoint resource. * @return the next definition stage. */ Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); 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 702914e56775..feb90c8ccb6b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,22 +13,22 @@ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + * Connection has been provisioned. */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Creating for PrivateEndpointConnectionProvisioningState. + * Connection is being created. */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. + * Connection is being deleted. */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. + * Connection provisioning has failed. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); 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 e2b84574f0d8..dd8a6f44b801 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,95 +13,95 @@ */ public interface PrivateEndpointConnections { /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * Gets the specified private endpoint connection associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return the specified private endpoint connection associated with the Redis Enterprise cluster along with + * {@link Response}. */ - PagedIterable list(String resourceGroupName, String clusterName); + Response getWithResponse(String resourceGroupName, String clusterName, + String privateEndpointConnectionName, Context context); /** - * Lists all the private endpoint connections associated with the Redis Enterprise cluster. + * Gets the specified private endpoint connection associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * @return the specified private endpoint connection associated with the Redis Enterprise cluster. */ - PagedIterable list(String resourceGroupName, String clusterName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String clusterName, String privateEndpointConnectionName); /** - * Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + * Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @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 Redis Enterprise cluster along with - * {@link Response}. */ - Response getWithResponse(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 Redis Enterprise cluster. + * Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. * @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 Redis Enterprise cluster. */ - PrivateEndpointConnection get(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); /** - * Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + PagedIterable list(String resourceGroupName, String clusterName); /** - * Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + * Lists all the private endpoint connections associated with the Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + PagedIterable list(String resourceGroupName, String clusterName, Context context); /** * Gets the specified private endpoint connection associated with the Redis Enterprise 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 949545fe4aa7..c13fd631bc9d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,17 +13,17 @@ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. + * Connection waiting for approval or rejection. */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. + * Connection approved. */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. + * Connection Rejected. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); 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 969720bb90a0..fd0f643fbefc 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import java.util.List; @@ -32,6 +33,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. * @@ -47,7 +55,7 @@ public interface PrivateLinkResource { List requiredMembers(); /** - * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. * * @return the requiredZoneNames value. */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java index e17dcf7c8251..ef1e600e2a47 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; 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 efd682ba77d1..ef290b20e752 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -101,14 +101,6 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 d4cbbd52d0ed..9f5740b91989 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class Protocol extends ExpandableStringEnum { /** - * Static value Encrypted for Protocol. + * Encrypted. */ public static final Protocol ENCRYPTED = fromString("Encrypted"); /** - * Static value Plaintext for Protocol. + * Plaintext. */ public static final Protocol PLAINTEXT = fromString("Plaintext"); 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 9273157b1671..56f8423ff942 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,32 +12,32 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ProvisioningState. + * Succeeded. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ProvisioningState. + * Failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Creating for ProvisioningState. + * Creating. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value Updating for ProvisioningState. + * Updating. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for ProvisioningState. + * Deleting. */ public static final ProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PublicNetworkAccess.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PublicNetworkAccess.java index 35a86929a53c..90d204797de3 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PublicNetworkAccess.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/PublicNetworkAccess.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,12 +13,12 @@ */ public final class PublicNetworkAccess extends ExpandableStringEnum { /** - * Static value Enabled for PublicNetworkAccess. + * Enabled. */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); /** - * Static value Disabled for PublicNetworkAccess. + * Disabled. */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); 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 0a68daecf10a..2f309bf4ffc9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,17 +12,17 @@ */ public final class RdbFrequency extends ExpandableStringEnum { /** - * Static value 1h for RdbFrequency. + * 1h. */ public static final RdbFrequency ONEH = fromString("1h"); /** - * Static value 6h for RdbFrequency. + * 6h. */ public static final RdbFrequency SIXH = fromString("6h"); /** - * Static value 12h for RdbFrequency. + * 12h. */ public static final RdbFrequency ONE_TWOH = fromString("12h"); 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 efcd70cdc09e..64ee724a196a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -13,56 +13,56 @@ */ public interface RedisEnterprises { /** - * Deletes a Redis Enterprise cache cluster. + * Gets information about a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster along with {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); /** - * Deletes a Redis Enterprise cache cluster. + * Gets information about a Redis Enterprise cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster. */ - void delete(String resourceGroupName, String clusterName, Context context); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** - * Gets information about a Redis Enterprise cluster. + * Deletes a Redis Enterprise cache cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. - * @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 Redis Enterprise cluster along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + void deleteByResourceGroup(String resourceGroupName, String clusterName); /** - * Gets information about a Redis Enterprise cluster. + * Deletes a Redis Enterprise cache cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed * characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + * @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 Redis Enterprise cluster. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + void delete(String resourceGroupName, String clusterName, Context context); /** * Lists all Redis Enterprise clusters in a resource group. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedundancyMode.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedundancyMode.java index 055692603d27..0dd7d776b5b6 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedundancyMode.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RedundancyMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,17 +12,17 @@ */ public final class RedundancyMode extends ExpandableStringEnum { /** - * Static value None for RedundancyMode. + * No redundancy. Availability loss will occur. */ public static final RedundancyMode NONE = fromString("None"); /** - * Static value LR for RedundancyMode. + * Local redundancy with high availability. */ public static final RedundancyMode LR = fromString("LR"); /** - * Static value ZR for RedundancyMode. + * Zone redundant. Higher availability. */ public static final RedundancyMode ZR = fromString("ZR"); 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 8fa339c986e8..a5ae1e753657 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,8 +12,6 @@ import java.io.IOException; /** - * Regenerate access keys request - * * Specifies which access keys to reset to a new random value. */ @Fluent @@ -50,21 +47,6 @@ public RegenerateKeyParameters withKeyType(AccessKeyType keyType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyType() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property keyType in model RegenerateKeyParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegenerateKeyParameters.class); - /** * {@inheritDoc} */ 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 224669048cd6..9b198b6745f9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,77 +12,77 @@ */ public final class ResourceState extends ExpandableStringEnum { /** - * Static value Running for ResourceState. + * Running. */ public static final ResourceState RUNNING = fromString("Running"); /** - * Static value Creating for ResourceState. + * Creating. */ public static final ResourceState CREATING = fromString("Creating"); /** - * Static value CreateFailed for ResourceState. + * CreateFailed. */ public static final ResourceState CREATE_FAILED = fromString("CreateFailed"); /** - * Static value Updating for ResourceState. + * Updating. */ public static final ResourceState UPDATING = fromString("Updating"); /** - * Static value UpdateFailed for ResourceState. + * UpdateFailed. */ public static final ResourceState UPDATE_FAILED = fromString("UpdateFailed"); /** - * Static value Deleting for ResourceState. + * Deleting. */ public static final ResourceState DELETING = fromString("Deleting"); /** - * Static value DeleteFailed for ResourceState. + * DeleteFailed. */ public static final ResourceState DELETE_FAILED = fromString("DeleteFailed"); /** - * Static value Enabling for ResourceState. + * Enabling. */ public static final ResourceState ENABLING = fromString("Enabling"); /** - * Static value EnableFailed for ResourceState. + * EnableFailed. */ public static final ResourceState ENABLE_FAILED = fromString("EnableFailed"); /** - * Static value Disabling for ResourceState. + * Disabling. */ public static final ResourceState DISABLING = fromString("Disabling"); /** - * Static value DisableFailed for ResourceState. + * DisableFailed. */ public static final ResourceState DISABLE_FAILED = fromString("DisableFailed"); /** - * Static value Disabled for ResourceState. + * Disabled. */ public static final ResourceState DISABLED = fromString("Disabled"); /** - * Static value Scaling for ResourceState. + * Scaling. */ public static final ResourceState SCALING = fromString("Scaling"); /** - * Static value ScalingFailed for ResourceState. + * ScalingFailed. */ public static final ResourceState SCALING_FAILED = fromString("ScalingFailed"); /** - * Static value Moving for ResourceState. + * Moving. */ public static final ResourceState MOVING = fromString("Moving"); 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 8e8add570d70..bb4adc575129 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -84,19 +83,6 @@ public Sku withCapacity(Integer capacity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetails.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetails.java index ddd37c2259a6..2d3418022de8 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetails.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -12,8 +12,6 @@ import java.io.IOException; /** - * SKU details - * * Details of a Redis Enterprise cluster SKU. */ @Immutable @@ -31,7 +29,7 @@ public final class SkuDetails implements JsonSerializable { /** * Creates an instance of SkuDetails class. */ - public SkuDetails() { + private SkuDetails() { } /** @@ -52,14 +50,6 @@ public Float sizeInGB() { return this.sizeInGB; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetailsList.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetailsList.java index 59bc3a8ae603..02f414801ff2 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetailsList.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetailsList.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; 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 9031d6245c8c..5e31e5dd2dfe 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -14,277 +14,277 @@ */ public final class SkuName extends ExpandableStringEnum { /** - * Static value Enterprise_E1 for SkuName. + * Enterprise_E1. */ public static final SkuName ENTERPRISE_E1 = fromString("Enterprise_E1"); /** - * Static value Enterprise_E5 for SkuName. + * Enterprise_E5. */ public static final SkuName ENTERPRISE_E5 = fromString("Enterprise_E5"); /** - * Static value Enterprise_E10 for SkuName. + * Enterprise_E10. */ public static final SkuName ENTERPRISE_E10 = fromString("Enterprise_E10"); /** - * Static value Enterprise_E20 for SkuName. + * Enterprise_E20. */ public static final SkuName ENTERPRISE_E20 = fromString("Enterprise_E20"); /** - * Static value Enterprise_E50 for SkuName. + * Enterprise_E50. */ public static final SkuName ENTERPRISE_E50 = fromString("Enterprise_E50"); /** - * Static value Enterprise_E100 for SkuName. + * Enterprise_E100. */ public static final SkuName ENTERPRISE_E100 = fromString("Enterprise_E100"); /** - * Static value Enterprise_E200 for SkuName. + * Enterprise_E200. */ public static final SkuName ENTERPRISE_E200 = fromString("Enterprise_E200"); /** - * Static value Enterprise_E400 for SkuName. + * Enterprise_E400. */ public static final SkuName ENTERPRISE_E400 = fromString("Enterprise_E400"); /** - * Static value EnterpriseFlash_F300 for SkuName. + * EnterpriseFlash_F300. */ public static final SkuName ENTERPRISE_FLASH_F300 = fromString("EnterpriseFlash_F300"); /** - * Static value EnterpriseFlash_F700 for SkuName. + * EnterpriseFlash_F700. */ public static final SkuName ENTERPRISE_FLASH_F700 = fromString("EnterpriseFlash_F700"); /** - * Static value EnterpriseFlash_F1500 for SkuName. + * EnterpriseFlash_F1500. */ public static final SkuName ENTERPRISE_FLASH_F1500 = fromString("EnterpriseFlash_F1500"); /** - * Static value Balanced_B0 for SkuName. + * Balanced_B0. */ public static final SkuName BALANCED_B0 = fromString("Balanced_B0"); /** - * Static value Balanced_B1 for SkuName. + * Balanced_B1. */ public static final SkuName BALANCED_B1 = fromString("Balanced_B1"); /** - * Static value Balanced_B3 for SkuName. + * Balanced_B3. */ public static final SkuName BALANCED_B3 = fromString("Balanced_B3"); /** - * Static value Balanced_B5 for SkuName. + * Balanced_B5. */ public static final SkuName BALANCED_B5 = fromString("Balanced_B5"); /** - * Static value Balanced_B10 for SkuName. + * Balanced_B10. */ public static final SkuName BALANCED_B10 = fromString("Balanced_B10"); /** - * Static value Balanced_B20 for SkuName. + * Balanced_B20. */ public static final SkuName BALANCED_B20 = fromString("Balanced_B20"); /** - * Static value Balanced_B50 for SkuName. + * Balanced_B50. */ public static final SkuName BALANCED_B50 = fromString("Balanced_B50"); /** - * Static value Balanced_B100 for SkuName. + * Balanced_B100. */ public static final SkuName BALANCED_B100 = fromString("Balanced_B100"); /** - * Static value Balanced_B150 for SkuName. + * Balanced_B150. */ public static final SkuName BALANCED_B150 = fromString("Balanced_B150"); /** - * Static value Balanced_B250 for SkuName. + * Balanced_B250. */ public static final SkuName BALANCED_B250 = fromString("Balanced_B250"); /** - * Static value Balanced_B350 for SkuName. + * Balanced_B350. */ public static final SkuName BALANCED_B350 = fromString("Balanced_B350"); /** - * Static value Balanced_B500 for SkuName. + * Balanced_B500. */ public static final SkuName BALANCED_B500 = fromString("Balanced_B500"); /** - * Static value Balanced_B700 for SkuName. + * Balanced_B700. */ public static final SkuName BALANCED_B700 = fromString("Balanced_B700"); /** - * Static value Balanced_B1000 for SkuName. + * Balanced_B1000. */ public static final SkuName BALANCED_B1000 = fromString("Balanced_B1000"); /** - * Static value MemoryOptimized_M10 for SkuName. + * MemoryOptimized_M10. */ public static final SkuName MEMORY_OPTIMIZED_M10 = fromString("MemoryOptimized_M10"); /** - * Static value MemoryOptimized_M20 for SkuName. + * MemoryOptimized_M20. */ public static final SkuName MEMORY_OPTIMIZED_M20 = fromString("MemoryOptimized_M20"); /** - * Static value MemoryOptimized_M50 for SkuName. + * MemoryOptimized_M50. */ public static final SkuName MEMORY_OPTIMIZED_M50 = fromString("MemoryOptimized_M50"); /** - * Static value MemoryOptimized_M100 for SkuName. + * MemoryOptimized_M100. */ public static final SkuName MEMORY_OPTIMIZED_M100 = fromString("MemoryOptimized_M100"); /** - * Static value MemoryOptimized_M150 for SkuName. + * MemoryOptimized_M150. */ public static final SkuName MEMORY_OPTIMIZED_M150 = fromString("MemoryOptimized_M150"); /** - * Static value MemoryOptimized_M250 for SkuName. + * MemoryOptimized_M250. */ public static final SkuName MEMORY_OPTIMIZED_M250 = fromString("MemoryOptimized_M250"); /** - * Static value MemoryOptimized_M350 for SkuName. + * MemoryOptimized_M350. */ public static final SkuName MEMORY_OPTIMIZED_M350 = fromString("MemoryOptimized_M350"); /** - * Static value MemoryOptimized_M500 for SkuName. + * MemoryOptimized_M500. */ public static final SkuName MEMORY_OPTIMIZED_M500 = fromString("MemoryOptimized_M500"); /** - * Static value MemoryOptimized_M700 for SkuName. + * MemoryOptimized_M700. */ public static final SkuName MEMORY_OPTIMIZED_M700 = fromString("MemoryOptimized_M700"); /** - * Static value MemoryOptimized_M1000 for SkuName. + * MemoryOptimized_M1000. */ public static final SkuName MEMORY_OPTIMIZED_M1000 = fromString("MemoryOptimized_M1000"); /** - * Static value MemoryOptimized_M1500 for SkuName. + * MemoryOptimized_M1500. */ public static final SkuName MEMORY_OPTIMIZED_M1500 = fromString("MemoryOptimized_M1500"); /** - * Static value MemoryOptimized_M2000 for SkuName. + * MemoryOptimized_M2000. */ public static final SkuName MEMORY_OPTIMIZED_M2000 = fromString("MemoryOptimized_M2000"); /** - * Static value ComputeOptimized_X3 for SkuName. + * ComputeOptimized_X3. */ public static final SkuName COMPUTE_OPTIMIZED_X3 = fromString("ComputeOptimized_X3"); /** - * Static value ComputeOptimized_X5 for SkuName. + * ComputeOptimized_X5. */ public static final SkuName COMPUTE_OPTIMIZED_X5 = fromString("ComputeOptimized_X5"); /** - * Static value ComputeOptimized_X10 for SkuName. + * ComputeOptimized_X10. */ public static final SkuName COMPUTE_OPTIMIZED_X10 = fromString("ComputeOptimized_X10"); /** - * Static value ComputeOptimized_X20 for SkuName. + * ComputeOptimized_X20. */ public static final SkuName COMPUTE_OPTIMIZED_X20 = fromString("ComputeOptimized_X20"); /** - * Static value ComputeOptimized_X50 for SkuName. + * ComputeOptimized_X50. */ public static final SkuName COMPUTE_OPTIMIZED_X50 = fromString("ComputeOptimized_X50"); /** - * Static value ComputeOptimized_X100 for SkuName. + * ComputeOptimized_X100. */ public static final SkuName COMPUTE_OPTIMIZED_X100 = fromString("ComputeOptimized_X100"); /** - * Static value ComputeOptimized_X150 for SkuName. + * ComputeOptimized_X150. */ public static final SkuName COMPUTE_OPTIMIZED_X150 = fromString("ComputeOptimized_X150"); /** - * Static value ComputeOptimized_X250 for SkuName. + * ComputeOptimized_X250. */ public static final SkuName COMPUTE_OPTIMIZED_X250 = fromString("ComputeOptimized_X250"); /** - * Static value ComputeOptimized_X350 for SkuName. + * ComputeOptimized_X350. */ public static final SkuName COMPUTE_OPTIMIZED_X350 = fromString("ComputeOptimized_X350"); /** - * Static value ComputeOptimized_X500 for SkuName. + * ComputeOptimized_X500. */ public static final SkuName COMPUTE_OPTIMIZED_X500 = fromString("ComputeOptimized_X500"); /** - * Static value ComputeOptimized_X700 for SkuName. + * ComputeOptimized_X700. */ public static final SkuName COMPUTE_OPTIMIZED_X700 = fromString("ComputeOptimized_X700"); /** - * Static value FlashOptimized_A250 for SkuName. + * FlashOptimized_A250. */ public static final SkuName FLASH_OPTIMIZED_A250 = fromString("FlashOptimized_A250"); /** - * Static value FlashOptimized_A500 for SkuName. + * FlashOptimized_A500. */ public static final SkuName FLASH_OPTIMIZED_A500 = fromString("FlashOptimized_A500"); /** - * Static value FlashOptimized_A700 for SkuName. + * FlashOptimized_A700. */ public static final SkuName FLASH_OPTIMIZED_A700 = fromString("FlashOptimized_A700"); /** - * Static value FlashOptimized_A1000 for SkuName. + * FlashOptimized_A1000. */ public static final SkuName FLASH_OPTIMIZED_A1000 = fromString("FlashOptimized_A1000"); /** - * Static value FlashOptimized_A1500 for SkuName. + * FlashOptimized_A1500. */ public static final SkuName FLASH_OPTIMIZED_A1500 = fromString("FlashOptimized_A1500"); /** - * Static value FlashOptimized_A2000 for SkuName. + * FlashOptimized_A2000. */ public static final SkuName FLASH_OPTIMIZED_A2000 = fromString("FlashOptimized_A2000"); /** - * Static value FlashOptimized_A4500 for SkuName. + * FlashOptimized_A4500. */ public static final SkuName FLASH_OPTIMIZED_A4500 = fromString("FlashOptimized_A4500"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SourceType.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SourceType.java new file mode 100644 index 000000000000..15a038aa5f6f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/SourceType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the source of the migration operation. + */ +public final class SourceType extends ExpandableStringEnum { + /** + * Migration from Azure Cache for Redis to Redis Enterprise. + */ + public static final SourceType AZURE_CACHE_FOR_REDIS = fromString("AzureCacheForRedis"); + + /** + * Creates a new instance of SourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceType() { + } + + /** + * Creates or finds a SourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceType. + */ + public static SourceType fromString(String name) { + return fromString(name, SourceType.class); + } + + /** + * Gets known SourceType values. + * + * @return known SourceType values. + */ + public static Collection values() { + return values(SourceType.class); + } +} 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 95da92f977e4..eabda8b61790 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -14,17 +14,17 @@ */ public final class TlsVersion extends ExpandableStringEnum { /** - * Static value 1.0 for TlsVersion. + * 1.0. */ public static final TlsVersion ONE_ZERO = fromString("1.0"); /** - * Static value 1.1 for TlsVersion. + * 1.1. */ public static final TlsVersion ONE_ONE = fromString("1.1"); /** - * Static value 1.2 for TlsVersion. + * 1.2. */ public static final TlsVersion ONE_TWO = fromString("1.2"); 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 index 93d46fb14016..f17809633cb4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.models; @@ -10,7 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.UUID; /** * User assigned identity properties. @@ -20,12 +19,12 @@ public final class UserAssignedIdentity implements JsonSerializable UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.principalId = reader.getString(); } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.clientId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/package-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/package-info.java index 041660f977ea..0ce53cf10e5a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/package-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for RedisEnterpriseManagementClient. + * Package containing the data models for RedisEnterprise. * REST API for managing Redis Enterprise resources in Azure. */ package com.azure.resourcemanager.redisenterprise.models; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/package-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/package-info.java index 3ebf99a5ba10..5ac3a33bd109 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/package-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for RedisEnterpriseManagementClient. + * Package containing the classes for RedisEnterprise. * REST API for managing Redis Enterprise resources in Azure. */ package com.azure.resourcemanager.redisenterprise; diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/module-info.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/module-info.java index 06db125217da..1a33df1cf9c5 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/module-info.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.redisenterprise { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.redisenterprise.fluent.models to com.azure.core; opens com.azure.resourcemanager.redisenterprise.models to com.azure.core; + opens com.azure.resourcemanager.redisenterprise.implementation.models to com.azure.core; } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/azure-resourcemanager-redisenterprise_metadata.json b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/azure-resourcemanager-redisenterprise_metadata.json new file mode 100644 index 000000000000..08a059d94042 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/azure-resourcemanager-redisenterprise_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Cache":"2026-02-01-preview"},"crossLanguagePackageId":"Microsoft.Cache","crossLanguageVersion":"1bb3dc85f99e","crossLanguageDefinitions":{"com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.beginCreateUpdate":"Microsoft.Cache.AccessPolicyAssignments.createUpdate","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.beginDelete":"Microsoft.Cache.AccessPolicyAssignments.delete","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.createUpdate":"Microsoft.Cache.AccessPolicyAssignments.createUpdate","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.delete":"Microsoft.Cache.AccessPolicyAssignments.delete","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.get":"Microsoft.Cache.AccessPolicyAssignments.get","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.getWithResponse":"Microsoft.Cache.AccessPolicyAssignments.get","com.azure.resourcemanager.redisenterprise.fluent.AccessPolicyAssignmentsClient.list":"Microsoft.Cache.AccessPolicyAssignments.list","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient":"Microsoft.Cache.Databases","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginCreate":"Microsoft.Cache.Databases.create","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginDelete":"Microsoft.Cache.Databases.delete","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginExport":"Microsoft.Cache.Databases.export","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginFlush":"Microsoft.Cache.Databases.flush","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginForceLinkToReplicationGroup":"Microsoft.Cache.Databases.forceLinkToReplicationGroup","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginForceUnlink":"Microsoft.Cache.Databases.forceUnlink","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginImportMethod":"Microsoft.Cache.Databases.import","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginRegenerateKey":"Microsoft.Cache.Databases.regenerateKey","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginUpdate":"Microsoft.Cache.Databases.update","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.beginUpgradeDBRedisVersion":"Microsoft.Cache.Databases.upgradeDBRedisVersion","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.create":"Microsoft.Cache.Databases.create","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.delete":"Microsoft.Cache.Databases.delete","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.export":"Microsoft.Cache.Databases.export","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.flush":"Microsoft.Cache.Databases.flush","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.forceLinkToReplicationGroup":"Microsoft.Cache.Databases.forceLinkToReplicationGroup","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.forceUnlink":"Microsoft.Cache.Databases.forceUnlink","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.get":"Microsoft.Cache.Databases.get","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.getWithResponse":"Microsoft.Cache.Databases.get","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.importMethod":"Microsoft.Cache.Databases.import","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.listByCluster":"Microsoft.Cache.Databases.listByCluster","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.listKeys":"Microsoft.Cache.Databases.listKeys","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.listKeysWithResponse":"Microsoft.Cache.Databases.listKeys","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.regenerateKey":"Microsoft.Cache.Databases.regenerateKey","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.update":"Microsoft.Cache.Databases.update","com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient.upgradeDBRedisVersion":"Microsoft.Cache.Databases.upgradeDBRedisVersion","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.beginCancel":"Microsoft.Cache.Migrations.cancel","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.beginStart":"Microsoft.Cache.Migrations.start","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.cancel":"Microsoft.Cache.Migrations.cancel","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.get":"Microsoft.Cache.Migrations.get","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.getWithResponse":"Microsoft.Cache.Migrations.get","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.list":"Microsoft.Cache.Migrations.list","com.azure.resourcemanager.redisenterprise.fluent.MigrationOperationsClient.start":"Microsoft.Cache.Migrations.start","com.azure.resourcemanager.redisenterprise.fluent.MigrationsClient":"Microsoft.Cache.Migrations","com.azure.resourcemanager.redisenterprise.fluent.MigrationsClient.validate":"Microsoft.Cache.Migrations.validate","com.azure.resourcemanager.redisenterprise.fluent.MigrationsClient.validateWithResponse":"Microsoft.Cache.Migrations.validate","com.azure.resourcemanager.redisenterprise.fluent.OperationsClient":"Microsoft.Cache.Operations","com.azure.resourcemanager.redisenterprise.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient.get":"Microsoft.Cache.OperationsStatusOperationGroup.get","com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient.getWithResponse":"Microsoft.Cache.OperationsStatusOperationGroup.get","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient":"Microsoft.Cache.PrivateEndpointConnections","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.Cache.PrivateEndpointConnections.delete","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.beginPut":"Microsoft.Cache.PrivateEndpointConnections.put","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.Cache.PrivateEndpointConnections.delete","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.Cache.PrivateEndpointConnections.get","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.Cache.PrivateEndpointConnections.get","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.list":"Microsoft.Cache.PrivateEndpointConnections.list","com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient.put":"Microsoft.Cache.PrivateEndpointConnections.put","com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient.listByCluster":"Microsoft.Cache.Clusters.listByCluster","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterpriseManagementClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.beginCreate":"Microsoft.Cache.Clusters.create","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.beginDelete":"Microsoft.Cache.Clusters.delete","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.beginUpdate":"Microsoft.Cache.Clusters.update","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.create":"Microsoft.Cache.Clusters.create","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.delete":"Microsoft.Cache.Clusters.delete","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.getByResourceGroup":"Microsoft.Cache.Clusters.get","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.getByResourceGroupWithResponse":"Microsoft.Cache.Clusters.get","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.list":"Microsoft.Cache.Clusters.list","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.listByResourceGroup":"Microsoft.Cache.Clusters.listByResourceGroup","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.listSkusForScaling":"Microsoft.Cache.Clusters.listSkusForScaling","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.listSkusForScalingWithResponse":"Microsoft.Cache.Clusters.listSkusForScaling","com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient.update":"Microsoft.Cache.Clusters.update","com.azure.resourcemanager.redisenterprise.fluent.models.AccessKeysInner":"Microsoft.Cache.AccessKeys","com.azure.resourcemanager.redisenterprise.fluent.models.AccessPolicyAssignmentInner":"Microsoft.Cache.AccessPolicyAssignment","com.azure.resourcemanager.redisenterprise.fluent.models.AccessPolicyAssignmentProperties":"Microsoft.Cache.AccessPolicyAssignmentProperties","com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner":"Microsoft.Cache.Cluster","com.azure.resourcemanager.redisenterprise.fluent.models.ClusterProperties":"Microsoft.Cache.ClusterCreateProperties","com.azure.resourcemanager.redisenterprise.fluent.models.ClusterUpdateProperties":"Microsoft.Cache.ClusterUpdateProperties","com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseCreateProperties":"Microsoft.Cache.DatabaseCreateProperties","com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner":"Microsoft.Cache.Database","com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseUpdateProperties":"Microsoft.Cache.DatabaseUpdateProperties","com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner":"Microsoft.Cache.Migration","com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner":"Microsoft.Cache.MigrationValidationResponse","com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner":"Microsoft.Cache.OperationStatus","com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner":"Microsoft.Cache.PrivateEndpointConnection","com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner":"Azure.ResourceManager.CommonTypes.PrivateLinkResource","com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceProperties":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties","com.azure.resourcemanager.redisenterprise.fluent.models.SkuDetailsListInner":"Microsoft.Cache.SkuDetailsList","com.azure.resourcemanager.redisenterprise.implementation.RedisEnterpriseManagementClientBuilder":"Microsoft.Cache","com.azure.resourcemanager.redisenterprise.implementation.models.AccessPolicyAssignmentList":"Microsoft.Cache.AccessPolicyAssignmentList","com.azure.resourcemanager.redisenterprise.implementation.models.ClusterList":"Microsoft.Cache.ClusterList","com.azure.resourcemanager.redisenterprise.implementation.models.DatabaseList":"Microsoft.Cache.DatabaseList","com.azure.resourcemanager.redisenterprise.implementation.models.MigrationList":"Microsoft.Cache.MigrationList","com.azure.resourcemanager.redisenterprise.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.redisenterprise.implementation.models.PrivateEndpointConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.redisenterprise.implementation.models.PrivateLinkResourceListResult":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult","com.azure.resourcemanager.redisenterprise.models.AccessKeyType":"Microsoft.Cache.AccessKeyType","com.azure.resourcemanager.redisenterprise.models.AccessKeysAuthentication":"Microsoft.Cache.AccessKeysAuthentication","com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentPropertiesUser":"Microsoft.Cache.AccessPolicyAssignmentPropertiesUser","com.azure.resourcemanager.redisenterprise.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.redisenterprise.models.AofFrequency":"Microsoft.Cache.AofFrequency","com.azure.resourcemanager.redisenterprise.models.AzureCacheForRedisMigrationProperties":"Microsoft.Cache.AzureCacheForRedisMigrationProperties","com.azure.resourcemanager.redisenterprise.models.ClusterCommonProperties":"Microsoft.Cache.ClusterProperties","com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption":"Microsoft.Cache.ClusterPropertiesEncryption","com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption":"Microsoft.Cache.ClusterPropertiesEncryptionCustomerManagedKeyEncryption","com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity":"Microsoft.Cache.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity","com.azure.resourcemanager.redisenterprise.models.ClusterUpdate":"Microsoft.Cache.ClusterUpdate","com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy":"Microsoft.Cache.ClusteringPolicy","com.azure.resourcemanager.redisenterprise.models.CmkIdentityType":"Microsoft.Cache.CmkIdentityType","com.azure.resourcemanager.redisenterprise.models.DatabaseCommonProperties":"Microsoft.Cache.DatabaseProperties","com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication":"Microsoft.Cache.DatabasePropertiesGeoReplication","com.azure.resourcemanager.redisenterprise.models.DatabaseUpdate":"Microsoft.Cache.DatabaseUpdate","com.azure.resourcemanager.redisenterprise.models.DeferUpgradeSetting":"Microsoft.Cache.DeferUpgradeSetting","com.azure.resourcemanager.redisenterprise.models.EvictionPolicy":"Microsoft.Cache.EvictionPolicy","com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters":"Microsoft.Cache.ExportClusterParameters","com.azure.resourcemanager.redisenterprise.models.FlushParameters":"Microsoft.Cache.FlushParameters","com.azure.resourcemanager.redisenterprise.models.ForceLinkParameters":"Microsoft.Cache.ForceLinkParameters","com.azure.resourcemanager.redisenterprise.models.ForceLinkParametersGeoReplication":"Microsoft.Cache.ForceLinkParametersGeoReplication","com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters":"Microsoft.Cache.ForceUnlinkParameters","com.azure.resourcemanager.redisenterprise.models.HighAvailability":"Microsoft.Cache.HighAvailability","com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters":"Microsoft.Cache.ImportClusterParameters","com.azure.resourcemanager.redisenterprise.models.Kind":"Microsoft.Cache.Kind","com.azure.resourcemanager.redisenterprise.models.LinkState":"Microsoft.Cache.LinkState","com.azure.resourcemanager.redisenterprise.models.LinkedDatabase":"Microsoft.Cache.LinkedDatabase","com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration":"Microsoft.Cache.MaintenanceConfiguration","com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek":"Microsoft.Cache.MaintenanceDayOfWeek","com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow":"Microsoft.Cache.MaintenanceWindow","com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule":"Microsoft.Cache.MaintenanceWindowSchedule","com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType":"Microsoft.Cache.MaintenanceWindowType","com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity":"Azure.ResourceManager.Legacy.ManagedServiceIdentityV4","com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType":"Azure.ResourceManager.Legacy.ManagedServiceIdentityType","com.azure.resourcemanager.redisenterprise.models.MigrationProperties":"Microsoft.Cache.MigrationProperties","com.azure.resourcemanager.redisenterprise.models.MigrationProvisioningState":"Microsoft.Cache.MigrationProvisioningState","com.azure.resourcemanager.redisenterprise.models.MigrationValidationDisparity":"Microsoft.Cache.MigrationValidationDisparity","com.azure.resourcemanager.redisenterprise.models.MigrationValidationError":"Microsoft.Cache.MigrationValidationError","com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest":"Microsoft.Cache.MigrationValidationRequest","com.azure.resourcemanager.redisenterprise.models.MigrationValidationWarning":"Microsoft.Cache.MigrationValidationWarning","com.azure.resourcemanager.redisenterprise.models.Module":"Microsoft.Cache.Module","com.azure.resourcemanager.redisenterprise.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.redisenterprise.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.redisenterprise.models.Persistence":"Microsoft.Cache.Persistence","com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.redisenterprise.models.Protocol":"Microsoft.Cache.Protocol","com.azure.resourcemanager.redisenterprise.models.ProvisioningState":"Microsoft.Cache.ProvisioningState","com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess":"Microsoft.Cache.PublicNetworkAccess","com.azure.resourcemanager.redisenterprise.models.RdbFrequency":"Microsoft.Cache.RdbFrequency","com.azure.resourcemanager.redisenterprise.models.RedundancyMode":"Microsoft.Cache.RedundancyMode","com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters":"Microsoft.Cache.RegenerateKeyParameters","com.azure.resourcemanager.redisenterprise.models.ResourceState":"Microsoft.Cache.ResourceState","com.azure.resourcemanager.redisenterprise.models.Sku":"Microsoft.Cache.Sku","com.azure.resourcemanager.redisenterprise.models.SkuDetails":"Microsoft.Cache.SkuDetails","com.azure.resourcemanager.redisenterprise.models.SkuName":"Microsoft.Cache.SkuName","com.azure.resourcemanager.redisenterprise.models.SourceType":"Microsoft.Cache.SourceType","com.azure.resourcemanager.redisenterprise.models.TlsVersion":"Microsoft.Cache.TlsVersion","com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity"},"generatedFiles":["src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/AccessPolicyAssignmentsClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationOperationsClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/MigrationsClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/OperationsStatusClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterpriseManagementClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessPolicyAssignmentProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterUpdateProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseCreateProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseUpdateProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/MigrationValidationResponseInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/SkuDetailsListInner.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/redisenterprise/fluent/package-info.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessPolicyAssignmentsImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationOperationsImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationValidationResponseImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/MigrationsImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/SkuDetailsListImpl.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/AccessPolicyAssignmentList.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/ClusterList.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/DatabaseList.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/MigrationList.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/redisenterprise/implementation/package-info.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeyType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeys.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessKeysAuthentication.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignment.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignmentPropertiesUser.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AccessPolicyAssignments.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ActionType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AofFrequency.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/AzureCacheForRedisMigrationProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Cluster.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterCommonProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryption.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryption.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusteringPolicy.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/CmkIdentityType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseCommonProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabasePropertiesGeoReplication.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/DeferUpgradeSetting.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/EvictionPolicy.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/FlushParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceLinkParametersGeoReplication.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ForceUnlinkParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/HighAvailability.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Kind.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/LinkedDatabase.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceConfiguration.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceDayOfWeek.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindow.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowSchedule.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MaintenanceWindowType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Migration.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationOperations.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProperties.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationProvisioningState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationDisparity.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationError.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationRequest.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationResponse.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/MigrationValidationWarning.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Migrations.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Operation.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Operations.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationsStatus.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Origin.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Protocol.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/RdbFrequency.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/RedisEnterprises.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/RedundancyMode.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/ResourceState.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/Sku.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetails.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuDetailsList.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/SkuName.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/SourceType.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/TlsVersion.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/redisenterprise/models/package-info.java","src/main/java/com/azure/resourcemanager/redisenterprise/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redisenterprise/proxy-config.json b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redisenterprise/proxy-config.json index b8d659c4e094..98db7898fddd 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redisenterprise/proxy-config.json +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redisenterprise/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.redisenterprise.implementation.AccessPolicyAssignmentsClientImpl$AccessPolicyAssignmentsService"],["com.azure.resourcemanager.redisenterprise.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.redisenterprise.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.redisenterprise.implementation.OperationsStatusClientImpl$OperationsStatusService"],["com.azure.resourcemanager.redisenterprise.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.redisenterprise.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.redisenterprise.implementation.RedisEnterprisesClientImpl$RedisEnterprisesService"]] \ No newline at end of file +[["com.azure.resourcemanager.redisenterprise.implementation.AccessPolicyAssignmentsClientImpl$AccessPolicyAssignmentsService"],["com.azure.resourcemanager.redisenterprise.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.redisenterprise.implementation.MigrationOperationsClientImpl$MigrationOperationsService"],["com.azure.resourcemanager.redisenterprise.implementation.MigrationsClientImpl$MigrationsService"],["com.azure.resourcemanager.redisenterprise.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.redisenterprise.implementation.OperationsStatusClientImpl$OperationsStatusService"],["com.azure.resourcemanager.redisenterprise.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.redisenterprise.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.redisenterprise.implementation.RedisEnterprisesClientImpl$RedisEnterprisesService"]] \ No newline at end of file diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentCreateUpdateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentCreateUpdateSamples.java index b5585edae5a1..cbc77a830a65 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentCreateUpdateSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentCreateUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,9 +11,7 @@ */ public final class AccessPolicyAssignmentCreateUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentCreateUpdate. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentDeleteSamples.java index 5d0d3906af9a..aee52bc43413 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentDeleteSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class AccessPolicyAssignmentDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentDelete.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentDelete. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentGetSamples.java index a4ba91f2f30f..9358a524e92d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentGetSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class AccessPolicyAssignmentGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentGet.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentGet. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListSamples.java index 6f88e4551a7f..e723560bd14d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class AccessPolicyAssignmentListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseAccessPolicyAssignmentsList.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseAccessPolicyAssignmentsList.json */ /** * Sample code: RedisEnterpriseAccessPolicyAssignmentList. 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 8c0e67bd23de..9cbc7bb1ef90 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -21,9 +21,7 @@ */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesNoClusterCacheCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesNoClusterCacheCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate No Cluster Cache. @@ -39,13 +37,12 @@ public static void redisEnterpriseDatabasesCreateNoClusterCache( .withPort(10000) .withClusteringPolicy(ClusteringPolicy.NO_CLUSTER) .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withNotifyKeyspaceEvents("") .create(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesCreate.json */ /** * Sample code: RedisEnterpriseDatabasesCreate. @@ -57,6 +54,7 @@ public static void redisEnterpriseDatabasesCreateNoClusterCache( manager.databases() .define("default") .withExistingRedisEnterprise("rg1", "cache1") + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withPort(10000) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) @@ -66,14 +64,12 @@ public static void redisEnterpriseDatabasesCreateNoClusterCache( new Module().withName("RedisTimeSeries").withArgs("RETENTION_POLICY 20"), new Module().withName("RediSearch"))) .withDeferUpgrade(DeferUpgradeSetting.NOT_DEFERRED) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .create(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesCreateWithGeoReplication.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesCreateWithGeoReplication.json */ /** * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. @@ -85,6 +81,7 @@ public static void redisEnterpriseDatabasesCreateWithActiveGeoReplication( manager.databases() .define("default") .withExistingRedisEnterprise("rg1", "cache1") + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withPort(10000) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) @@ -94,7 +91,7 @@ public static void redisEnterpriseDatabasesCreateWithActiveGeoReplication( "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), new LinkedDatabase().withId( "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")))) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .create(); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java index 8fd2b46d8b82..e8a9cf52f597 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesDelete.json */ /** * Sample code: RedisEnterpriseDatabasesDelete. 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 7d40fe646295..b862be176129 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,9 +11,7 @@ */ public final class DatabasesExportSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesExport.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesExport.json */ /** * Sample code: RedisEnterpriseDatabasesExport. 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 index b6670921df2b..6eb7f107b177 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,9 +12,7 @@ */ public final class DatabasesFlushSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesFlush.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesFlush.json */ /** * Sample code: How to flush all the keys in the database. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceLinkToReplicationGroupSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceLinkToReplicationGroupSamples.java index 96db3331dd84..359a1b4dc4de 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceLinkToReplicationGroupSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesForceLinkToReplicationGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -14,9 +14,7 @@ */ public final class DatabasesForceLinkToReplicationGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesForceLink.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesForceLink.json */ /** * Sample code: How to relink a database after a regional outage. 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 73f8378716e7..d76bb86256ed 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,9 +12,7 @@ */ public final class DatabasesForceUnlinkSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesForceUnlink.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesForceUnlink.json */ /** * Sample code: How to unlink a database during a regional outage. 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 50b2e4e24ce5..ecd73c1ac6b8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesGet.json */ /** * Sample code: RedisEnterpriseDatabasesGet. 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 8aa1d142821e..f7bd26694566 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,9 +12,7 @@ */ public final class DatabasesImportMethodSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesImport.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesImport.json */ /** * Sample code: RedisEnterpriseDatabasesImport. 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 ceeca8707bc6..cb01c3d17d3c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesListByClusterSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesListByCluster.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesListByCluster.json */ /** * Sample code: RedisEnterpriseDatabasesListByCluster. 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 3182b72cd58e..f374d562af97 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesListKeysSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesListKeys.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesListKeys.json */ /** * Sample code: RedisEnterpriseDatabasesListKeys. 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 a5f6f619684a..c94a1d94ac79 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,9 +12,7 @@ */ public final class DatabasesRegenerateKeySamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesRegenerateKey.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesRegenerateKey.json */ /** * Sample code: RedisEnterpriseDatabasesRegenerateKey. 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 fe7268e58172..d1be9c7cd321 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -17,9 +17,7 @@ */ public final class DatabasesUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate Clustering on No Cluster Cache. @@ -35,13 +33,12 @@ public static void redisEnterpriseDatabasesUpdateClusteringOnNoClusterCache( .withClientProtocol(Protocol.ENCRYPTED) .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER) .withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withNotifyKeyspaceEvents("") .apply(); } /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesUpdate.json */ /** * Sample code: RedisEnterpriseDatabasesUpdate. @@ -54,10 +51,11 @@ public static void redisEnterpriseDatabasesUpdateClusteringOnNoClusterCache( .getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE) .getValue(); resource.update() + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) .withClientProtocol(Protocol.ENCRYPTED) .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) - .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED) + .withNotifyKeyspaceEvents("KEA") .apply(); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpgradeDBRedisVersionSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpgradeDBRedisVersionSamples.java index 6a4941399ffb..c37ab9bb4aa7 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpgradeDBRedisVersionSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpgradeDBRedisVersionSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class DatabasesUpgradeDBRedisVersionSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDatabasesUpgradeDBRedisVersion.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json */ /** * Sample code: How to upgrade your database Redis version. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationCancelSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationCancelSamples.java new file mode 100644 index 000000000000..11cb0b825ed4 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationCancelSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +/** + * Samples for MigrationOperation Cancel. + */ +public final class MigrationOperationCancelSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationCancel.json + */ + /** + * Sample code: RedisEnterpriseMigrationCancel. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationCancel(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().cancel("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationGetSamples.java new file mode 100644 index 000000000000..05ea5c690109 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +/** + * Samples for MigrationOperation Get. + */ +public final class MigrationOperationGetSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationGet.json + */ + /** + * Sample code: RedisEnterpriseMigrationGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().getWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationListSamples.java new file mode 100644 index 000000000000..f6d554f33c10 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +/** + * Samples for MigrationOperation List. + */ +public final class MigrationOperationListSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationList.json + */ + /** + * Sample code: RedisEnterpriseMigrationList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations().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/MigrationOperationStartSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationStartSamples.java new file mode 100644 index 000000000000..03a3be52a896 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationStartSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.AzureCacheForRedisMigrationProperties; + +/** + * Samples for MigrationOperation Start. + */ +public final class MigrationOperationStartSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationStart.json + */ + /** + * Sample code: RedisEnterpriseMigrationStart. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationStart(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrationOperations() + .start("rg1", "cache1", + new MigrationInner().withProperties(new AzureCacheForRedisMigrationProperties().withSourceResourceId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1") + .withSwitchDns(true) + .withSkipDataMigration(true)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateSamples.java new file mode 100644 index 000000000000..c795685ce670 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; + +/** + * Samples for Migrations Validate. + */ +public final class MigrationsValidateSamples { + /* + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseMigrationValidate.json + */ + /** + * Sample code: RedisEnterpriseMigrationValidate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseMigrationValidate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.migrations() + .validateWithResponse("rg1", "cache1", new MigrationValidationRequest().withSourceResourceId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1") + .withSkipDataMigration(true) + .withForceMigrate(false), com.azure.core.util.Context.NONE); + } +} 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 cd807ba406d6..fca4abfd225d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * OperationsList.json + * x-ms-original-file: 2026-02-01-preview/OperationsList.json */ /** * Sample code: OperationsList. 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 83e4e3f02deb..2729840d6bfc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class OperationsStatusGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * OperationsStatusGet.json + * x-ms-original-file: 2026-02-01-preview/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. 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 26d9bb44647c..e04a5c1108b5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDeletePrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDeletePrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. 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 0525b559d23c..90ed390c0ea5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseGetPrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseGetPrivateEndpointConnection.json */ /** * Sample code: RedisEnterpriseGetPrivateEndpointConnection. 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 d71b2bbc26c0..299d28af1e91 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListPrivateEndpointConnections.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListPrivateEndpointConnections.json */ /** * Sample code: RedisEnterpriseListPrivateEndpointConnections. 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 91f19f74e7a4..9257cc09792a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,9 +12,7 @@ */ public final class PrivateEndpointConnectionsPutSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterprisePutPrivateEndpointConnection.json + * x-ms-original-file: 2026-02-01-preview/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 89a18b70803f..08e17a61b053 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class PrivateLinkResourcesListByClusterSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListPrivateLinkResources.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListPrivateLinkResources.json */ /** * Sample code: RedisEnterpriseListPrivateLinkResources. 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 071e9f348591..f03c2d9e5332 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -8,6 +8,11 @@ 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.MaintenanceConfiguration; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; @@ -24,9 +29,7 @@ */ public final class RedisEnterpriseCreateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseCreate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseCreate.json */ /** * Sample code: RedisEnterpriseCreate. @@ -54,6 +57,19 @@ public static void redisEnterpriseCreate(com.azure.resourcemanager.redisenterpri "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity") .withIdentityType(CmkIdentityType.USER_ASSIGNED_IDENTITY)) .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) + .withMaintenanceConfiguration(new MaintenanceConfiguration().withMaintenanceWindows(Arrays.asList( + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.MONDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.TUESDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.WEDNESDAY))))) .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 c5c59eaa9018..38f1d6d18657 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class RedisEnterpriseDeleteSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseDelete.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseDelete.json */ /** * Sample code: RedisEnterpriseDelete. 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 61614662cf7a..704dc321ed6d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class RedisEnterpriseGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseGet.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseGet.json */ /** * Sample code: RedisEnterpriseGet. 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 b881418ba33a..19487af6f843 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class RedisEnterpriseListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListByResourceGroup.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListByResourceGroup.json */ /** * Sample code: RedisEnterpriseListByResourceGroup. 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 1cba02a2ea2e..9a0ccf2f3519 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class RedisEnterpriseListSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseList.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseList.json */ /** * Sample code: RedisEnterpriseList. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSkusForScalingSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSkusForScalingSamples.java index 0151a8146111..2525c74a56ed 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSkusForScalingSamples.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSkusForScalingSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -9,9 +9,7 @@ */ public final class RedisEnterpriseListSkusForScalingSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseListSkusForScaling.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseListSkusForScaling.json */ /** * Sample code: RedisEnterpriseListSkusForScaling. 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 43a3fbc8b5ff..8b1cffdfd1c2 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 @@ -1,14 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; import com.azure.resourcemanager.redisenterprise.models.PublicNetworkAccess; 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; @@ -17,9 +23,7 @@ */ public final class RedisEnterpriseUpdateSamples { /* - * x-ms-original-file: - * specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/ - * RedisEnterpriseUpdate.json + * x-ms-original-file: 2026-02-01-preview/RedisEnterpriseUpdate.json */ /** * Sample code: RedisEnterpriseUpdate. @@ -35,6 +39,19 @@ public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterpri .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withMaintenanceConfiguration(new MaintenanceConfiguration().withMaintenanceWindows(Arrays.asList( + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.MONDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.TUESDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("PT6H") + .withStartHourUtc(3) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.WEDNESDAY))))) .apply(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentInnerTests.java index de144672fcb5..fd58f6f17dee 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentInnerTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,18 +13,18 @@ public final class AccessPolicyAssignmentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccessPolicyAssignmentInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"accessPolicyName\":\"vccfw\",\"user\":{\"objectId\":\"nbacfi\"}},\"id\":\"nlebxetqgtzxd\",\"name\":\"nqbqqwxr\",\"type\":\"feallnwsu\"}") + "{\"properties\":{\"provisioningState\":\"Deleting\",\"accessPolicyName\":\"w\",\"user\":{\"objectId\":\"jjugwdkcglhslaz\"}},\"id\":\"yggdtjixh\",\"name\":\"kuofqweykhme\",\"type\":\"evfyexfwhybcib\"}") .toObject(AccessPolicyAssignmentInner.class); - Assertions.assertEquals("vccfw", model.accessPolicyName()); - Assertions.assertEquals("nbacfi", model.user().objectId()); + Assertions.assertEquals("w", model.accessPolicyName()); + Assertions.assertEquals("jjugwdkcglhslaz", model.user().objectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccessPolicyAssignmentInner model = new AccessPolicyAssignmentInner().withAccessPolicyName("vccfw") - .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("nbacfi")); + AccessPolicyAssignmentInner model = new AccessPolicyAssignmentInner().withAccessPolicyName("w") + .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("jjugwdkcglhslaz")); model = BinaryData.fromObject(model).toObject(AccessPolicyAssignmentInner.class); - Assertions.assertEquals("vccfw", model.accessPolicyName()); - Assertions.assertEquals("nbacfi", model.user().objectId()); + Assertions.assertEquals("w", model.accessPolicyName()); + Assertions.assertEquals("jjugwdkcglhslaz", model.user().objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListTests.java index 36c74317a0f5..f71c2204003c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentListTests.java @@ -1,33 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redisenterprise.fluent.models.AccessPolicyAssignmentInner; -import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentList; -import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentPropertiesUser; -import java.util.Arrays; +import com.azure.resourcemanager.redisenterprise.implementation.models.AccessPolicyAssignmentList; import org.junit.jupiter.api.Assertions; public final class AccessPolicyAssignmentListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccessPolicyAssignmentList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"accessPolicyName\":\"pkvlrxn\",\"user\":{\"objectId\":\"ase\"}},\"id\":\"pheoflokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"}],\"nextLink\":\"masxazjpqyegu\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"accessPolicyName\":\"efovgmk\",\"user\":{\"objectId\":\"leyyvx\"}},\"id\":\"jpkcattpng\",\"name\":\"cr\",\"type\":\"czsqpjhvm\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"accessPolicyName\":\"nysounqe\",\"user\":{\"objectId\":\"noae\"}},\"id\":\"fhyhltrpmopjmcma\",\"name\":\"u\",\"type\":\"kthfui\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"accessPolicyName\":\"sfcpkvxodpuozm\",\"user\":{\"objectId\":\"ydagfuaxbe\"}},\"id\":\"iu\",\"name\":\"kktwhrdxw\",\"type\":\"ywqsmbsurexim\"}],\"nextLink\":\"yocf\"}") .toObject(AccessPolicyAssignmentList.class); - Assertions.assertEquals("pkvlrxn", model.value().get(0).accessPolicyName()); - Assertions.assertEquals("ase", model.value().get(0).user().objectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccessPolicyAssignmentList model = new AccessPolicyAssignmentList() - .withValue(Arrays.asList(new AccessPolicyAssignmentInner().withAccessPolicyName("pkvlrxn") - .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("ase")))); - model = BinaryData.fromObject(model).toObject(AccessPolicyAssignmentList.class); - Assertions.assertEquals("pkvlrxn", model.value().get(0).accessPolicyName()); - Assertions.assertEquals("ase", model.value().get(0).user().objectId()); + Assertions.assertEquals("efovgmk", model.value().get(0).accessPolicyName()); + Assertions.assertEquals("leyyvx", model.value().get(0).user().objectId()); + Assertions.assertEquals("yocf", model.nextLink()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesTests.java index 06c02c626949..0ac147c19fae 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,18 +13,18 @@ public final class AccessPolicyAssignmentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccessPolicyAssignmentProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Updating\",\"accessPolicyName\":\"njampm\",\"user\":{\"objectId\":\"nzscxa\"}}") + "{\"provisioningState\":\"Updating\",\"accessPolicyName\":\"dcsi\",\"user\":{\"objectId\":\"nnaamdectehfiqsc\"}}") .toObject(AccessPolicyAssignmentProperties.class); - Assertions.assertEquals("njampm", model.accessPolicyName()); - Assertions.assertEquals("nzscxa", model.user().objectId()); + Assertions.assertEquals("dcsi", model.accessPolicyName()); + Assertions.assertEquals("nnaamdectehfiqsc", model.user().objectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccessPolicyAssignmentProperties model = new AccessPolicyAssignmentProperties().withAccessPolicyName("njampm") - .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("nzscxa")); + AccessPolicyAssignmentProperties model = new AccessPolicyAssignmentProperties().withAccessPolicyName("dcsi") + .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("nnaamdectehfiqsc")); model = BinaryData.fromObject(model).toObject(AccessPolicyAssignmentProperties.class); - Assertions.assertEquals("njampm", model.accessPolicyName()); - Assertions.assertEquals("nzscxa", model.user().objectId()); + Assertions.assertEquals("dcsi", model.accessPolicyName()); + Assertions.assertEquals("nnaamdectehfiqsc", model.user().objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesUserTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesUserTests.java index 0bdfbcbfea40..691b80513c4c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesUserTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentPropertiesUserTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,15 +11,16 @@ public final class AccessPolicyAssignmentPropertiesUserTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AccessPolicyAssignmentPropertiesUser model - = BinaryData.fromString("{\"objectId\":\"ooch\"}").toObject(AccessPolicyAssignmentPropertiesUser.class); - Assertions.assertEquals("ooch", model.objectId()); + AccessPolicyAssignmentPropertiesUser model = BinaryData.fromString("{\"objectId\":\"ypvhezrkg\"}") + .toObject(AccessPolicyAssignmentPropertiesUser.class); + Assertions.assertEquals("ypvhezrkg", model.objectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AccessPolicyAssignmentPropertiesUser model = new AccessPolicyAssignmentPropertiesUser().withObjectId("ooch"); + AccessPolicyAssignmentPropertiesUser model + = new AccessPolicyAssignmentPropertiesUser().withObjectId("ypvhezrkg"); model = BinaryData.fromObject(model).toObject(AccessPolicyAssignmentPropertiesUser.class); - Assertions.assertEquals("ooch", model.objectId()); + Assertions.assertEquals("ypvhezrkg", model.objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsCreateUpdateMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsCreateUpdateMockTests.java index 9ba1c623f07a..d511a84586fd 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsCreateUpdateMockTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsCreateUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -22,7 +22,7 @@ public final class AccessPolicyAssignmentsCreateUpdateMockTests { @Test public void testCreateUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"accessPolicyName\":\"mvb\",\"user\":{\"objectId\":\"yjsflhhcaalnji\"}},\"id\":\"isxyawjoyaqcslyj\",\"name\":\"kiidzyex\",\"type\":\"nelixhnrztfo\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"accessPolicyName\":\"xmedjvcsly\",\"user\":{\"objectId\":\"wwncwzzhxgk\"}},\"id\":\"mgucna\",\"name\":\"kteo\",\"type\":\"llwptfdy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,13 @@ public void testCreateUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AccessPolicyAssignment response = manager.accessPolicyAssignments() - .define("ultskzbbtdz") - .withExistingDatabase("vawjvzunlu", "hnnpr", "xipeilpjzuaejx") - .withAccessPolicyName("ekg") - .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("ozuhkfp")) + .define("xyawj") + .withExistingDatabase("lns", "vbxwyjsflhh", "aalnjixi") + .withAccessPolicyName("cslyjpk") + .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("dzyexznelixh")) .create(); - Assertions.assertEquals("mvb", response.accessPolicyName()); - Assertions.assertEquals("yjsflhhcaalnji", response.user().objectId()); + Assertions.assertEquals("xmedjvcsly", response.accessPolicyName()); + Assertions.assertEquals("wwncwzzhxgk", response.user().objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsGetWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsGetWithResponseMockTests.java index 79bc43ba3d67..cc107e60219c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsGetWithResponseMockTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -21,7 +21,7 @@ public final class AccessPolicyAssignmentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"accessPolicyName\":\"vlvqhjkbegi\",\"user\":{\"objectId\":\"nmxiebwwaloayqc\"}},\"id\":\"wrtz\",\"name\":\"uzgwyzmhtx\",\"type\":\"ngmtsavjcb\"}"; + = "{\"properties\":{\"provisioningState\":\"Updating\",\"accessPolicyName\":\"nojvknmefqsg\",\"user\":{\"objectId\":\"ah\"}},\"id\":\"jyzhpvgq\",\"name\":\"cjrvxdjzlmwlxkv\",\"type\":\"gfhzovawjvzunlut\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AccessPolicyAssignment response = manager.accessPolicyAssignments() - .getWithResponse("upjm", "hfxobbcswsrtj", "iplrbpbewtghfgb", "c", com.azure.core.util.Context.NONE) + .getWithResponse("mtsavjcbpwxqp", "rknftguvriuhprwm", "yvxqtayriwwroy", "bexrmcq", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vlvqhjkbegi", response.accessPolicyName()); - Assertions.assertEquals("nmxiebwwaloayqc", response.user().objectId()); + Assertions.assertEquals("nojvknmefqsg", response.accessPolicyName()); + Assertions.assertEquals("ah", response.user().objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsListMockTests.java index 6e34729ca3b9..87424cbeca5c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsListMockTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AccessPolicyAssignmentsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -22,7 +22,7 @@ public final class AccessPolicyAssignmentsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"accessPolicyName\":\"yqbexrmcqibycno\",\"user\":{\"objectId\":\"knme\"}},\"id\":\"qsgzvahapj\",\"name\":\"zhpvgqzcjrvxd\",\"type\":\"zlmwlxkvugfhz\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"accessPolicyName\":\"zbbtdzumveek\",\"user\":{\"objectId\":\"wozuhkf\"}},\"id\":\"sjyofdx\",\"name\":\"uusdttouwa\",\"type\":\"oekqvk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,10 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.accessPolicyAssignments() - .list("wxqpsrknftguvri", "hprwmdyv", "qtayri", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.accessPolicyAssignments().list("nnprn", "i", "eilpjzuaejxdu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("yqbexrmcqibycno", response.iterator().next().accessPolicyName()); - Assertions.assertEquals("knme", response.iterator().next().user().objectId()); + Assertions.assertEquals("zbbtdzumveek", response.iterator().next().accessPolicyName()); + Assertions.assertEquals("wozuhkf", response.iterator().next().user().objectId()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AzureCacheForRedisMigrationPropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AzureCacheForRedisMigrationPropertiesTests.java new file mode 100644 index 000000000000..9924f2806be0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/AzureCacheForRedisMigrationPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.AzureCacheForRedisMigrationProperties; +import org.junit.jupiter.api.Assertions; + +public final class AzureCacheForRedisMigrationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureCacheForRedisMigrationProperties model = BinaryData.fromString( + "{\"sourceType\":\"AzureCacheForRedis\",\"sourceResourceId\":\"bq\",\"switchDns\":true,\"skipDataMigration\":true,\"forceMigrate\":true,\"targetResourceId\":\"yokacspkw\",\"provisioningState\":\"CancellationFailed\",\"statusDetails\":\"obpxjmflbvvn\",\"creationTime\":\"2021-11-01T14:14:41Z\",\"lastModifiedTime\":\"2021-03-04T23:54:12Z\"}") + .toObject(AzureCacheForRedisMigrationProperties.class); + Assertions.assertEquals("bq", model.sourceResourceId()); + Assertions.assertTrue(model.switchDns()); + Assertions.assertTrue(model.skipDataMigration()); + Assertions.assertTrue(model.forceMigrate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureCacheForRedisMigrationProperties model + = new AzureCacheForRedisMigrationProperties().withSourceResourceId("bq") + .withSwitchDns(true) + .withSkipDataMigration(true) + .withForceMigrate(true); + model = BinaryData.fromObject(model).toObject(AzureCacheForRedisMigrationProperties.class); + Assertions.assertEquals("bq", model.sourceResourceId()); + Assertions.assertTrue(model.switchDns()); + Assertions.assertTrue(model.skipDataMigration()); + Assertions.assertTrue(model.forceMigrate()); + } +} 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 index f81cf4c48de2..ada49768e8c3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -14,9 +14,9 @@ public final class ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIde public void testDeserialize() throws Exception { ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model = BinaryData .fromString( - "{\"userAssignedIdentityResourceId\":\"qjbpfzfsin\",\"identityType\":\"systemAssignedIdentity\"}") + "{\"userAssignedIdentityResourceId\":\"bzaqsqsycbkbfk\",\"identityType\":\"systemAssignedIdentity\"}") .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class); - Assertions.assertEquals("qjbpfzfsin", model.userAssignedIdentityResourceId()); + Assertions.assertEquals("bzaqsqsycbkbfk", model.userAssignedIdentityResourceId()); Assertions.assertEquals(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY, model.identityType()); } @@ -24,11 +24,11 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model = new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() - .withUserAssignedIdentityResourceId("qjbpfzfsin") + .withUserAssignedIdentityResourceId("bzaqsqsycbkbfk") .withIdentityType(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY); model = BinaryData.fromObject(model) .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class); - Assertions.assertEquals("qjbpfzfsin", model.userAssignedIdentityResourceId()); + Assertions.assertEquals("bzaqsqsycbkbfk", 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/DatabasePropertiesGeoReplicationTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/DatabasePropertiesGeoReplicationTests.java index 8af15e6aa5ae..8273448bae67 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -14,19 +14,20 @@ public final class DatabasePropertiesGeoReplicationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DatabasePropertiesGeoReplication model = BinaryData.fromString( - "{\"groupNickname\":\"ijcoejctb\",\"linkedDatabases\":[{\"id\":\"qsycbkbfkgu\",\"state\":\"UnlinkFailed\"},{\"id\":\"xxppofm\",\"state\":\"UnlinkFailed\"}]}") + "{\"groupNickname\":\"dvpjhulsuuvmk\",\"linkedDatabases\":[{\"id\":\"rwfndiod\",\"state\":\"LinkFailed\"},{\"id\":\"w\",\"state\":\"Linking\"}]}") .toObject(DatabasePropertiesGeoReplication.class); - Assertions.assertEquals("ijcoejctb", model.groupNickname()); - Assertions.assertEquals("qsycbkbfkgu", model.linkedDatabases().get(0).id()); + Assertions.assertEquals("dvpjhulsuuvmk", model.groupNickname()); + Assertions.assertEquals("rwfndiod", model.linkedDatabases().get(0).id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DatabasePropertiesGeoReplication model = new DatabasePropertiesGeoReplication().withGroupNickname("ijcoejctb") - .withLinkedDatabases( - Arrays.asList(new LinkedDatabase().withId("qsycbkbfkgu"), new LinkedDatabase().withId("xxppofm"))); + DatabasePropertiesGeoReplication model + = new DatabasePropertiesGeoReplication().withGroupNickname("dvpjhulsuuvmk") + .withLinkedDatabases( + Arrays.asList(new LinkedDatabase().withId("rwfndiod"), new LinkedDatabase().withId("w"))); model = BinaryData.fromObject(model).toObject(DatabasePropertiesGeoReplication.class); - Assertions.assertEquals("ijcoejctb", model.groupNickname()); - Assertions.assertEquals("qsycbkbfkgu", model.linkedDatabases().get(0).id()); + Assertions.assertEquals("dvpjhulsuuvmk", model.groupNickname()); + Assertions.assertEquals("rwfndiod", model.linkedDatabases().get(0).id()); } } 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 index 5cefbc0a8b40..decfce09b495 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.databases().delete("plpho", "uscrpabgyepsb", "tazqugxywpmueefj", com.azure.core.util.Context.NONE); + manager.databases().delete("beypewrmjmw", "vjektcxsenh", "lrsf", 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 index 2c8ba75b63ed..be7871a1df97 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -29,7 +29,7 @@ public void testExport() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.databases() - .export("ehhseyvjusrts", "hspkdeemao", "mx", new ExportClusterParameters().withSasUri("gkvtmelmqkrhah"), + .export("gr", "wflzlfbxzpuzy", "ispnqzahmgkbrp", new ExportClusterParameters().withSasUri("y"), 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 index c5b26b2248b0..9ca0dd80b52f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -30,8 +30,8 @@ public void testFlush() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.databases() - .flush("isgwbnbbeldawkz", "ali", "urqhaka", - new FlushParameters().withIds(Arrays.asList("shsfwxosowzxcu", "i", "jooxdjebw")), + .flush("vpnazzm", "jrunmpxtt", "bh", + new FlushParameters().withIds(Arrays.asList("l", "nkxmyskpbhenbtk", "xywnytnrsynlqidy")), 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 index e7373fe7f0ce..a071626339ab 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -30,9 +30,8 @@ public void testForceUnlink() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.databases() - .forceUnlink("ljuahaquhcdh", "duala", "xqpvfadmw", - new ForceUnlinkParameters().withIds(Arrays.asList("crgvxpvgom", "lf")), - com.azure.core.util.Context.NONE); + .forceUnlink("hibnuqqkpika", "rgvtqag", "buynhijggm", + new ForceUnlinkParameters().withIds(Arrays.asList("fsiarbutr")), com.azure.core.util.Context.NONE); } } 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 index bb08cf4ead0d..432885e8969e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -30,8 +30,8 @@ public void testImportMethod() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.databases() - .importMethod("dzhlrq", "bh", "kfrlhrxsbky", - new ImportClusterParameters().withSasUris(Arrays.asList("ycanuzbpzkafku", "b", "rnwb")), + .importMethod("vcltbgsncgh", "jeszzhbijhtxfv", "xbf", + new ImportClusterParameters().withSasUris(Arrays.asList("xnehmpvec", "godebfqkkrbmpu")), com.azure.core.util.Context.NONE); } 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 index 1412b8e81d8f..c705a505af69 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,14 +12,14 @@ public final class ExportClusterParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExportClusterParameters model - = BinaryData.fromString("{\"sasUri\":\"abcypmivk\"}").toObject(ExportClusterParameters.class); - Assertions.assertEquals("abcypmivk", model.sasUri()); + = BinaryData.fromString("{\"sasUri\":\"gvfcj\"}").toObject(ExportClusterParameters.class); + Assertions.assertEquals("gvfcj", model.sasUri()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExportClusterParameters model = new ExportClusterParameters().withSasUri("abcypmivk"); + ExportClusterParameters model = new ExportClusterParameters().withSasUri("gvfcj"); model = BinaryData.fromObject(model).toObject(ExportClusterParameters.class); - Assertions.assertEquals("abcypmivk", model.sasUri()); + Assertions.assertEquals("gvfcj", 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 index 9b3f7d74de4c..f1079d6cdc6e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,14 +12,16 @@ public final class FlushParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FlushParameters model = BinaryData.fromString("{\"ids\":[\"hrsajiwkuofo\"]}").toObject(FlushParameters.class); - Assertions.assertEquals("hrsajiwkuofo", model.ids().get(0)); + FlushParameters model = BinaryData.fromString("{\"ids\":[\"nfygxgispemvtz\",\"kufubljo\",\"xqeofjaeqjhqjba\"]}") + .toObject(FlushParameters.class); + Assertions.assertEquals("nfygxgispemvtz", model.ids().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FlushParameters model = new FlushParameters().withIds(Arrays.asList("hrsajiwkuofo")); + FlushParameters model + = new FlushParameters().withIds(Arrays.asList("nfygxgispemvtz", "kufubljo", "xqeofjaeqjhqjba")); model = BinaryData.fromObject(model).toObject(FlushParameters.class); - Assertions.assertEquals("hrsajiwkuofo", model.ids().get(0)); + Assertions.assertEquals("nfygxgispemvtz", model.ids().get(0)); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersGeoReplicationTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersGeoReplicationTests.java index 89ee8201c077..2e50922528d8 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersGeoReplicationTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersGeoReplicationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,20 +13,20 @@ public final class ForceLinkParametersGeoReplicationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForceLinkParametersGeoReplication model = BinaryData.fromString( - "{\"groupNickname\":\"zb\",\"linkedDatabases\":[{\"id\":\"ovm\",\"state\":\"Linked\"},{\"id\":\"cspkwlhzdobpxjmf\",\"state\":\"LinkFailed\"},{\"id\":\"nchrkcciww\",\"state\":\"Linked\"}]}") + ForceLinkParametersGeoReplication model = BinaryData + .fromString( + "{\"groupNickname\":\"theotusiv\",\"linkedDatabases\":[{\"id\":\"ciqihnhung\",\"state\":\"Linking\"}]}") .toObject(ForceLinkParametersGeoReplication.class); - Assertions.assertEquals("zb", model.groupNickname()); - Assertions.assertEquals("ovm", model.linkedDatabases().get(0).id()); + Assertions.assertEquals("theotusiv", model.groupNickname()); + Assertions.assertEquals("ciqihnhung", model.linkedDatabases().get(0).id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForceLinkParametersGeoReplication model = new ForceLinkParametersGeoReplication().withGroupNickname("zb") - .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId("ovm"), - new LinkedDatabase().withId("cspkwlhzdobpxjmf"), new LinkedDatabase().withId("nchrkcciww"))); + ForceLinkParametersGeoReplication model = new ForceLinkParametersGeoReplication().withGroupNickname("theotusiv") + .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId("ciqihnhung"))); model = BinaryData.fromObject(model).toObject(ForceLinkParametersGeoReplication.class); - Assertions.assertEquals("zb", model.groupNickname()); - Assertions.assertEquals("ovm", model.linkedDatabases().get(0).id()); + Assertions.assertEquals("theotusiv", model.groupNickname()); + Assertions.assertEquals("ciqihnhung", model.linkedDatabases().get(0).id()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersTests.java index 16259b2262ad..7ab7fd50d720 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/ForceLinkParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -15,19 +15,23 @@ public final class ForceLinkParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ForceLinkParameters model = BinaryData.fromString( - "{\"geoReplication\":{\"groupNickname\":\"t\",\"linkedDatabases\":[{\"id\":\"ulexxbczwtr\",\"state\":\"UnlinkFailed\"}]}}") + "{\"geoReplication\":{\"groupNickname\":\"luwfzitonpeqfpjk\",\"linkedDatabases\":[{\"id\":\"fpdvhpfxxypi\",\"state\":\"Linking\"},{\"id\":\"ayhuy\",\"state\":\"Unlinking\"},{\"id\":\"odepoogin\",\"state\":\"Unlinking\"},{\"id\":\"iheogna\",\"state\":\"UnlinkFailed\"}]}}") .toObject(ForceLinkParameters.class); - Assertions.assertEquals("t", model.geoReplication().groupNickname()); - Assertions.assertEquals("ulexxbczwtr", model.geoReplication().linkedDatabases().get(0).id()); + Assertions.assertEquals("luwfzitonpeqfpjk", model.geoReplication().groupNickname()); + Assertions.assertEquals("fpdvhpfxxypi", model.geoReplication().linkedDatabases().get(0).id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForceLinkParameters model = new ForceLinkParameters() - .withGeoReplication(new ForceLinkParametersGeoReplication().withGroupNickname("t") - .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId("ulexxbczwtr")))); + ForceLinkParameters model + = new ForceLinkParameters() + .withGeoReplication( + new ForceLinkParametersGeoReplication().withGroupNickname("luwfzitonpeqfpjk") + .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId("fpdvhpfxxypi"), + new LinkedDatabase().withId("ayhuy"), new LinkedDatabase().withId("odepoogin"), + new LinkedDatabase().withId("iheogna")))); model = BinaryData.fromObject(model).toObject(ForceLinkParameters.class); - Assertions.assertEquals("t", model.geoReplication().groupNickname()); - Assertions.assertEquals("ulexxbczwtr", model.geoReplication().linkedDatabases().get(0).id()); + Assertions.assertEquals("luwfzitonpeqfpjk", model.geoReplication().groupNickname()); + Assertions.assertEquals("fpdvhpfxxypi", model.geoReplication().linkedDatabases().get(0).id()); } } 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 index 572abc4270c9..2cd1725e8065 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -12,14 +12,15 @@ public final class ForceUnlinkParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForceUnlinkParameters model = BinaryData.fromString("{\"ids\":[\"f\"]}").toObject(ForceUnlinkParameters.class); - Assertions.assertEquals("f", model.ids().get(0)); + ForceUnlinkParameters model + = BinaryData.fromString("{\"ids\":[\"zoxxjtf\"]}").toObject(ForceUnlinkParameters.class); + Assertions.assertEquals("zoxxjtf", model.ids().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForceUnlinkParameters model = new ForceUnlinkParameters().withIds(Arrays.asList("f")); + ForceUnlinkParameters model = new ForceUnlinkParameters().withIds(Arrays.asList("zoxxjtf")); model = BinaryData.fromObject(model).toObject(ForceUnlinkParameters.class); - Assertions.assertEquals("f", model.ids().get(0)); + Assertions.assertEquals("zoxxjtf", 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 index 4e4d9a337734..e2f933cbd35a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,14 +13,16 @@ public final class ImportClusterParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ImportClusterParameters model - = BinaryData.fromString("{\"sasUris\":[\"v\",\"bmqj\"]}").toObject(ImportClusterParameters.class); - Assertions.assertEquals("v", model.sasUris().get(0)); + = BinaryData.fromString("{\"sasUris\":[\"gexpaojakhmsbz\",\"hcrzevd\",\"hlxaolthqtr\",\"qjbpfzfsin\"]}") + .toObject(ImportClusterParameters.class); + Assertions.assertEquals("gexpaojakhmsbz", model.sasUris().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImportClusterParameters model = new ImportClusterParameters().withSasUris(Arrays.asList("v", "bmqj")); + ImportClusterParameters model = new ImportClusterParameters() + .withSasUris(Arrays.asList("gexpaojakhmsbz", "hcrzevd", "hlxaolthqtr", "qjbpfzfsin")); model = BinaryData.fromObject(model).toObject(ImportClusterParameters.class); - Assertions.assertEquals("v", model.sasUris().get(0)); + Assertions.assertEquals("gexpaojakhmsbz", 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 index 8e418285d684..6f482f506e35 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,15 +11,15 @@ public final class LinkedDatabaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LinkedDatabase model = BinaryData.fromString("{\"id\":\"fjpgddtocjjxhvp\",\"state\":\"Unlinking\"}") - .toObject(LinkedDatabase.class); - Assertions.assertEquals("fjpgddtocjjxhvp", model.id()); + LinkedDatabase model + = BinaryData.fromString("{\"id\":\"vwryoqpso\",\"state\":\"LinkFailed\"}").toObject(LinkedDatabase.class); + Assertions.assertEquals("vwryoqpso", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedDatabase model = new LinkedDatabase().withId("fjpgddtocjjxhvp"); + LinkedDatabase model = new LinkedDatabase().withId("vwryoqpso"); model = BinaryData.fromObject(model).toObject(LinkedDatabase.class); - Assertions.assertEquals("fjpgddtocjjxhvp", model.id()); + Assertions.assertEquals("vwryoqpso", model.id()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceConfigurationTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceConfigurationTests.java new file mode 100644 index 000000000000..faba58f81e89 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceConfigurationTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceConfiguration; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceConfiguration model = BinaryData.fromString( + "{\"maintenanceWindows\":[{\"type\":\"Weekly\",\"duration\":\"xxppofm\",\"startHourUtc\":1878270858,\"schedule\":{\"dayOfWeek\":\"Thursday\"}},{\"type\":\"Weekly\",\"duration\":\"jpgd\",\"startHourUtc\":681879854,\"schedule\":{\"dayOfWeek\":\"Saturday\"}}]}") + .toObject(MaintenanceConfiguration.class); + Assertions.assertEquals(MaintenanceWindowType.WEEKLY, model.maintenanceWindows().get(0).type()); + Assertions.assertEquals("xxppofm", model.maintenanceWindows().get(0).duration()); + Assertions.assertEquals(1878270858, model.maintenanceWindows().get(0).startHourUtc()); + Assertions.assertEquals(MaintenanceDayOfWeek.THURSDAY, + model.maintenanceWindows().get(0).schedule().dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceConfiguration model = new MaintenanceConfiguration().withMaintenanceWindows(Arrays.asList( + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("xxppofm") + .withStartHourUtc(1878270858) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.THURSDAY)), + new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("jpgd") + .withStartHourUtc(681879854) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.SATURDAY)))); + model = BinaryData.fromObject(model).toObject(MaintenanceConfiguration.class); + Assertions.assertEquals(MaintenanceWindowType.WEEKLY, model.maintenanceWindows().get(0).type()); + Assertions.assertEquals("xxppofm", model.maintenanceWindows().get(0).duration()); + Assertions.assertEquals(1878270858, model.maintenanceWindows().get(0).startHourUtc()); + Assertions.assertEquals(MaintenanceDayOfWeek.THURSDAY, + model.maintenanceWindows().get(0).schedule().dayOfWeek()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowScheduleTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowScheduleTests.java new file mode 100644 index 000000000000..328527ba8f27 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowScheduleTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceWindowScheduleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceWindowSchedule model + = BinaryData.fromString("{\"dayOfWeek\":\"Thursday\"}").toObject(MaintenanceWindowSchedule.class); + Assertions.assertEquals(MaintenanceDayOfWeek.THURSDAY, model.dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceWindowSchedule model = new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.THURSDAY); + model = BinaryData.fromObject(model).toObject(MaintenanceWindowSchedule.class); + Assertions.assertEquals(MaintenanceDayOfWeek.THURSDAY, model.dayOfWeek()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowTests.java new file mode 100644 index 000000000000..ae1cdba59009 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MaintenanceWindowTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceDayOfWeek; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindow; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowSchedule; +import com.azure.resourcemanager.redisenterprise.models.MaintenanceWindowType; +import org.junit.jupiter.api.Assertions; + +public final class MaintenanceWindowTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaintenanceWindow model = BinaryData.fromString( + "{\"type\":\"Weekly\",\"duration\":\"j\",\"startHourUtc\":1680873734,\"schedule\":{\"dayOfWeek\":\"Monday\"}}") + .toObject(MaintenanceWindow.class); + Assertions.assertEquals(MaintenanceWindowType.WEEKLY, model.type()); + Assertions.assertEquals("j", model.duration()); + Assertions.assertEquals(1680873734, model.startHourUtc()); + Assertions.assertEquals(MaintenanceDayOfWeek.MONDAY, model.schedule().dayOfWeek()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaintenanceWindow model = new MaintenanceWindow().withType(MaintenanceWindowType.WEEKLY) + .withDuration("j") + .withStartHourUtc(1680873734) + .withSchedule(new MaintenanceWindowSchedule().withDayOfWeek(MaintenanceDayOfWeek.MONDAY)); + model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); + Assertions.assertEquals(MaintenanceWindowType.WEEKLY, model.type()); + Assertions.assertEquals("j", model.duration()); + Assertions.assertEquals(1680873734, model.startHourUtc()); + Assertions.assertEquals(MaintenanceDayOfWeek.MONDAY, model.schedule().dayOfWeek()); + } +} 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 index ec647b813338..38a69a42d4e1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -16,19 +16,17 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"fc8cec0e-727d-4641-b54c-45e47ab6205f\",\"tenantId\":\"eb7e7691-5376-4781-98a6-32cc013f8785\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"sprozvcput\":{\"principalId\":\"b6d368d9-18d3-41c6-a0c2-562712ccd15f\",\"clientId\":\"3752daf0-89b2-4a5a-9dd3-30f8900b2e87\"},\"vwmf\":{\"principalId\":\"e41f247c-86b3-41b6-97db-227ee600d8a4\",\"clientId\":\"e6beb0dc-09b2-48ec-b3c7-72e936e04de2\"},\"scmdvpjhulsuu\":{\"principalId\":\"c5fe41d7-26ff-4b5e-95c2-806d7a18b4bc\",\"clientId\":\"88323a86-35b8-4f76-8d84-6e9d06ecbd39\"},\"jozkrwfndiod\":{\"principalId\":\"f0fe28d1-edb1-4e3e-a36e-287578e3c721\",\"clientId\":\"f4e56c9f-bb59-43e8-b809-f58ee312e728\"}}}") + "{\"principalId\":\"dzxibqeojnxqbzvd\",\"tenantId\":\"t\",\"type\":\"None\",\"userAssignedIdentities\":{\"hjq\":{\"principalId\":\"cbtwnpzaoqvuh\",\"clientId\":\"cffcyddglmj\"}}}") .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("sprozvcput", new UserAssignedIdentity(), "vwmf", new UserAssignedIdentity(), "scmdvpjhulsuu", - new UserAssignedIdentity(), "jozkrwfndiod", new UserAssignedIdentity())); + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("hjq", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); } // Use "Map.of" if available diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationInnerTests.java new file mode 100644 index 000000000000..d74d393cdfdb --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.MigrationProperties; + +public final class MigrationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationInner model = BinaryData.fromString( + "{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"s\",\"provisioningState\":\"Cancelled\",\"statusDetails\":\"ys\",\"creationTime\":\"2021-06-14T21:05:42Z\",\"lastModifiedTime\":\"2021-01-05T19:47:06Z\"},\"id\":\"hqyudxorrqnbpoc\",\"name\":\"vyifqrvkdvjsl\",\"type\":\"rm\"}") + .toObject(MigrationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MigrationInner model = new MigrationInner().withProperties(new MigrationProperties()); + model = BinaryData.fromObject(model).toObject(MigrationInner.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationListTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationListTests.java new file mode 100644 index 000000000000..8fcc2b9d1dd7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.implementation.models.MigrationList; +import org.junit.jupiter.api.Assertions; + +public final class MigrationListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"wzjuqk\",\"provisioningState\":\"Accepted\",\"statusDetails\":\"jiwkuofoskghsau\",\"creationTime\":\"2021-09-27T06:41:32Z\",\"lastModifiedTime\":\"2021-10-21T01:55:36Z\"},\"id\":\"ied\",\"name\":\"ugidyjrr\",\"type\":\"byao\"},{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"xc\",\"provisioningState\":\"InProgress\",\"statusDetails\":\"clhocohsl\",\"creationTime\":\"2021-07-17T21:27:24Z\",\"lastModifiedTime\":\"2021-02-15T02:43:43Z\"},\"id\":\"gz\",\"name\":\"buhfmvfaxkffeiit\",\"type\":\"lvmezyvshxmzsbbz\"},{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"igrxwburvjxxjn\",\"provisioningState\":\"Succeeded\",\"statusDetails\":\"ptkoenkoukn\",\"creationTime\":\"2021-02-16T10:50:56Z\",\"lastModifiedTime\":\"2021-04-09T12:14:42Z\"},\"id\":\"ukbldngkpo\",\"name\":\"ipazyxoegukgjnpi\",\"type\":\"cgygev\"}],\"nextLink\":\"ntypmrbpizcdrqj\"}") + .toObject(MigrationList.class); + Assertions.assertEquals("ntypmrbpizcdrqj", model.nextLink()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsGetWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..327f2b081f33 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Migration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MigrationOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"dahzxctobg\",\"provisioningState\":\"Cancelling\",\"statusDetails\":\"oizpostmgrcfbun\",\"creationTime\":\"2021-04-30T20:29:14Z\",\"lastModifiedTime\":\"2021-10-01T13:01:52Z\"},\"id\":\"hkxbpv\",\"name\":\"ymjhxxjyngudivkr\",\"type\":\"swbxqz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedisEnterpriseManager manager = RedisEnterpriseManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Migration response = manager.migrationOperations() + .getWithResponse("pfqbuaceopzf", "rhhuaopppcqeqx", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsListMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsListMockTests.java new file mode 100644 index 000000000000..46d5c3eb084c --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.Migration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MigrationOperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"ruoujmk\",\"provisioningState\":\"ReadyForDnsSwitch\",\"statusDetails\":\"qytjrybnwjewgd\",\"creationTime\":\"2021-04-13T17:49:37Z\",\"lastModifiedTime\":\"2021-06-30T15:09:15Z\"},\"id\":\"aen\",\"name\":\"pehindoygm\",\"type\":\"fthnzdn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedisEnterpriseManager manager = RedisEnterpriseManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.migrationOperations().list("tpvjzbexilzznfqq", "vwpm", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsStartMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsStartMockTests.java new file mode 100644 index 000000000000..58e0566ce740 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationOperationsStartMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationInner; +import com.azure.resourcemanager.redisenterprise.models.Migration; +import com.azure.resourcemanager.redisenterprise.models.MigrationProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MigrationOperationsStartMockTests { + @Test + public void testStart() throws Exception { + String responseStr + = "{\"properties\":{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"crsbfovasr\",\"provisioningState\":\"Succeeded\",\"statusDetails\":\"bhsqfsubcgjbirxb\",\"creationTime\":\"2021-08-16T05:09:52Z\",\"lastModifiedTime\":\"2021-10-20T12:17:26Z\"},\"id\":\"bjf\",\"name\":\"twss\",\"type\":\"t\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedisEnterpriseManager manager = RedisEnterpriseManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Migration response = manager.migrationOperations() + .start("szjfauvjfdxxivet", "t", new MigrationInner().withProperties(new MigrationProperties()), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationPropertiesTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationPropertiesTests.java new file mode 100644 index 000000000000..c59c2f40d0cf --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MigrationProperties; + +public final class MigrationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationProperties model = BinaryData.fromString( + "{\"sourceType\":\"MigrationProperties\",\"targetResourceId\":\"d\",\"provisioningState\":\"ReadyForDnsSwitch\",\"statusDetails\":\"kpnpulexxbczwtr\",\"creationTime\":\"2021-07-26T12:29:54Z\",\"lastModifiedTime\":\"2021-10-24T07:39:30Z\"}") + .toObject(MigrationProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MigrationProperties model = new MigrationProperties(); + model = BinaryData.fromObject(model).toObject(MigrationProperties.class); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationDisparityTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationDisparityTests.java new file mode 100644 index 000000000000..02f3c90fe920 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationDisparityTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationDisparity; +import org.junit.jupiter.api.Assertions; + +public final class MigrationValidationDisparityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationValidationDisparity model + = BinaryData.fromString("{\"category\":\"bznorcjxvsnby\",\"message\":\"qabnmoc\"}") + .toObject(MigrationValidationDisparity.class); + Assertions.assertEquals("bznorcjxvsnby", model.category()); + Assertions.assertEquals("qabnmoc", model.message()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationErrorTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationErrorTests.java new file mode 100644 index 000000000000..5c5616cccf1e --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationErrorTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationError; +import org.junit.jupiter.api.Assertions; + +public final class MigrationValidationErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationValidationError model = BinaryData.fromString( + "{\"disparities\":[{\"category\":\"wjdk\",\"message\":\"rsoodqxhcrmnoh\"},{\"category\":\"t\",\"message\":\"kwh\"},{\"category\":\"soifiyipjxsqw\",\"message\":\"gr\"}]}") + .toObject(MigrationValidationError.class); + Assertions.assertEquals("wjdk", model.disparities().get(0).category()); + Assertions.assertEquals("rsoodqxhcrmnoh", model.disparities().get(0).message()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationRequestTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationRequestTests.java new file mode 100644 index 000000000000..6b1efed375ad --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationRequestTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; +import org.junit.jupiter.api.Assertions; + +public final class MigrationValidationRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationValidationRequest model + = BinaryData.fromString("{\"sourceResourceId\":\"juvf\",\"skipDataMigration\":true,\"forceMigrate\":true}") + .toObject(MigrationValidationRequest.class); + Assertions.assertEquals("juvf", model.sourceResourceId()); + Assertions.assertTrue(model.skipDataMigration()); + Assertions.assertTrue(model.forceMigrate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MigrationValidationRequest model = new MigrationValidationRequest().withSourceResourceId("juvf") + .withSkipDataMigration(true) + .withForceMigrate(true); + model = BinaryData.fromObject(model).toObject(MigrationValidationRequest.class); + Assertions.assertEquals("juvf", model.sourceResourceId()); + Assertions.assertTrue(model.skipDataMigration()); + Assertions.assertTrue(model.forceMigrate()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationResponseInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationResponseInnerTests.java new file mode 100644 index 000000000000..8f0f88da756f --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationResponseInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.fluent.models.MigrationValidationResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class MigrationValidationResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationValidationResponseInner model = BinaryData.fromString( + "{\"isValid\":false,\"errors\":[{\"disparities\":[{\"category\":\"kcprbnw\",\"message\":\"xgjvtbv\"},{\"category\":\"ysszdnrujqguh\",\"message\":\"uouq\"}]},{\"disparities\":[{\"category\":\"rwzwbng\",\"message\":\"itnwuizgazxufi\"},{\"category\":\"uckyf\",\"message\":\"hr\"},{\"category\":\"idf\",\"message\":\"zwdzuh\"},{\"category\":\"ymwisdkft\",\"message\":\"wxmnteiwao\"}]}],\"warnings\":[{\"disparities\":[{\"category\":\"ijcmmx\",\"message\":\"cufufsrpymz\"},{\"category\":\"dnsezcxtbzs\",\"message\":\"fycc\"},{\"category\":\"newmdwzjeiachbo\",\"message\":\"sflnrosfqp\"},{\"category\":\"eeh\",\"message\":\"zvypyqrimzinp\"}]}]}") + .toObject(MigrationValidationResponseInner.class); + Assertions.assertFalse(model.isValid()); + Assertions.assertEquals("kcprbnw", model.errors().get(0).disparities().get(0).category()); + Assertions.assertEquals("xgjvtbv", model.errors().get(0).disparities().get(0).message()); + Assertions.assertEquals("ijcmmx", model.warnings().get(0).disparities().get(0).category()); + Assertions.assertEquals("cufufsrpymz", model.warnings().get(0).disparities().get(0).message()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationWarningTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationWarningTests.java new file mode 100644 index 000000000000..29f7f6d192ef --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationValidationWarningTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationWarning; +import org.junit.jupiter.api.Assertions; + +public final class MigrationValidationWarningTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationValidationWarning model = BinaryData.fromString( + "{\"disparities\":[{\"category\":\"ysh\",\"message\":\"rzafbljjgpbtoqcj\"},{\"category\":\"klj\",\"message\":\"vbqid\"},{\"category\":\"qajzyulpkudjkr\",\"message\":\"khbzhfepgzg\"},{\"category\":\"e\",\"message\":\"zloc\"}]}") + .toObject(MigrationValidationWarning.class); + Assertions.assertEquals("ysh", model.disparities().get(0).category()); + Assertions.assertEquals("rzafbljjgpbtoqcj", model.disparities().get(0).message()); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateWithResponseMockTests.java new file mode 100644 index 000000000000..df9ac7f65be0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/MigrationsValidateWithResponseMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationRequest; +import com.azure.resourcemanager.redisenterprise.models.MigrationValidationResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MigrationsValidateWithResponseMockTests { + @Test + public void testValidateWithResponse() throws Exception { + String responseStr + = "{\"isValid\":false,\"errors\":[{\"disparities\":[{\"category\":\"nmic\",\"message\":\"kvceoveilovnotyf\"}]},{\"disparities\":[{\"category\":\"cnjbkcnxdhbt\",\"message\":\"kphywpnvjto\"}]},{\"disparities\":[{\"category\":\"ermclfplphoxuscr\",\"message\":\"abgy\"},{\"category\":\"psbjta\",\"message\":\"qugxywpmueefjzwf\"}]},{\"disparities\":[{\"category\":\"q\",\"message\":\"jidsuyonobglaoc\"},{\"category\":\"xtccmg\",\"message\":\"udxytlmoyrx\"},{\"category\":\"wfudwpzntxhdzhl\",\"message\":\"qj\"}]}],\"warnings\":[{\"disparities\":[{\"category\":\"frlh\",\"message\":\"xsbkyvpyca\"},{\"category\":\"uzbpzkafku\",\"message\":\"b\"},{\"category\":\"rnwb\",\"message\":\"ehhseyvjusrts\"}]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RedisEnterpriseManager manager = RedisEnterpriseManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MigrationValidationResponse response = manager.migrations() + .validateWithResponse("rdqmhjjdhtldwkyz", "uutkncw", + new MigrationValidationRequest().withSourceResourceId("cwsvlxotog") + .withSkipDataMigration(true) + .withForceMigrate(true), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertFalse(response.isValid()); + Assertions.assertEquals("nmic", response.errors().get(0).disparities().get(0).category()); + Assertions.assertEquals("kvceoveilovnotyf", response.errors().get(0).disparities().get(0).message()); + Assertions.assertEquals("frlh", response.warnings().get(0).disparities().get(0).category()); + Assertions.assertEquals("xsbkyvpyca", response.warnings().get(0).disparities().get(0).message()); + } +} 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 index 85b30aadb831..4dd37de1d865 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,17 +11,18 @@ public final class ModuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Module model = BinaryData.fromString("{\"name\":\"gmaajrm\",\"args\":\"jwzrl\",\"version\":\"mcl\"}") + Module model = BinaryData + .fromString("{\"name\":\"ailzydehojwyahu\",\"args\":\"npmqnjaqwixjspro\",\"version\":\"cputegjvwmfdats\"}") .toObject(Module.class); - Assertions.assertEquals("gmaajrm", model.name()); - Assertions.assertEquals("jwzrl", model.args()); + Assertions.assertEquals("ailzydehojwyahu", model.name()); + Assertions.assertEquals("npmqnjaqwixjspro", model.args()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Module model = new Module().withName("gmaajrm").withArgs("jwzrl"); + Module model = new Module().withName("ailzydehojwyahu").withArgs("npmqnjaqwixjspro"); model = BinaryData.fromObject(model).toObject(Module.class); - Assertions.assertEquals("gmaajrm", model.name()); - Assertions.assertEquals("jwzrl", model.args()); + Assertions.assertEquals("ailzydehojwyahu", model.name()); + Assertions.assertEquals("npmqnjaqwixjspro", 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 index 7b0e49090cbb..80306df0470d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -11,13 +11,7 @@ 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\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .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 index f3c6bea0d56e..d85a26830386 100644 --- 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 @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"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 index 3fd7015bf9ab..2397c0ff5733 100644 --- 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 @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.redisenterprise.models.OperationListResult; +import com.azure.resourcemanager.redisenterprise.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; 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\"}") + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); } } 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 index 8121fc2517ca..13ad1272837f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"ghsauuimjmvxied\",\"isDataAction\":false,\"display\":{\"provider\":\"yjr\",\"resource\":\"byao\",\"operation\":\"e\",\"description\":\"sonpclhocohs\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"onowk\",\"isDataAction\":true,\"display\":{\"provider\":\"nkixzbinj\",\"resource\":\"uttmrywnuzoqft\",\"operation\":\"qzrnkcqvyxlwhz\",\"description\":\"icohoqqnwvl\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); 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 index d7c144852b93..836407065a1e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -14,24 +14,25 @@ public final class PersistenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Persistence model = BinaryData - .fromString("{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"1s\",\"rdbFrequency\":\"6h\"}") + .fromString( + "{\"aofEnabled\":true,\"rdbEnabled\":false,\"aofFrequency\":\"always\",\"rdbFrequency\":\"12h\"}") .toObject(Persistence.class); Assertions.assertTrue(model.aofEnabled()); Assertions.assertFalse(model.rdbEnabled()); - Assertions.assertEquals(AofFrequency.ONES, model.aofFrequency()); - Assertions.assertEquals(RdbFrequency.SIXH, model.rdbFrequency()); + 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.ONES) - .withRdbFrequency(RdbFrequency.SIXH); + .withAofFrequency(AofFrequency.ALWAYS) + .withRdbFrequency(RdbFrequency.ONE_TWOH); model = BinaryData.fromObject(model).toObject(Persistence.class); Assertions.assertTrue(model.aofEnabled()); Assertions.assertFalse(model.rdbEnabled()); - Assertions.assertEquals(AofFrequency.ONES, model.aofFrequency()); - Assertions.assertEquals(RdbFrequency.SIXH, model.rdbFrequency()); + 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 index a5ff2dcc3c0a..af4caa84bdba 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -15,12 +15,12 @@ public final class PrivateEndpointConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"rwzoxxjtfelluwf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"np\",\"actionsRequired\":\"fpjkjlxofp\"},\"provisioningState\":\"Succeeded\"},\"id\":\"pfxxy\",\"name\":\"ininmay\",\"type\":\"uybbkpodep\"}") + "{\"properties\":{\"groupIds\":[\"mjqulngsn\",\"nbybkzgcwrwcl\",\"xwrljdouskcqvkoc\",\"cjdkwtnhxbnjbi\"],\"privateEndpoint\":{\"id\":\"rglssainqpj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ljfmppee\",\"actionsRequired\":\"mgxsab\"},\"provisioningState\":\"Failed\"},\"id\":\"uujitcjc\",\"name\":\"dzevndhkrw\",\"type\":\"d\"}") .toObject(PrivateEndpointConnectionInner.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("np", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("fpjkjlxofp", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("ljfmppee", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mgxsab", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -29,12 +29,12 @@ public void testSerialize() throws Exception { = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("np") - .withActionsRequired("fpjkjlxofp")); + .withDescription("ljfmppee") + .withActionsRequired("mgxsab")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("np", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("fpjkjlxofp", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("ljfmppee", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mgxsab", 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 index 4b1ebac3cb3c..488daf7572e5 100644 --- 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 @@ -1,49 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.redisenterprise.implementation.models.PrivateEndpointConnectionListResult; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateEndpointConnectionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"gacftadeh\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"yfsoppu\",\"actionsRequired\":\"esnzwde\"},\"provisioningState\":\"Succeeded\"},\"id\":\"vorxzdmohct\",\"name\":\"qvudwxdndnvowgu\",\"type\":\"jugwdkcglhsl\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"yggdtjixh\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"fqweykhmene\",\"actionsRequired\":\"yexfwh\"},\"provisioningState\":\"Failed\"},\"id\":\"i\",\"name\":\"vyvdcs\",\"type\":\"tynnaamdectehfi\"}]}") + "{\"value\":[{\"properties\":{\"groupIds\":[\"kbasyypn\",\"dhsgcba\",\"phejkotynqgoulz\"],\"privateEndpoint\":{\"id\":\"i\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"kgfg\",\"actionsRequired\":\"madgakeqsrxyb\"},\"provisioningState\":\"Failed\"},\"id\":\"dqytbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"},{\"properties\":{\"groupIds\":[\"duqkt\",\"pspwgcuertu\",\"kdosvqw\",\"bmdg\"],\"privateEndpoint\":{\"id\":\"f\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"bmbexppbhtqqro\",\"actionsRequired\":\"p\"},\"provisioningState\":\"Succeeded\"},\"id\":\"lgbquxig\",\"name\":\"yjgzjaoyfhrtxiln\",\"type\":\"rkujy\"}],\"nextLink\":\"l\"}") .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("yfsoppu", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("esnzwde", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model - = new PrivateEndpointConnectionListResult() - .withValue(Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("yfsoppu") - .withActionsRequired("esnzwde")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("fqweykhmene") - .withActionsRequired("yexfwh")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("yfsoppu", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("esnzwde", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("kgfg", model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("madgakeqsrxyb", + model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("l", model.nextLink()); } } 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 index ae7edbd99fdb..fe888bfdccea 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -15,12 +15,12 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"inuvamiheogn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xth\",\"actionsRequired\":\"tusivyevcciqihn\"},\"provisioningState\":\"Creating\"}") + "{\"groupIds\":[\"dsbdkvwrwjf\"],\"privateEndpoint\":{\"id\":\"nhutjeltmrldhugj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"tqxhocdgeab\",\"actionsRequired\":\"phut\"},\"provisioningState\":\"Succeeded\"}") .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xth", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tusivyevcciqihn", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("tqxhocdgeab", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("phut", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -28,13 +28,13 @@ public void testSerialize() throws Exception { PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("xth") - .withActionsRequired("tusivyevcciqihn")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("tqxhocdgeab") + .withActionsRequired("phut")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xth", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tusivyevcciqihn", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("tqxhocdgeab", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("phut", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteMockTests.java index d93b57ea994b..eb50d37e0034 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -28,7 +28,7 @@ public void testDelete() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.privateEndpointConnections() - .delete("szjfauvjfdxxivet", "t", "qaqtdoqmcbxvwvxy", com.azure.core.util.Context.NONE); + .delete("lcuhxwtctyqiklb", "ovplw", "bhvgy", 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 index 242741d9a145..e8c0c771c6da 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -22,7 +22,7 @@ public final class PrivateEndpointConnectionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"pcqeqx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ahzxctobgbk\",\"actionsRequired\":\"oizpostmgrcfbun\"},\"provisioningState\":\"Failed\"},\"id\":\"qjhhkxbpv\",\"name\":\"ymjhxxjyngudivkr\",\"type\":\"swbxqz\"}"; + = "{\"properties\":{\"groupIds\":[\"xaepdkzjancuxr\",\"d\"],\"privateEndpoint\":{\"id\":\"v\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"wd\",\"actionsRequired\":\"wz\"},\"provisioningState\":\"Deleting\"},\"id\":\"pgn\",\"name\":\"ytxhp\",\"type\":\"xbzpfzab\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +32,12 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("oellwp", "fdygpfqbuaceopz", "qrhhu", com.azure.core.util.Context.NONE) + .getWithResponse("yazttbtwwrqpue", "ckzywbiexzfeyue", "xibxujwbhqwalm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ahzxctobgbk", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("oizpostmgrcfbun", response.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("wd", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wz", 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 index 39dabf2cf36a..4580691bee7b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -23,7 +23,7 @@ public final class PrivateEndpointConnectionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"napnyiropuhpigv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gqgitxmedjvcsl\",\"actionsRequired\":\"qwwncw\"},\"provisioningState\":\"Succeeded\"},\"id\":\"xgk\",\"name\":\"rmgucnap\",\"type\":\"t\"}]}"; + = "{\"value\":[{\"properties\":{\"groupIds\":[\"gmgsxnkjzkde\"],\"privateEndpoint\":{\"id\":\"vlopwiyighx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"zb\",\"actionsRequired\":\"uebbaumnyqup\"},\"provisioningState\":\"Creating\"},\"id\":\"jn\",\"name\":\"bckhsmtxpsi\",\"type\":\"btfhvpesaps\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,13 +33,12 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.privateEndpointConnections().list("hb", "xknalaulppg", com.azure.core.util.Context.NONE); + = manager.privateEndpointConnections().list("gu", "svmkfssxquk", com.azure.core.util.Context.NONE); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gqgitxmedjvcsl", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("qwwncw", + Assertions.assertEquals("zb", response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("uebbaumnyqup", 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 index 091b89136801..58acdd63843e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"bwjzr\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"vkaozwyiftyhxhur\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test 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 index 4caebaa790f9..a187a16846b1 100644 --- 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 @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"noae\",\"requiredMembers\":[\"hy\",\"ltrpmopj\",\"cma\",\"u\"],\"requiredZoneNames\":[\"hfuiuaodsfc\",\"kvxod\",\"uozmyzydagfua\",\"bezy\"]},\"id\":\"uokktwhrdxwz\",\"name\":\"wqsmbsur\",\"type\":\"xim\"}") + "{\"properties\":{\"groupId\":\"c\",\"requiredMembers\":[\"wooc\",\"cbonqvpk\",\"lrxnjeaseiphe\"],\"requiredZoneNames\":[\"okeyyienj\",\"dlwtgrhpdj\"]},\"id\":\"umasxazjpq\",\"name\":\"e\",\"type\":\"ualhbxxhejj\"}") .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("hfuiuaodsfc", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("hfuiuaodsfc", "kvxod", "uozmyzydagfua", "bezy")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("hfuiuaodsfc", model.requiredZoneNames().get(0)); + Assertions.assertEquals("okeyyienj", 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 index 0e499d6c2f81..f61deeb2f771 100644 --- 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 @@ -1,29 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.redisenterprise.implementation.models.PrivateLinkResourceListResult; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"ypvhezrkg\",\"requiredMembers\":[\"jrefovgmkqsle\"],\"requiredZoneNames\":[\"xyqj\",\"k\",\"attpngjcrcczsq\",\"jh\"]},\"id\":\"mdajv\",\"name\":\"ysou\",\"type\":\"q\"}]}") + "{\"value\":[{\"properties\":{\"groupId\":\"gndrvynh\",\"requiredMembers\":[\"phrcgyncoc\",\"ecfvmm\",\"oo\"],\"requiredZoneNames\":[\"lzevgbmqjqab\",\"y\",\"mivkwlzuvcc\",\"wnfnbacf\"]},\"id\":\"nlebxetqgtzxd\",\"name\":\"nqbqqwxr\",\"type\":\"feallnwsu\"}],\"nextLink\":\"snjampmng\"}") .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("xyqj", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult().withValue(Arrays.asList( - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("xyqj", "k", "attpngjcrcczsq", "jh")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("xyqj", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("lzevgbmqjqab", model.value().get(0).requiredZoneNames().get(0)); } } 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 index 45ba35660a36..13997e479c64 100644 --- 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 @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"yocf\",\"requiredMembers\":[\"s\",\"mddystkiiux\"],\"requiredZoneNames\":[\"udxorrqn\",\"poczvyifqrvkdvjs\",\"lrmv\"]}") + "{\"groupId\":\"v\",\"requiredMembers\":[\"gwdslfhotwm\",\"ynpwlbj\",\"pgacftadehxnlty\"],\"requiredZoneNames\":[\"ppusuesnzwdejba\",\"orxzdmohctbqvud\",\"xdn\"]}") .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("udxorrqn", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("udxorrqn", "poczvyifqrvkdvjs", "lrmv")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("udxorrqn", model.requiredZoneNames().get(0)); + Assertions.assertEquals("ppusuesnzwdejba", 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 index 034606c1c88e..4940b645046c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -22,7 +22,7 @@ public final class PrivateLinkResourcesListByClusterMockTests { @Test public void testListByCluster() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"blmpewww\",\"requiredMembers\":[\"rvrnsvshqjohxc\",\"sbfov\"],\"requiredZoneNames\":[\"ruvw\",\"hsqfsubcgjbirxbp\",\"bsrfbj\"]},\"id\":\"dtws\",\"name\":\"otftpvjzbexilz\",\"type\":\"nfqqnvwp\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"wuwprzqlv\",\"requiredMembers\":[\"lupj\",\"khfxobbcswsrt\"],\"requiredZoneNames\":[\"plrbpbewtghf\",\"blcg\",\"xzvlvqhjkbegib\",\"nmxiebwwaloayqc\"]},\"id\":\"rtzju\",\"name\":\"gwyzm\",\"type\":\"txon\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,8 +32,8 @@ public void testListByCluster() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.privateLinkResources().listByCluster("lqbhsf", "obl", com.azure.core.util.Context.NONE); + = manager.privateLinkResources().listByCluster("auwhvylwzbtdhx", "jznb", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ruvw", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("plrbpbewtghf", 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 index 4863cc40af43..bf7be4a21ddf 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,22 +13,22 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Approved\",\"description\":\"xgispemvtzfkufu\",\"actionsRequired\":\"jofxqe\"}") + .fromString("{\"status\":\"Rejected\",\"description\":\"yxolniwp\",\"actionsRequired\":\"ukjfkgiawxklr\"}") .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("xgispemvtzfkufu", model.description()); - Assertions.assertEquals("jofxqe", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); + Assertions.assertEquals("yxolniwp", model.description()); + Assertions.assertEquals("ukjfkgiawxklr", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("xgispemvtzfkufu") - .withActionsRequired("jofxqe"); + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("yxolniwp") + .withActionsRequired("ukjfkgiawxklr"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("xgispemvtzfkufu", model.description()); - Assertions.assertEquals("jofxqe", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); + Assertions.assertEquals("yxolniwp", model.description()); + Assertions.assertEquals("ukjfkgiawxklr", model.actionsRequired()); } } 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 index f81ceb10f1ee..e475b99b0a61 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.redisEnterprises().delete("ptkoenkoukn", "udwtiukbl", com.azure.core.util.Context.NONE); + manager.redisEnterprises().delete("ualaexqpvfadmw", "rcrgvx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListSkusForScalingWithResponseMockTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListSkusForScalingWithResponseMockTests.java index 35ba3e5bf890..0917ab07fea4 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListSkusForScalingWithResponseMockTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterprisesListSkusForScalingWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -20,7 +20,7 @@ public final class RedisEnterprisesListSkusForScalingWithResponseMockTests { @Test public void testListSkusForScalingWithResponse() throws Exception { String responseStr - = "{\"skus\":[{\"name\":\"ttxfvjr\",\"sizeInGB\":8.868826},{\"name\":\"hxepcyvahfnlj\",\"sizeInGB\":13.063425},{\"name\":\"j\",\"sizeInGB\":45.996456},{\"name\":\"qgidokgjljyo\",\"sizeInGB\":65.12365}]}"; + = "{\"skus\":[{\"name\":\"wfvovbv\",\"sizeInGB\":46.67336},{\"name\":\"civyhzceuo\",\"sizeInGB\":67.35784},{\"name\":\"wjue\",\"sizeInGB\":18.602175}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +30,7 @@ public void testListSkusForScalingWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SkuDetailsList response = manager.redisEnterprises() - .listSkusForScalingWithResponse("qhjfbebr", "cxerf", com.azure.core.util.Context.NONE) + .listSkusForScalingWithResponse("sowzxcugi", "jooxdjebw", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsListInnerTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsListInnerTests.java index 5a03be69b0a6..9430c92b9cd9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsListInnerTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsListInnerTests.java @@ -1,25 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.redisenterprise.fluent.models.SkuDetailsListInner; -import com.azure.resourcemanager.redisenterprise.models.SkuDetails; -import java.util.Arrays; public final class SkuDetailsListInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SkuDetailsListInner model - = BinaryData.fromString("{\"skus\":[{\"name\":\"xxhejjzzvd\",\"sizeInGB\":63.329147}]}") - .toObject(SkuDetailsListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuDetailsListInner model = new SkuDetailsListInner().withSkus(Arrays.asList(new SkuDetails())); - model = BinaryData.fromObject(model).toObject(SkuDetailsListInner.class); + SkuDetailsListInner model = BinaryData.fromString( + "{\"skus\":[{\"name\":\"xkrxdqmi\",\"sizeInGB\":15.739637},{\"name\":\"zrvqdr\",\"sizeInGB\":78.99524},{\"name\":\"yb\",\"sizeInGB\":69.505775},{\"name\":\"oqfbowskanyk\",\"sizeInGB\":83.54532}]}") + .toObject(SkuDetailsListInner.class); } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsTests.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsTests.java index 3f06bc1dbc1d..150d6bf00ac6 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsTests.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/test/java/com/azure/resourcemanager/redisenterprise/generated/SkuDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -10,13 +10,6 @@ public final class SkuDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SkuDetails model - = BinaryData.fromString("{\"name\":\"dslfhotwmcy\",\"sizeInGB\":86.83051}").toObject(SkuDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuDetails model = new SkuDetails(); - model = BinaryData.fromObject(model).toObject(SkuDetails.class); + SkuDetails model = BinaryData.fromString("{\"name\":\"u\",\"sizeInGB\":29.401552}").toObject(SkuDetails.class); } } 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 index d6c51bc443a3..6d93405f1577 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -13,16 +13,16 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Sku model - = BinaryData.fromString("{\"name\":\"ComputeOptimized_X500\",\"capacity\":825844249}").toObject(Sku.class); - Assertions.assertEquals(SkuName.COMPUTE_OPTIMIZED_X500, model.name()); - Assertions.assertEquals(825844249, model.capacity()); + = BinaryData.fromString("{\"name\":\"ComputeOptimized_X3\",\"capacity\":1295358777}").toObject(Sku.class); + Assertions.assertEquals(SkuName.COMPUTE_OPTIMIZED_X3, model.name()); + Assertions.assertEquals(1295358777, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.COMPUTE_OPTIMIZED_X500).withCapacity(825844249); + Sku model = new Sku().withName(SkuName.COMPUTE_OPTIMIZED_X3).withCapacity(1295358777); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.COMPUTE_OPTIMIZED_X500, model.name()); - Assertions.assertEquals(825844249, model.capacity()); + Assertions.assertEquals(SkuName.COMPUTE_OPTIMIZED_X3, model.name()); + Assertions.assertEquals(1295358777, model.capacity()); } } 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 index 5516524fcbf7..2b1003a6a700 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.redisenterprise.generated; @@ -10,8 +10,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"942b2ccd-109b-4808-94c9-47b8f5f29a29\",\"clientId\":\"e6ed9d5b-115e-4b86-888c-f4e250301ff4\"}") + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"pyeicxm\",\"clientId\":\"iwqvhkh\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/tsp-location.yaml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/tsp-location.yaml new file mode 100644 index 000000000000..a52df7e6bed6 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise +commit: 9bb28560c09f7e60f6df095e9530d27f77748bdf +repo: Azure/azure-rest-api-specs +additionalDirectories: