From 9565d49a75d300f60c94c136adf80c3dcf27e01d Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 11:58:01 +0800 Subject: [PATCH 1/8] Regenerate Redis SDK from TypeSpec, add revapi suppressions - Regenerated SDK code from TypeSpec - Added module-info.java opens for implementation.models - Added revapi suppressions for: - Read-only model constructors made private - Read-only model setters removed - OperationStatusResult setters visibility reduced - Pageable ListResult classes moved to implementation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/lintingconfigs/revapi/track2/revapi.json | 32 + .../azure-resourcemanager-redis/CHANGELOG.md | 72 +- .../azure-resourcemanager-redis/README.md | 2 +- .../redis/fluent/AccessPoliciesClient.java | 124 +- .../fluent/AccessPolicyAssignmentsClient.java | 126 +- .../fluent/AsyncOperationStatusClient.java | 2 +- .../redis/fluent/FirewallRulesClient.java | 112 +- .../redis/fluent/LinkedServersClient.java | 168 +-- .../redis/fluent/OperationsClient.java | 8 +- .../redis/fluent/PatchSchedulesClient.java | 134 +- .../PrivateEndpointConnectionsClient.java | 87 +- .../fluent/PrivateLinkResourcesClient.java | 2 +- .../redis/fluent/RedisClient.java | 326 +++-- .../redis/fluent/RedisManagementClient.java | 68 +- .../redis/fluent/models/OperationInner.java | 30 +- .../fluent/models/OperationStatusInner.java | 149 ++- .../PrivateEndpointConnectionInner.java | 33 +- .../PrivateEndpointConnectionProperties.java | 28 +- .../models/PrivateLinkResourceInner.java | 41 +- .../models/PrivateLinkResourceProperties.java | 23 +- .../fluent/models/RedisAccessKeysInner.java | 4 +- ...RedisCacheAccessPolicyAssignmentInner.java | 19 +- ...CacheAccessPolicyAssignmentProperties.java | 2 +- .../models/RedisCacheAccessPolicyInner.java | 19 +- .../RedisCacheAccessPolicyProperties.java | 2 +- .../fluent/models/RedisCreateProperties.java | 2 +- .../fluent/models/RedisFirewallRuleInner.java | 30 +- .../models/RedisFirewallRuleProperties.java | 2 +- .../models/RedisForceRebootResponseInner.java | 4 +- .../RedisLinkedServerCreateProperties.java | 2 +- .../models/RedisLinkedServerProperties.java | 35 +- .../RedisLinkedServerWithPropertiesInner.java | 67 +- .../models/RedisPatchScheduleInner.java | 19 +- .../fluent/models/RedisPropertiesInner.java | 20 +- .../fluent/models/RedisResourceInner.java | 45 +- .../fluent/models/RedisUpdateProperties.java | 2 +- .../redis/fluent/models/ScheduleEntries.java | 2 +- .../models/UpgradeNotificationInner.java | 4 +- .../redis/fluent/models/package-info.java | 2 +- .../redis/fluent/package-info.java | 2 +- .../AccessPoliciesClientImpl.java | 405 +++--- .../AccessPolicyAssignmentsClientImpl.java | 400 +++--- .../AsyncOperationStatusClientImpl.java | 18 +- .../FirewallRulesClientImpl.java | 347 ++--- .../LinkedServersClientImpl.java | 467 +++---- .../implementation/OperationsClientImpl.java | 24 +- .../PatchSchedulesClientImpl.java | 394 +++--- .../PrivateEndpointConnectionsClientImpl.java | 473 ++++--- .../PrivateLinkResourcesClientImpl.java | 109 +- .../redis/implementation/RedisClientImpl.java | 1160 ++++++++--------- .../RedisManagementClientBuilder.java | 28 +- .../RedisManagementClientImpl.java | 152 +-- .../models/NotificationListResponse.java | 39 +- .../models/OperationListResult.java | 31 +- .../PrivateEndpointConnectionListResult.java | 44 +- .../models/PrivateLinkResourceListResult.java | 44 +- .../RedisCacheAccessPolicyAssignmentList.java | 40 +- .../models/RedisCacheAccessPolicyList.java | 40 +- .../models/RedisFirewallRuleListResult.java | 42 +- .../RedisLinkedServerWithPropertiesList.java | 40 +- .../models/RedisListResult.java | 39 +- .../models/RedisPatchScheduleListResult.java | 42 +- ...cessPolicyAssignmentProvisioningState.java | 16 +- .../models/AccessPolicyProvisioningState.java | 16 +- .../redis/models/AccessPolicyType.java | 6 +- .../CheckNameAvailabilityParameters.java | 2 +- .../redis/models/DayOfWeek.java | 6 +- .../redis/models/DefaultName.java | 6 +- .../redis/models/ExportRdbParameters.java | 2 +- .../redis/models/ImportRdbParameters.java | 2 +- .../redis/models/ManagedServiceIdentity.java | 25 +- .../models/ManagedServiceIdentityType.java | 10 +- .../redis/models/OperationDisplay.java | 52 +- .../redis/models/OperationStatusResult.java | 30 +- .../redis/models/PrivateEndpoint.java | 8 +- ...teEndpointConnectionProvisioningState.java | 10 +- ...rivateEndpointServiceConnectionStatus.java | 8 +- .../PrivateLinkServiceConnectionState.java | 2 +- .../redis/models/ProvisioningState.java | 54 +- .../redis/models/PublicNetworkAccess.java | 7 +- .../redis/models/RebootType.java | 8 +- .../redis/models/RedisCommonProperties.java | 9 +- .../redis/models/RedisConfiguration.java | 26 +- .../redis/models/RedisCreateParameters.java | 6 +- .../RedisFirewallRuleCreateParameters.java | 20 +- .../redis/models/RedisInstanceDetails.java | 4 +- .../redis/models/RedisKeyType.java | 6 +- .../redis/models/RedisLinkedServer.java | 4 +- .../RedisLinkedServerCreateParameters.java | 2 +- .../redis/models/RedisRebootParameters.java | 2 +- .../models/RedisRegenerateKeyParameters.java | 2 +- .../redis/models/RedisUpdateParameters.java | 6 +- .../redis/models/ReplicationRole.java | 6 +- .../redis/models/ScheduleEntry.java | 2 +- .../resourcemanager/redis/models/Sku.java | 2 +- .../redis/models/SkuFamily.java | 6 +- .../resourcemanager/redis/models/SkuName.java | 9 +- .../redis/models/TlsVersion.java | 9 +- .../redis/models/UpdateChannel.java | 8 +- .../redis/models/UserAssignedIdentity.java | 2 +- .../redis/models/ZonalAllocationPolicy.java | 9 +- .../redis/models/package-info.java | 2 +- .../resourcemanager/redis/package-info.java | 2 +- .../src/main/java/module-info.java | 1 + .../azure-resourcemanager-redis_metadata.json | 1 + ...ssPolicyAssignmentCreateUpdateSamples.java | 31 + .../AccessPolicyAssignmentDeleteSamples.java | 24 + .../AccessPolicyAssignmentGetSamples.java | 24 + .../AccessPolicyAssignmentListSamples.java | 22 + .../AccessPolicyCreateUpdateSamples.java | 27 + .../generated/AccessPolicyDeleteSamples.java | 24 + .../generated/AccessPolicyGetSamples.java | 24 + .../generated/AccessPolicyListSamples.java | 22 + .../AsyncOperationStatusGetSamples.java | 24 + .../FirewallRulesCreateOrUpdateSamples.java | 28 + .../generated/FirewallRulesDeleteSamples.java | 24 + .../generated/FirewallRulesGetSamples.java | 24 + .../generated/FirewallRulesListSamples.java | 22 + .../generated/LinkedServerCreateSamples.java | 30 + .../generated/LinkedServerDeleteSamples.java | 22 + .../generated/LinkedServerGetSamples.java | 24 + .../generated/LinkedServerListSamples.java | 22 + .../generated/OperationsListSamples.java | 22 + .../PatchSchedulesCreateOrUpdateSamples.java | 37 + .../PatchSchedulesDeleteSamples.java | 26 + .../generated/PatchSchedulesGetSamples.java | 26 + ...chSchedulesListByRedisResourceSamples.java | 24 + ...ivateEndpointConnectionsDeleteSamples.java | 24 + .../PrivateEndpointConnectionsGetSamples.java | 24 + ...PrivateEndpointConnectionsListSamples.java | 24 + .../PrivateEndpointConnectionsPutSamples.java | 32 + ...eLinkResourcesListByRedisCacheSamples.java | 24 + .../RedisCheckNameAvailabilitySamples.java | 28 + .../redis/generated/RedisCreateSamples.java | 190 +++ .../redis/generated/RedisDeleteSamples.java | 22 + .../generated/RedisExportDataSamples.java | 31 + .../generated/RedisFlushCacheSamples.java | 24 + .../generated/RedisForceRebootSamples.java | 32 + .../RedisGetByResourceGroupSamples.java | 24 + .../generated/RedisImportDataSamples.java | 31 + .../RedisListByResourceGroupSamples.java | 22 + .../redis/generated/RedisListKeysSamples.java | 22 + .../redis/generated/RedisListSamples.java | 22 + .../RedisListUpgradeNotificationsSamples.java | 24 + .../generated/RedisRegenerateKeySamples.java | 28 + .../redis/generated/RedisUpdateSamples.java | 27 + .../tsp-location.yaml | 4 + 147 files changed, 4708 insertions(+), 3149 deletions(-) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/NotificationListResponse.java (75%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/OperationListResult.java (81%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/PrivateEndpointConnectionListResult.java (66%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/PrivateLinkResourceListResult.java (66%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisCacheAccessPolicyAssignmentList.java (75%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisCacheAccessPolicyList.java (74%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisFirewallRuleListResult.java (73%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisLinkedServerWithPropertiesList.java (75%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisListResult.java (74%) rename sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/{ => implementation}/models/RedisPatchScheduleListResult.java (73%) create mode 100644 sdk/redis/azure-resourcemanager-redis/src/main/resources/META-INF/azure-resourcemanager-redis_metadata.json create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentCreateUpdateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyCreateUpdateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AsyncOperationStatusGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesCreateOrUpdateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerCreateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/OperationsListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesCreateOrUpdateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesListByRedisResourceSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsPutSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateLinkResourcesListByRedisCacheSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCheckNameAvailabilitySamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCreateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisDeleteSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisExportDataSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisFlushCacheSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisForceRebootSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisGetByResourceGroupSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisImportDataSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListByResourceGroupSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListKeysSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListUpgradeNotificationsSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisRegenerateKeySamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisUpdateSamples.java create mode 100644 sdk/redis/azure-resourcemanager-redis/tsp-location.yaml diff --git a/eng/lintingconfigs/revapi/track2/revapi.json b/eng/lintingconfigs/revapi/track2/revapi.json index 0121258355a2b..b555d7df00bb2 100644 --- a/eng/lintingconfigs/revapi/track2/revapi.json +++ b/eng/lintingconfigs/revapi/track2/revapi.json @@ -1337,6 +1337,38 @@ "match": "class com\\.azure\\.resourcemanager\\.compute\\.models\\.(CommunityGalleryImageList|CommunityGalleryImageVersionList|DiskAccessList|DiskEncryptionSetList|DiskList|DiskRestorePointList|GalleryApplicationList|GalleryApplicationVersionList|GalleryImageList|GalleryImageVersionList|GalleryInVMAccessControlProfileList|GalleryInVMAccessControlProfileVersionList|GalleryList|GalleryScriptList|GalleryScriptVersionList|GallerySoftDeletedResourceList|ResourceUriList|SharedGalleryImageList|SharedGalleryImageVersionList|SharedGalleryList|SnapshotList|VirtualMachineScaleSetListOSUpgradeHistory)" }, "justification": "Pageable models moved to implementation package. Unlikely used by user." + }, + { + "code": "java.method.visibilityReduced", + "old" : { + "matcher": "regex", + "match": "method void com\\.azure\\.resourcemanager\\.redis\\.models\\.(OperationDisplay|RedisInstanceDetails|RedisLinkedServer)::\\\\(\\)" + }, + "justification": "Output-only immutable models' constructors are now private." + }, + { + "code": "java.method.removed", + "old" : { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.redis\\.models\\.OperationDisplay\\:\\:with.*\\(.*\\).*" + }, + "justification": "Output-only immutable models' setters are removed if no explicit usage." + }, + { + "code": "java.method.visibilityReduced", + "old" : { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.redis\\.models\\.OperationStatusResult\\:\\:with.*\\(.*\\).*" + }, + "justification": "Output-only immutable models' setters are now package-private if it's being used by child class." + }, + { + "code": "java.class.removed", + "old" : { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.redis\\.models\\.(OperationListResult|RedisListResult|RedisCacheAccessPolicyAssignmentList|RedisFirewallRuleListResult|RedisPatchScheduleListResult|RedisCacheAccessPolicyList|PrivateLinkResourceListResult|NotificationListResponse|PrivateEndpointConnectionListResult|RedisLinkedServerWithPropertiesList)" + }, + "justification": "Pageable models moved to implementation package. Unlikely used by user." } ] } diff --git a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md index 5a64072519538..eace44d6b665f 100644 --- a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md +++ b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md @@ -1,16 +1,78 @@ # Release History -## 2.54.0-beta.1 (Unreleased) +## 2.54.0-beta.1 (2026-04-01) + +### Breaking Changes + +#### `models.OperationListResult` was removed + +#### `models.RedisListResult` was removed + +#### `models.RedisCacheAccessPolicyAssignmentList` was removed + +#### `models.RedisFirewallRuleListResult` was removed + +#### `models.RedisPatchScheduleListResult` was removed + +#### `models.RedisCacheAccessPolicyList` was removed + +#### `models.PrivateLinkResourceListResult` was removed + +#### `models.NotificationListResponse` was removed + +#### `models.PrivateEndpointConnectionListResult` was removed + +#### `models.RedisLinkedServerWithPropertiesList` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed + +#### `models.RedisInstanceDetails` was modified + +* `RedisInstanceDetails()` was changed to private access + +#### `models.OperationStatusResult` was modified + +* `models.OperationStatusResult withStatus(java.lang.String)` -> `models.OperationStatusResult withStatus(java.lang.String)` +* `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` +* `models.OperationStatusResult withOperations(java.util.List)` -> `models.OperationStatusResult withOperations(java.util.List)` +* `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` -> `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` +* `withPercentComplete(java.lang.Float)` was removed +* `models.OperationStatusResult withId(java.lang.String)` -> `models.OperationStatusResult withId(java.lang.String)` +* `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` +* `java.lang.Float percentComplete()` -> `java.lang.Double percentComplete()` +* `models.OperationStatusResult withName(java.lang.String)` -> `models.OperationStatusResult withName(java.lang.String)` + +#### `models.RedisLinkedServer` was modified + +* `RedisLinkedServer()` was changed to private access ### Features Added -- Supported enabling/disabling authentication through access keys for `RedisCache`. +#### `models.RedisCache` was modified -### Breaking Changes +* `isAccessKeyAuthenticationEnabled()` was added -### Bugs Fixed +#### `models.ProvisioningState` was modified -### Other Changes +* `MIGRATING` was added +* `MIGRATION_SUCCEEDED` was added +* `MIGRATION_FAILED` was added +* `MIGRATION_CANCELLATION_FAILED` was added +* `MIGRATION_CANCELLING` was added + +#### `models.RedisFirewallRuleCreateParameters` was modified + +* `systemData()` was added + +#### `models.RedisCachePremium` was modified + +* `isAccessKeyAuthenticationEnabled()` was added ## 2.53.6 (2026-01-29) diff --git a/sdk/redis/azure-resourcemanager-redis/README.md b/sdk/redis/azure-resourcemanager-redis/README.md index 665327d7d20a8..516ac88fb86ba 100644 --- a/sdk/redis/azure-resourcemanager-redis/README.md +++ b/sdk/redis/azure-resourcemanager-redis/README.md @@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager-redis - 2.53.1 + 2.54.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPoliciesClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPoliciesClient.java index 76e086534cbb5..08693bdaf219c 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPoliciesClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPoliciesClient.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.redis.fluent; @@ -22,6 +22,67 @@ * An instance of this class provides access to all the operations defined in AccessPoliciesClient. */ public interface AccessPoliciesClient { + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String accessPolicyName); + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String cacheName, String accessPolicyName); + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cacheName, + String accessPolicyName, Context context); + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisCacheAccessPolicyInner get(String resourceGroupName, String cacheName, String accessPolicyName); + /** * Adds an access policy to the redis cache. * @@ -238,67 +299,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String cacheName, String accessPolicyName, Context context); - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String cacheName, - String accessPolicyName); - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String cacheName, String accessPolicyName); - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String cacheName, - String accessPolicyName, Context context); - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RedisCacheAccessPolicyInner get(String resourceGroupName, String cacheName, String accessPolicyName); - /** * Gets the list of access policies associated with this redis cache. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPolicyAssignmentsClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPolicyAssignmentsClient.java index 29cabbdb64bdc..88535f89e785e 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AccessPolicyAssignmentsClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.fluent; @@ -22,6 +22,68 @@ * An instance of this class provides access to all the operations defined in AccessPolicyAssignmentsClient. */ public interface AccessPolicyAssignmentsClient { + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the access policy assignment. + * @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 list of assignments for an access policy of a redis cache along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String cacheName, String accessPolicyAssignmentName); + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the access policy assignment. + * @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 list of assignments for an access policy of a redis cache on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName); + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the access policy assignment. + * @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 list of assignments for an access policy of a redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName, Context context); + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the access policy assignment. + * @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 list of assignments for an access policy of a redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisCacheAccessPolicyAssignmentInner get(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName); + /** * Adds the access policy assignment to the specified users. * @@ -242,68 +304,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String cacheName, String accessPolicyAssignmentName, Context context); - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @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 list of assignments for an access policy of a redis cache along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, - String cacheName, String accessPolicyAssignmentName); - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @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 list of assignments for an access policy of a redis cache on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName); - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @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 list of assignments for an access policy of a redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName, Context context); - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @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 list of assignments for an access policy of a redis cache. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RedisCacheAccessPolicyAssignmentInner get(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName); - /** * Gets the list of access policy assignments associated with this redis cache. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AsyncOperationStatusClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AsyncOperationStatusClient.java index 05a158f0c94ee..2b36cbdcd0189 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AsyncOperationStatusClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/AsyncOperationStatusClient.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.redis.fluent; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/FirewallRulesClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/FirewallRulesClient.java index 4958e01047bb3..e557cf19b23a3 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/FirewallRulesClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/FirewallRulesClient.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.redis.fluent; @@ -18,44 +18,64 @@ */ public interface FirewallRulesClient { /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @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 firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. + * @return a single firewall rule in a specified redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String cacheName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String ruleName); /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + * @return a single firewall rule in a specified redis cache on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String cacheName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String cacheName, String ruleName); /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + * @return a single firewall rule in a specified redis cache along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String cacheName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cacheName, String ruleName, + Context context); + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single firewall rule in a specified redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisFirewallRuleInner get(String resourceGroupName, String cacheName, String ruleName); /** * Create or update a redis cache firewall rule. @@ -127,7 +147,7 @@ RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName RedisFirewallRuleInner parameters); /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -135,15 +155,13 @@ RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single firewall rule in a specified redis cache along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String cacheName, - String ruleName); + Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName); /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -151,13 +169,13 @@ Mono> getWithResponseAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single firewall rule in a specified redis cache on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String cacheName, String ruleName); + Mono deleteAsync(String resourceGroupName, String cacheName, String ruleName); /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -166,25 +184,10 @@ Mono> getWithResponseAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single firewall rule in a specified redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String cacheName, String ruleName, - Context context); - - /** - * Gets a single firewall rule in a specified redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single firewall rule in a specified redis cache. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RedisFirewallRuleInner get(String resourceGroupName, String cacheName, String ruleName); + Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, Context context); /** * Deletes a single firewall rule in a specified redis cache. @@ -195,50 +198,47 @@ Response getWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName); + void delete(String resourceGroupName, String cacheName, String ruleName); /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return all firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String cacheName, String ruleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String cacheName); /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return all firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cacheName); /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. + * @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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cacheName, String ruleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cacheName, Context context); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/LinkedServersClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/LinkedServersClient.java index e89ded558585e..efe5c2439da9b 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/LinkedServersClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/LinkedServersClient.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.redis.fluent; @@ -23,12 +23,74 @@ * An instance of this class provides access to all the operations defined in LinkedServersClient. */ public interface LinkedServersClient { + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String name, + String linkedServerName); + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU) on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String name, String linkedServerName); + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String name, + String linkedServerName, Context context); + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisLinkedServerWithPropertiesInner get(String resourceGroupName, String name, String linkedServerName); + /** * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -44,8 +106,8 @@ Mono>> createWithResponseAsync(String resourceGroupNam * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,8 +123,8 @@ PollerFlux, RedisLinkedServerWi * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -78,8 +140,8 @@ SyncPoller, RedisLinkedServerWi * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,8 +159,8 @@ SyncPoller, RedisLinkedServerWi * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -114,8 +176,8 @@ Mono createAsync(String resourceGroupName, * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -130,8 +192,8 @@ RedisLinkedServerWithPropertiesInner create(String resourceGroupName, String nam * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,7 +210,7 @@ RedisLinkedServerWithPropertiesInner create(String resourceGroupName, String nam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -163,7 +225,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -177,7 +239,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -191,7 +253,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -207,7 +269,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -221,7 +283,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -234,7 +296,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -243,68 +305,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String name, String linkedServerName, Context context); - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String name, - String linkedServerName); - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU) on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String name, String linkedServerName); - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String name, - String linkedServerName, Context context); - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RedisLinkedServerWithPropertiesInner get(String resourceGroupName, String name, String linkedServerName); - /** * Gets the list of linked servers associated with this redis cache (requires Premium SKU). * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/OperationsClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/OperationsClient.java index bc26dc891ab32..50623b7841309 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/OperationsClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.fluent; @@ -16,7 +16,7 @@ */ public interface OperationsClient { /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @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. @@ -26,7 +26,7 @@ public interface OperationsClient { PagedFlux listAsync(); /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @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. @@ -36,7 +36,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PatchSchedulesClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PatchSchedulesClient.java index aec40c6eadde6..16de06fc5e9d4 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PatchSchedulesClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PatchSchedulesClient.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.redis.fluent; @@ -19,55 +19,71 @@ */ public interface PatchSchedulesClient { /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedFlux}. + * @return the patching schedule of a redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String name, + DefaultName defaultParameter); /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedIterable}. + * @return the patching schedule of a redis cache on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRedisResource(String resourceGroupName, String cacheName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String name, DefaultName defaultParameter); /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedIterable}. + * @return the patching schedule of a redis cache along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRedisResource(String resourceGroupName, String cacheName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String name, + DefaultName defaultParameter, Context context); + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. + * @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 patching schedule of a redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter); /** * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,8 +99,8 @@ Mono> createOrUpdateWithResponseAsync(String r * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -99,8 +115,8 @@ Mono createOrUpdateAsync(String resourceGroupName, Stri * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,8 +132,8 @@ Response createOrUpdateWithResponse(String resourceGrou * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -133,7 +149,7 @@ RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String name, De * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -147,7 +163,7 @@ RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String name, De * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -161,7 +177,7 @@ RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String name, De * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -177,7 +193,7 @@ Response deleteWithResponse(String resourceGroupName, String name, Default * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -186,62 +202,46 @@ Response deleteWithResponse(String resourceGroupName, String name, Default void delete(String resourceGroupName, String name, DefaultName defaultParameter); /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @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 patching schedule of a redis cache along with {@link Response} on successful completion of - * {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String name, - DefaultName defaultParameter); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName); /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @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 patching schedule of a redis cache on successful completion of {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String name, DefaultName defaultParameter); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisResource(String resourceGroupName, String cacheName); /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @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 patching schedule of a redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String name, - DefaultName defaultParameter, Context context); - - /** - * Gets the patching schedule of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @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 patching schedule of a redis cache. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisResource(String resourceGroupName, String cacheName, + Context context); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateEndpointConnectionsClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateEndpointConnectionsClient.java index a02da2b8c51a1..da0f70c181685 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.fluent; @@ -22,49 +22,6 @@ * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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 PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String cacheName); - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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 cacheName); - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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 cacheName, Context context); - /** * Gets the specified private endpoint connection associated with the redis cache. * @@ -318,4 +275,46 @@ Response deleteWithResponse(String resourceGroupName, String cacheName, St */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName); + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String cacheName); + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 cacheName); + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 cacheName, Context context); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateLinkResourcesClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateLinkResourcesClient.java index 54c3d5d73843d..e3783fafba0dd 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/PrivateLinkResourcesClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.fluent; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.java index dcc53a06a6ee8..81e51b10af9f9 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.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.redis.fluent; @@ -38,108 +38,64 @@ public interface RedisClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { /** - * Checks that the redis cache name is valid and is not already in use. + * Gets a Redis cache (resource description). * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a Redis cache (resource description) along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters parameters); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name); /** - * Checks that the redis cache name is valid and is not already in use. + * Gets a Redis cache (resource description). * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a Redis cache (resource description) on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameAvailabilityAsync(CheckNameAvailabilityParameters parameters); + Mono getByResourceGroupAsync(String resourceGroupName, String name); /** - * Checks that the redis cache name is valid and is not already in use. + * Gets a Redis cache (resource description). * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(CheckNameAvailabilityParameters parameters, Context context); - - /** - * Checks that the redis cache name is valid and is not already in use. - * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Redis cache (resource description) along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void checkNameAvailability(CheckNameAvailabilityParameters parameters); - - /** - * Gets any upgrade notifications for a Redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @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 any upgrade notifications for a Redis cache as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, - double history); - - /** - * Gets any upgrade notifications for a Redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @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 any upgrade notifications for a Redis cache as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUpgradeNotifications(String resourceGroupName, String name, - double history); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** - * Gets any upgrade notifications for a Redis cache. + * Gets a Redis cache (resource description). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @param context The context to associate with this operation. + * @param name The name of the RedisResource. * @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 any upgrade notifications for a Redis cache as paginated response with {@link PagedIterable}. + * @return a Redis cache (resource description). */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUpgradeNotifications(String resourceGroupName, String name, - double history, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner getByResourceGroup(String resourceGroupName, String name); /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -155,7 +111,7 @@ Mono>> createWithResponseAsync(String resourceGroupNam * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -170,7 +126,7 @@ PollerFlux, RedisResourceInner> beginCreateAsync( * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -185,7 +141,7 @@ SyncPoller, RedisResourceInner> beginCreate(Strin * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -201,7 +157,7 @@ SyncPoller, RedisResourceInner> beginCreate(Strin * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -215,7 +171,7 @@ SyncPoller, RedisResourceInner> beginCreate(Strin * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -229,7 +185,7 @@ SyncPoller, RedisResourceInner> beginCreate(Strin * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -244,7 +200,7 @@ SyncPoller, RedisResourceInner> beginCreate(Strin * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -260,7 +216,7 @@ Mono>> updateWithResponseAsync(String resourceGroupNam * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -275,7 +231,7 @@ PollerFlux, RedisResourceInner> beginUpdateAsync( * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -290,7 +246,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -306,7 +262,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -320,7 +276,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -334,7 +290,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -349,7 +305,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -362,7 +318,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -375,7 +331,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -388,7 +344,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -402,7 +358,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -415,7 +371,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -427,7 +383,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -437,133 +393,125 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin void delete(String resourceGroupName, String name, Context context); /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Redis cache (resource description) along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of list Redis operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Redis cache (resource description) on successful completion of {@link Mono}. + * @return the response of list Redis operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @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 a Redis cache (resource description) along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); - - /** - * Gets a Redis cache (resource description). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Redis cache (resource description). + * @return the response of list Redis operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RedisResourceInner getByResourceGroup(String resourceGroupName, String name); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 list Redis operation as paginated response with {@link PagedFlux}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + PagedFlux listAsync(); /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 list Redis operation as paginated response with {@link PagedIterable}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 list Redis operation as paginated response with {@link PagedIterable}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. + * @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 Redis caches in the specified subscription as paginated response with {@link PagedFlux}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, + double history); /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. + * @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 Redis caches in the specified subscription as paginated response with {@link PagedIterable}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable listUpgradeNotifications(String resourceGroupName, String name, + double history); /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. * @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 Redis caches in the specified subscription as paginated response with {@link PagedIterable}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listUpgradeNotifications(String resourceGroupName, String name, + double history, Context context); /** * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -576,7 +524,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -589,7 +537,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -603,7 +551,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -616,7 +564,7 @@ SyncPoller, RedisResourceInner> beginUpdate(Strin * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -631,7 +579,7 @@ Mono> regenerateKeyWithResponseAsync(String resou * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -646,7 +594,7 @@ Mono regenerateKeyAsync(String resourceGroupName, String n * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -662,7 +610,7 @@ Response regenerateKeyWithResponse(String resourceGroupNam * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -677,7 +625,7 @@ Response regenerateKeyWithResponse(String resourceGroupNam * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -694,7 +642,7 @@ Mono> forceRebootWithResponseAsync(Strin * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -710,7 +658,7 @@ Mono forceRebootAsync(String resourceGroupName, S * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -727,7 +675,7 @@ Response forceRebootWithResponse(String resourceG * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -741,7 +689,7 @@ Response forceRebootWithResponse(String resourceG * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -756,7 +704,7 @@ Mono>> importDataWithResponseAsync(String resourceGrou * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -771,7 +719,7 @@ PollerFlux, Void> beginImportDataAsync(String resourceGroupName * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -786,7 +734,7 @@ SyncPoller, Void> beginImportData(String resourceGroupName, Str * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -802,7 +750,7 @@ SyncPoller, Void> beginImportData(String resourceGroupName, Str * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -816,7 +764,7 @@ SyncPoller, Void> beginImportData(String resourceGroupName, Str * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -829,7 +777,7 @@ SyncPoller, Void> beginImportData(String resourceGroupName, Str * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -843,7 +791,7 @@ SyncPoller, Void> beginImportData(String resourceGroupName, Str * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -858,7 +806,7 @@ Mono>> exportDataWithResponseAsync(String resourceGrou * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -873,7 +821,7 @@ PollerFlux, Void> beginExportDataAsync(String resourceGroupName * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -888,7 +836,7 @@ SyncPoller, Void> beginExportData(String resourceGroupName, Str * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -904,7 +852,7 @@ SyncPoller, Void> beginExportData(String resourceGroupName, Str * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -918,7 +866,7 @@ SyncPoller, Void> beginExportData(String resourceGroupName, Str * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -931,7 +879,7 @@ SyncPoller, Void> beginExportData(String resourceGroupName, Str * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1037,4 +985,52 @@ SyncPoller, OperationStatusResult> beginFlushC */ @ServiceMethod(returns = ReturnType.SINGLE) OperationStatusResult flushCache(String resourceGroupName, String cacheName, Context context); + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters parameters); + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono checkNameAvailabilityAsync(CheckNameAvailabilityParameters parameters); + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse(CheckNameAvailabilityParameters parameters, Context context); + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @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 checkNameAvailability(CheckNameAvailabilityParameters parameters); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisManagementClient.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisManagementClient.java index 0427f3dc3fca4..9f0b58ec6addf 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisManagementClient.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/RedisManagementClient.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.redis.fluent; @@ -12,26 +12,26 @@ */ public interface RedisManagementClient { /** - * 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. * @@ -53,27 +53,6 @@ public interface RedisManagementClient { */ OperationsClient getOperations(); - /** - * Gets the RedisClient object to access its operations. - * - * @return the RedisClient object. - */ - RedisClient getRedis(); - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - FirewallRulesClient getFirewallRules(); - - /** - * Gets the PatchSchedulesClient object to access its operations. - * - * @return the PatchSchedulesClient object. - */ - PatchSchedulesClient getPatchSchedules(); - /** * Gets the LinkedServersClient object to access its operations. * @@ -88,6 +67,13 @@ public interface RedisManagementClient { */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + /** + * Gets the RedisClient object to access its operations. + * + * @return the RedisClient object. + */ + RedisClient getRedis(); + /** * Gets the PrivateLinkResourcesClient object to access its operations. * @@ -96,11 +82,18 @@ public interface RedisManagementClient { PrivateLinkResourcesClient getPrivateLinkResources(); /** - * Gets the AsyncOperationStatusClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AsyncOperationStatusClient object. + * @return the FirewallRulesClient object. */ - AsyncOperationStatusClient getAsyncOperationStatus(); + FirewallRulesClient getFirewallRules(); + + /** + * Gets the PatchSchedulesClient object to access its operations. + * + * @return the PatchSchedulesClient object. + */ + PatchSchedulesClient getPatchSchedules(); /** * Gets the AccessPoliciesClient object to access its operations. @@ -115,4 +108,11 @@ public interface RedisManagementClient { * @return the AccessPolicyAssignmentsClient object. */ AccessPolicyAssignmentsClient getAccessPolicyAssignments(); + + /** + * Gets the AsyncOperationStatusClient object to access its operations. + * + * @return the AsyncOperationStatusClient object. + */ + AsyncOperationStatusClient getAsyncOperationStatus(); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationInner.java index afb1b110a1f59..38a0829f45e96 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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 @@ /** * REST API operation. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} @@ -30,7 +30,7 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -42,17 +42,6 @@ public String name() { return this.name; } - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - /** * Get the display property: The object that describes the operation. * @@ -62,17 +51,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: The object that describes the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Validates the instance. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java index b71c4b80897de..b279acbbf6151 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -21,17 +21,57 @@ /** * Asynchronous operation status. */ -@Fluent +@Immutable public final class OperationStatusInner extends OperationStatusResult { /* * Additional properties from RP, only when operation is successful */ private Map properties; + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * The operations list. + */ + private List operations; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * Operation status. + */ + private String status; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Fully qualified ID for the async operation. + */ + private String id; + /** * Creates an instance of OperationStatusInner class. */ - public OperationStatusInner() { + private OperationStatusInner() { } /** @@ -44,86 +84,83 @@ public Map properties() { } /** - * Set the properties property: Additional properties from RP, only when operation is successful. + * Get the error property: If present, details of the operation error. * - * @param properties the properties value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} + * @return the error value. */ @Override - public OperationStatusInner withId(String id) { - super.withId(id); - return this; + public ManagementError error() { + return this.error; } /** - * {@inheritDoc} + * Get the operations property: The operations list. + * + * @return the operations value. */ @Override - public OperationStatusInner withName(String name) { - super.withName(name); - return this; + public List operations() { + return this.operations; } /** - * {@inheritDoc} + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. */ @Override - public OperationStatusInner withStatus(String status) { - super.withStatus(status); - return this; + public OffsetDateTime endTime() { + return this.endTime; } /** - * {@inheritDoc} + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. */ @Override - public OperationStatusInner withPercentComplete(Float percentComplete) { - super.withPercentComplete(percentComplete); - return this; + public OffsetDateTime startTime() { + return this.startTime; } /** - * {@inheritDoc} + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. */ @Override - public OperationStatusInner withStartTime(OffsetDateTime startTime) { - super.withStartTime(startTime); - return this; + public Double percentComplete() { + return this.percentComplete; } /** - * {@inheritDoc} + * Get the status property: Operation status. + * + * @return the status value. */ @Override - public OperationStatusInner withEndTime(OffsetDateTime endTime) { - super.withEndTime(endTime); - return this; + public String status() { + return this.status; } /** - * {@inheritDoc} + * Get the name property: Name of the async operation. + * + * @return the name value. */ @Override - public OperationStatusInner withOperations(List operations) { - super.withOperations(operations); - return this; + public String name() { + return this.name; } /** - * {@inheritDoc} + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. */ @Override - public OperationStatusInner withError(ManagementError error) { - super.withError(error); - return this; + public String id() { + return this.id; } /** @@ -181,25 +218,25 @@ public static OperationStatusInner fromJson(JsonReader jsonReader) throws IOExce reader.nextToken(); if ("status".equals(fieldName)) { - deserializedOperationStatusInner.withStatus(reader.getString()); + deserializedOperationStatusInner.status = reader.getString(); } else if ("id".equals(fieldName)) { - deserializedOperationStatusInner.withId(reader.getString()); + deserializedOperationStatusInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedOperationStatusInner.withName(reader.getString()); + deserializedOperationStatusInner.name = reader.getString(); } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusInner.withPercentComplete(reader.getNullable(JsonReader::getFloat)); + deserializedOperationStatusInner.percentComplete = reader.getNullable(JsonReader::getDouble); } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusInner.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + deserializedOperationStatusInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusInner.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + deserializedOperationStatusInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("operations".equals(fieldName)) { List operations = reader.readArray(reader1 -> OperationStatusResult.fromJson(reader1)); - deserializedOperationStatusInner.withOperations(operations); + deserializedOperationStatusInner.operations = operations; } else if ("error".equals(fieldName)) { - deserializedOperationStatusInner.withError(ManagementError.fromJson(reader)); + deserializedOperationStatusInner.error = ManagementError.fromJson(reader); } else if ("properties".equals(fieldName)) { Map properties = reader.readMap(reader1 -> reader1.readUntyped()); deserializedOperationStatusInner.properties = properties; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionInner.java index fb720e7c31633..79808710ba41e 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionInner.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.redis.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; @@ -13,6 +14,7 @@ import com.azure.resourcemanager.redis.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redis.models.PrivateLinkServiceConnectionState; import java.io.IOException; +import java.util.List; /** * The Private Endpoint Connection resource. @@ -24,6 +26,11 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { */ private PrivateEndpointConnectionProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +61,15 @@ private PrivateEndpointConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -85,7 +101,16 @@ public String id() { } /** - * 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.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. @@ -189,6 +214,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionProperties.java index dde647f2adc80..d2606c945fbd1 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionProperties.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.redis.fluent.models; @@ -14,15 +14,21 @@ import com.azure.resourcemanager.redis.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.redis.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 +49,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 +67,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. @@ -145,6 +160,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceInner.java index ca3b3f4f55e7d..f9818c7911a20 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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,20 +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. * @@ -169,6 +170,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceProperties.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceProperties.java index 9d34242b3d587..5a193aef4a158 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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,17 +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. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisAccessKeysInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisAccessKeysInner.java index d1418c2e26a15..4cfaaf0fb306e 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisAccessKeysInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisAccessKeysInner.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.redis.fluent.models; @@ -29,7 +29,7 @@ public final class RedisAccessKeysInner implements JsonSerializable privateEndpointConnections; + /* + * The resource ID of the target Azure Managed Redis resource that this Azure Cache for Redis resource is being + * migrated to. + */ + private String targetAmrResourceId; + /** * Creates an instance of RedisPropertiesInner class. */ @@ -147,6 +153,16 @@ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the targetAmrResourceId property: The resource ID of the target Azure Managed Redis resource that this Azure + * Cache for Redis resource is being migrated to. + * + * @return the targetAmrResourceId value. + */ + public String targetAmrResourceId() { + return this.targetAmrResourceId; + } + /** * {@inheritDoc} */ @@ -414,6 +430,8 @@ public static RedisPropertiesInner fromJson(JsonReader jsonReader) throws IOExce List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedRedisPropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else if ("targetAmrResourceId".equals(fieldName)) { + deserializedRedisPropertiesInner.targetAmrResourceId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisResourceInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisResourceInner.java index 901a535b27b67..1a3b60d228d9a 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisResourceInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisResourceInner.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.redis.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -35,15 +36,20 @@ public final class RedisResourceInner extends Resource { private RedisPropertiesInner innerProperties = new RedisPropertiesInner(); /* - * A list of availability zones denoting where the resource needs to come from. + * The availability zones. */ private List zones; /* - * The identity of the resource. + * The managed service identities assigned to this resource. */ private ManagedServiceIdentity identity; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -75,7 +81,7 @@ private RedisPropertiesInner innerProperties() { } /** - * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * Get the zones property: The availability zones. * * @return the zones value. */ @@ -84,7 +90,7 @@ public List zones() { } /** - * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * Set the zones property: The availability zones. * * @param zones the zones value to set. * @return the RedisResourceInner object itself. @@ -95,7 +101,7 @@ public RedisResourceInner 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. */ @@ -104,7 +110,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 RedisResourceInner object itself. @@ -114,6 +120,15 @@ public RedisResourceInner withIdentity(ManagedServiceIdentity identity) { 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. * @@ -236,6 +251,16 @@ public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the targetAmrResourceId property: The resource ID of the target Azure Managed Redis resource that this Azure + * Cache for Redis resource is being migrated to. + * + * @return the targetAmrResourceId value. + */ + public String targetAmrResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetAmrResourceId(); + } + /** * Get the sku property: The SKU of the Redis cache to deploy. * @@ -510,7 +535,7 @@ public RedisResourceInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { /** * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this cache. Value is * optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive - * access method. Default value is 'Enabled'. + * access method. * * @return the publicNetworkAccess value. */ @@ -521,7 +546,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this cache. Value is * optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive - * access method. Default value is 'Enabled'. + * access method. * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the RedisResourceInner object itself. @@ -687,6 +712,8 @@ public static RedisResourceInner fromJson(JsonReader jsonReader) throws IOExcept deserializedRedisResourceInner.zones = zones; } else if ("identity".equals(fieldName)) { deserializedRedisResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRedisResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisUpdateProperties.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisUpdateProperties.java index 870d5a2e20c28..68eceecd1ef00 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisUpdateProperties.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisUpdateProperties.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.redis.fluent.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/ScheduleEntries.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/ScheduleEntries.java index ca5bb551059fb..240fc681ac87a 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/ScheduleEntries.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/ScheduleEntries.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.redis.fluent.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/UpgradeNotificationInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/UpgradeNotificationInner.java index aa441f13167de..32c10745ded89 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/UpgradeNotificationInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/UpgradeNotificationInner.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.redis.fluent.models; @@ -37,7 +37,7 @@ public final class UpgradeNotificationInner implements JsonSerializable> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + @PathParam("accessPolicyName") String accessPolicyName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdate(@HostParam("$host") String endpoint, + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @PathParam("accessPolicyName") String accessPolicyName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisCacheAccessPolicyInner parameters, @HeaderParam("Accept") String accept, + @PathParam("accessPolicyName") String accessPolicyName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RedisCacheAccessPolicyInner 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/redis/{cacheName}/accessPolicies/{accessPolicyName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @PathParam("accessPolicyName") String accessPolicyName, @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/redis/{cacheName}/accessPolicies/{accessPolicyName}") - @ExpectedResponses({ 200 }) - @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("cacheName") String cacheName, - @PathParam("accessPolicyName") String accessPolicyName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("accessPolicyName") String accessPolicyName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -113,10 +113,145 @@ Mono> list(@HostParam("$host") String endpo @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); } + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about an access policy of a redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String accessPolicyName) { + 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 (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (accessPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String accessPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (accessPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accessPolicyName, accept, context); + } + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about an access policy of a redis cache on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String cacheName, + String accessPolicyName) { + return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @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 detailed information about an access policy of a redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cacheName, + String accessPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyName, context).block(); + } + + /** + * Gets the detailed information about an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about an access policy of a redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisCacheAccessPolicyInner get(String resourceGroupName, String cacheName, String accessPolicyName) { + return getWithResponse(resourceGroupName, cacheName, accessPolicyName, Context.NONE).getValue(); + } + /** * Adds an access policy to the redis cache. * @@ -136,6 +271,10 @@ public Mono>> createUpdateWithResponseAsync(String res 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.")); @@ -147,20 +286,17 @@ public Mono>> createUpdateWithResponseAsync(String res return Mono .error(new IllegalArgumentException("Parameter accessPolicyName 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.createUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, - accessPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context)) + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -184,6 +320,10 @@ private Mono>> createUpdateWithResponseAsync(String re 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.")); @@ -195,19 +335,17 @@ private Mono>> createUpdateWithResponseAsync(String re return Mono .error(new IllegalArgumentException("Parameter accessPolicyName 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"; context = this.client.mergeContext(context); - return service.createUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyName, contentType, accept, + parameters, context); } /** @@ -390,6 +528,10 @@ public Mono>> deleteWithResponseAsync(String resourceG 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.")); @@ -401,14 +543,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter accessPolicyName 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, cacheName, - accessPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -431,6 +568,10 @@ private Mono>> deleteWithResponseAsync(String resource 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.")); @@ -442,14 +583,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter accessPolicyName 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accessPolicyName, context); } /** @@ -595,141 +731,6 @@ public void delete(String resourceGroupName, String cacheName, String accessPoli deleteAsync(resourceGroupName, cacheName, accessPolicyName, context).block(); } - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about an access policy of a redis cache along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String cacheName, - String accessPolicyName) { - 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 (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); - } - if (accessPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter accessPolicyName 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, cacheName, - accessPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String cacheName, - String accessPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); - } - if (accessPolicyName == null) { - return Mono - .error(new IllegalArgumentException("Parameter accessPolicyName 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"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about an access policy of a redis cache on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String cacheName, - String accessPolicyName) { - return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @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 detailed information about an access policy of a redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String cacheName, - String accessPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyName, context).block(); - } - - /** - * Gets the detailed information about an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about an access policy of a redis cache. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RedisCacheAccessPolicyInner get(String resourceGroupName, String cacheName, String accessPolicyName) { - return getWithResponse(resourceGroupName, cacheName, accessPolicyName, Context.NONE).getValue(); - } - /** * Gets the list of access policies associated with this redis cache. * @@ -748,6 +749,10 @@ private Mono> listSinglePageAsync(Str 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.")); @@ -755,14 +760,10 @@ private Mono> listSinglePageAsync(Str if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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())); @@ -787,6 +788,10 @@ private Mono> listSinglePageAsync(Str 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.")); @@ -794,15 +799,11 @@ private Mono> listSinglePageAsync(Str if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -884,8 +885,8 @@ public PagedIterable list(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 list of access policies (with properties) of a Redis cache along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of access policies associated with this redis cache along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -911,8 +912,8 @@ private Mono> listNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 access policies (with properties) of a Redis cache along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of access policies associated with this redis cache along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AccessPolicyAssignmentsClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AccessPolicyAssignmentsClientImpl.java index f4b4689faff7d..a233c1b329b97 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AccessPolicyAssignmentsClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.implementation; @@ -33,7 +33,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redis.fluent.AccessPolicyAssignmentsClient; import com.azure.resourcemanager.redis.fluent.models.RedisCacheAccessPolicyAssignmentInner; -import com.azure.resourcemanager.redis.models.RedisCacheAccessPolicyAssignmentList; +import com.azure.resourcemanager.redis.implementation.models.RedisCacheAccessPolicyAssignmentList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +67,45 @@ public final class AccessPolicyAssignmentsClientImpl implements AccessPolicyAssi * The interface defining all the services for RedisManagementClientAccessPolicyAssignments to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientAccessPolicyAssignments") public interface AccessPolicyAssignmentsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdate(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisCacheAccessPolicyAssignmentInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisCacheAccessPolicyAssignmentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, + 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("cacheName") String cacheName, + @PathParam("accessPolicyAssignmentName") String accessPolicyAssignmentName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,10 +113,144 @@ Mono> list(@HostParam("$host") St @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); } + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String cacheName, 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 (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String cacheName, String accessPolicyAssignmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accessPolicyAssignmentName, accept, context); + } + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName) { + return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName, Context context) { + return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyAssignmentName, context).block(); + } + + /** + * Gets the list of assignments for an access policy of a redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisCacheAccessPolicyAssignmentInner get(String resourceGroupName, String cacheName, + String accessPolicyAssignmentName) { + return getWithResponse(resourceGroupName, cacheName, accessPolicyAssignmentName, Context.NONE).getValue(); + } + /** * Adds the access policy assignment to the specified users. * @@ -139,6 +271,10 @@ public Mono>> createUpdateWithResponseAsync(String res 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.")); @@ -150,20 +286,17 @@ public Mono>> createUpdateWithResponseAsync(String res return Mono.error( new IllegalArgumentException("Parameter accessPolicyAssignmentName 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.createUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, - accessPolicyAssignmentName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, - accept, context)) + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyAssignmentName, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -188,6 +321,10 @@ private Mono>> createUpdateWithResponseAsync(String re 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.")); @@ -199,19 +336,17 @@ private Mono>> createUpdateWithResponseAsync(String re return Mono.error( new IllegalArgumentException("Parameter accessPolicyAssignmentName 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"; context = this.client.mergeContext(context); - return service.createUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyAssignmentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyAssignmentName, contentType, + accept, parameters, context); } /** @@ -399,6 +534,10 @@ public Mono>> deleteWithResponseAsync(String resourceG 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.")); @@ -410,13 +549,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error( new IllegalArgumentException("Parameter accessPolicyAssignmentName 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, cacheName, - accessPolicyAssignmentName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accessPolicyAssignmentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -439,6 +574,10 @@ private Mono>> deleteWithResponseAsync(String resource 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.")); @@ -450,14 +589,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter accessPolicyAssignmentName 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyAssignmentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accessPolicyAssignmentName, context); } /** @@ -604,140 +738,6 @@ public void delete(String resourceGroupName, String cacheName, String accessPoli deleteAsync(resourceGroupName, cacheName, accessPolicyAssignmentName, context).block(); } - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, - String cacheName, String accessPolicyAssignmentName) { - 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 (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter accessPolicyAssignmentName 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, cacheName, - accessPolicyAssignmentName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String cacheName, String accessPolicyAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); - } - if (accessPolicyAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter accessPolicyAssignmentName 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"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, cacheName, accessPolicyAssignmentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName) { - return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName, Context context) { - return getWithResponseAsync(resourceGroupName, cacheName, accessPolicyAssignmentName, context).block(); - } - - /** - * Gets the list of assignments for an access policy of a redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the 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 the list of assignments for an access policy of a redis cache. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RedisCacheAccessPolicyAssignmentInner get(String resourceGroupName, String cacheName, - String accessPolicyAssignmentName) { - return getWithResponse(resourceGroupName, cacheName, accessPolicyAssignmentName, Context.NONE).getValue(); - } - /** * Gets the list of access policy assignments associated with this redis cache. * @@ -756,6 +756,10 @@ private Mono> listSinglePag 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.")); @@ -763,14 +767,10 @@ private Mono> listSinglePag if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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())); @@ -795,6 +795,10 @@ private Mono> listSinglePag 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.")); @@ -802,15 +806,11 @@ private Mono> listSinglePag if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -892,7 +892,7 @@ public PagedIterable list(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of access policies assignments (with properties) of a Redis cache along with {@link PagedResponse} + * @return the list of access policy assignments associated with this redis cache along with {@link PagedResponse} * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -919,7 +919,7 @@ private Mono> listNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 access policies assignments (with properties) of a Redis cache along with {@link PagedResponse} + * @return the list of access policy assignments associated with this redis cache along with {@link PagedResponse} * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AsyncOperationStatusClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AsyncOperationStatusClientImpl.java index 54e1d808cdd13..b93c376e44b8f 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AsyncOperationStatusClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/AsyncOperationStatusClientImpl.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.redis.implementation; @@ -54,16 +54,16 @@ public final class AsyncOperationStatusClientImpl implements AsyncOperationStatu * The interface defining all the services for RedisManagementClientAsyncOperationStatus to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientAsyncOperationStatus") public interface AsyncOperationStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/asyncOperations/{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("operationId") String operationId, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); } @@ -95,8 +95,8 @@ public Mono> getWithResponseAsync(String location } 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, + operationId, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -130,7 +130,7 @@ private Mono> getWithResponseAsync(String locatio } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, operationId, this.client.getApiVersion(), + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), location, operationId, this.client.getSubscriptionId(), accept, context); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/FirewallRulesClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/FirewallRulesClientImpl.java index d6ba538b570e8..ee4415078a7b3 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/FirewallRulesClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/FirewallRulesClientImpl.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.redis.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redis.fluent.FirewallRulesClient; import com.azure.resourcemanager.redis.fluent.models.RedisFirewallRuleInner; -import com.azure.resourcemanager.redis.models.RedisFirewallRuleListResult; +import com.azure.resourcemanager.redis.implementation.models.RedisFirewallRuleListResult; import reactor.core.publisher.Mono; /** @@ -62,70 +62,70 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { * The interface defining all the services for RedisManagementClientFirewallRules to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientFirewallRules") public interface FirewallRulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("ruleName") String ruleName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisFirewallRuleInner parameters, @HeaderParam("Accept") String accept, + @PathParam("ruleName") String ruleName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RedisFirewallRuleInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}") + @ExpectedResponses({ 200, 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("cacheName") String cacheName, - @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("ruleName") String ruleName, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @PathParam("ruleName") String ruleName, @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" }) @Get("{nextLink}") @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); } /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a single firewall rule in a specified redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String cacheName) { + public Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String ruleName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -141,30 +141,32 @@ private Mono> listSinglePageAsync(String r if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, cacheName, 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, cacheName, ruleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @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 firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a single firewall rule in a specified redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String cacheName, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String cacheName, + String ruleName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -180,77 +182,64 @@ private Mono> listSinglePageAsync(String r if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, cacheName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, ruleName, accept, context); } /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. + * @return a single firewall rule in a specified redis cache on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String cacheName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String cacheName, String ruleName) { + return getWithResponseAsync(resourceGroupName, cacheName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. * @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 firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String cacheName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all firewall rules in the specified redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + * @return a single firewall rule in a specified redis cache along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String cacheName) { - return new PagedIterable<>(listAsync(resourceGroupName, cacheName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cacheName, String ruleName, + Context context) { + return getWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); } /** - * Gets all firewall rules in the specified redis cache. + * Gets a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param context The context to associate with this operation. + * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + * @return a single firewall rule in a specified redis cache. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String cacheName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, cacheName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisFirewallRuleInner get(String resourceGroupName, String cacheName, String ruleName) { + return getWithResponse(resourceGroupName, cacheName, ruleName, Context.NONE).getValue(); } /** @@ -273,6 +262,10 @@ public Mono> createOrUpdateWithResponseAsync(St 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.")); @@ -283,19 +276,17 @@ public Mono> createOrUpdateWithResponseAsync(St if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName 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.createOrUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, - ruleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, ruleName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -320,6 +311,10 @@ private Mono> createOrUpdateWithResponseAsync(S 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.")); @@ -330,19 +325,17 @@ private Mono> createOrUpdateWithResponseAsync(S if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName 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"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, cacheName, ruleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, ruleName, contentType, accept, parameters, + context); } /** @@ -405,7 +398,7 @@ public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String ca } /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -413,16 +406,18 @@ public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String ca * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 single firewall rule in a specified redis cache along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String cacheName, - String ruleName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName) { 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.")); @@ -433,19 +428,14 @@ public Mono> getWithResponseAsync(String resour if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName 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, cacheName, ruleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, ruleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -454,16 +444,19 @@ public Mono> getWithResponseAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 single firewall rule in a specified redis cache 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 cacheName, - String ruleName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -474,18 +467,13 @@ private Mono> getWithResponseAsync(String resou if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName 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"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, cacheName, ruleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, ruleName, context); } /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -493,16 +481,15 @@ private Mono> getWithResponseAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 single firewall rule in a specified redis cache on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String cacheName, String ruleName) { - return getWithResponseAsync(resourceGroupName, cacheName, ruleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String cacheName, String ruleName) { + return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName).flatMap(ignored -> Mono.empty()); } /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -511,16 +498,16 @@ public Mono getAsync(String resourceGroupName, String ca * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 single firewall rule in a specified redis cache along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String cacheName, String ruleName, + public Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, Context context) { - return getWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); + return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); } /** - * Gets a single firewall rule in a specified redis cache. + * Deletes a single firewall rule in a specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. @@ -528,30 +515,34 @@ public Response getWithResponse(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 a single firewall rule in a specified redis cache. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RedisFirewallRuleInner get(String resourceGroupName, String cacheName, String ruleName) { - return getWithResponse(resourceGroupName, cacheName, ruleName, Context.NONE).getValue(); + public void delete(String resourceGroupName, String cacheName, String ruleName) { + deleteWithResponse(resourceGroupName, cacheName, ruleName, Context.NONE); } /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 all firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String cacheName) { 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.")); @@ -559,39 +550,38 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName 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, cacheName, ruleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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 firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return all firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String cacheName, String ruleName, + private Mono> listSinglePageAsync(String resourceGroupName, String cacheName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -599,66 +589,77 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } - if (ruleName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleName 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, cacheName, ruleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String cacheName, String ruleName) { - return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return all firewall rules in the specified redis cache as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cacheName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Deletes a single firewall rule in a specified redis cache. + * Gets all firewall rules in the specified redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cacheName, String ruleName) { - deleteWithResponse(resourceGroupName, cacheName, ruleName, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cacheName) { + return new PagedIterable<>(listAsync(resourceGroupName, cacheName)); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cacheName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cacheName, context)); } /** @@ -668,8 +669,8 @@ public void delete(String resourceGroupName, String cacheName, String ruleName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list firewall rules Redis operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -695,8 +696,8 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of list firewall rules Redis operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all firewall rules in the specified redis cache along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/LinkedServersClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/LinkedServersClientImpl.java index 346dc905b2411..d11347487a4a2 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/LinkedServersClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/LinkedServersClientImpl.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.redis.implementation; @@ -33,8 +33,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redis.fluent.LinkedServersClient; import com.azure.resourcemanager.redis.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.azure.resourcemanager.redis.implementation.models.RedisLinkedServerWithPropertiesList; import com.azure.resourcemanager.redis.models.RedisLinkedServerCreateParameters; -import com.azure.resourcemanager.redis.models.RedisLinkedServerWithPropertiesList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -68,45 +68,45 @@ public final class LinkedServersClientImpl implements LinkedServersClient { * The interface defining all the services for RedisManagementClientLinkedServers to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientLinkedServers") public interface LinkedServersService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}") + @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("name") String name, + @PathParam("linkedServerName") String linkedServerName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}") @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("name") String name, - @PathParam("linkedServerName") String linkedServerName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisLinkedServerCreateParameters parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("linkedServerName") String linkedServerName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisLinkedServerCreateParameters 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/redis/{name}/linkedServers/{linkedServerName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @PathParam("linkedServerName") String linkedServerName, @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/redis/{name}/linkedServers/{linkedServerName}") - @ExpectedResponses({ 200 }) - @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("name") String name, - @PathParam("linkedServerName") String linkedServerName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("linkedServerName") String linkedServerName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -114,16 +114,152 @@ Mono> list(@HostParam("$host") Str @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); } + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU) along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String name, String linkedServerName) { + 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (linkedServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkedServerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, linkedServerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String name, String linkedServerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (linkedServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter linkedServerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, linkedServerName, accept, context); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU) on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String name, + String linkedServerName) { + return getWithResponseAsync(resourceGroupName, name, linkedServerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String name, + String linkedServerName, Context context) { + return getWithResponseAsync(resourceGroupName, name, linkedServerName, context).block(); + } + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisLinkedServerWithPropertiesInner get(String resourceGroupName, String name, String linkedServerName) { + return getWithResponse(resourceGroupName, name, linkedServerName, Context.NONE).getValue(); + } + /** * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -138,6 +274,10 @@ public Mono>> createWithResponseAsync(String resourceG 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.")); @@ -149,19 +289,17 @@ public Mono>> createWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter linkedServerName 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, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, linkedServerName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -169,8 +307,8 @@ public Mono>> createWithResponseAsync(String resourceG * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -186,6 +324,10 @@ private Mono>> createWithResponseAsync(String resource 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.")); @@ -197,27 +339,24 @@ private Mono>> createWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter linkedServerName 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"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), resourceGroupName, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, linkedServerName, contentType, accept, parameters, context); } /** * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -240,8 +379,8 @@ private Mono>> createWithResponseAsync(String resource * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,8 +405,8 @@ private Mono>> createWithResponseAsync(String resource * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -286,8 +425,8 @@ private Mono>> createWithResponseAsync(String resource * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -307,8 +446,8 @@ private Mono>> createWithResponseAsync(String resource * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -327,8 +466,8 @@ public Mono createAsync(String resourceGro * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -348,8 +487,8 @@ private Mono createAsync(String resourceGr * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -366,8 +505,8 @@ public RedisLinkedServerWithPropertiesInner create(String resourceGroupName, Str * Adds a linked server to the Redis cache (requires Premium SKU). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param name The name of the redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @param parameters Parameters supplied to the Create Linked server operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -386,7 +525,7 @@ public RedisLinkedServerWithPropertiesInner create(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -399,6 +538,10 @@ public Mono>> deleteWithResponseAsync(String resourceG 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.")); @@ -410,14 +553,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter linkedServerName 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, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, linkedServerName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -426,7 +564,7 @@ public Mono>> deleteWithResponseAsync(String resourceG * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -440,6 +578,10 @@ private Mono>> deleteWithResponseAsync(String resource 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.")); @@ -451,14 +593,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter linkedServerName 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, linkedServerName, context); } /** @@ -466,7 +603,7 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -485,7 +622,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -507,7 +644,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -524,7 +661,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -542,7 +679,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -559,7 +696,7 @@ public Mono deleteAsync(String resourceGroupName, String name, String link * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -577,7 +714,7 @@ private Mono deleteAsync(String resourceGroupName, String name, String lin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -592,7 +729,7 @@ public void delete(String resourceGroupName, String name, String linkedServerNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. + * @param linkedServerName The name of the RedisLinkedServerWithProperties. * @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. @@ -603,142 +740,6 @@ public void delete(String resourceGroupName, String name, String linkedServerNam deleteAsync(resourceGroupName, name, linkedServerName, context).block(); } - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU) along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, - String name, String linkedServerName) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (linkedServerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServerName 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, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String name, String linkedServerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (linkedServerName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServerName 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"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, name, linkedServerName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU) on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String name, - String linkedServerName) { - return getWithResponseAsync(resourceGroupName, name, linkedServerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @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 detailed information about a linked server of a redis cache (requires Premium SKU) along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String name, - String linkedServerName, Context context) { - return getWithResponseAsync(resourceGroupName, name, linkedServerName, context).block(); - } - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 detailed information about a linked server of a redis cache (requires Premium SKU). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RedisLinkedServerWithPropertiesInner get(String resourceGroupName, String name, String linkedServerName) { - return getWithResponse(resourceGroupName, name, linkedServerName, Context.NONE).getValue(); - } - /** * Gets the list of linked servers associated with this redis cache (requires Premium SKU). * @@ -757,6 +758,10 @@ private Mono> listSinglePage 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.")); @@ -764,14 +769,10 @@ private Mono> listSinglePage if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, 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())); @@ -796,6 +797,10 @@ private Mono> listSinglePage 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.")); @@ -803,15 +808,11 @@ private Mono> listSinglePage if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -893,8 +894,8 @@ public PagedIterable list(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 linked servers (with properties) of a Redis cache along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of linked servers associated with this redis cache (requires Premium SKU) along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -920,8 +921,8 @@ private Mono> listNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 linked servers (with properties) of a Redis cache along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of linked servers associated with this redis cache (requires Premium SKU) along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/OperationsClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/OperationsClientImpl.java index 9a8b567d54f09..e3be1dda5aa93 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/OperationsClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redis.fluent.OperationsClient; import com.azure.resourcemanager.redis.fluent.models.OperationInner; -import com.azure.resourcemanager.redis.models.OperationListResult; +import com.azure.resourcemanager.redis.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,14 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for RedisManagementClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientOperations") 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" }) @@ -74,11 +74,11 @@ Mono> list(@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); } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,7 +101,7 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(Context context) } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -136,7 +136,7 @@ public PagedFlux listAsync() { } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +151,7 @@ private PagedFlux listAsync(Context context) { } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -163,7 +163,7 @@ public PagedIterable list() { } /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PatchSchedulesClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PatchSchedulesClientImpl.java index 2d4ede306a3bf..cb9ef2534b43f 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PatchSchedulesClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PatchSchedulesClientImpl.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.redis.implementation; @@ -30,8 +30,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redis.fluent.PatchSchedulesClient; import com.azure.resourcemanager.redis.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.implementation.models.RedisPatchScheduleListResult; import com.azure.resourcemanager.redis.models.DefaultName; -import com.azure.resourcemanager.redis.models.RedisPatchScheduleListResult; import reactor.core.publisher.Mono; /** @@ -63,70 +63,70 @@ public final class PatchSchedulesClientImpl implements PatchSchedulesClient { * The interface defining all the services for RedisManagementClientPatchSchedules to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientPatchSchedules") public interface PatchSchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/patchSchedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRedisResource(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("default") DefaultName defaultParameter, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @PathParam("default") DefaultName defaultParameter, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisPatchScheduleInner parameters, @HeaderParam("Accept") String accept, + @PathParam("default") DefaultName defaultParameter, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RedisPatchScheduleInner 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/redis/{name}/patchSchedules/{default}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @PathParam("default") DefaultName defaultParameter, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("default") DefaultName defaultParameter, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/patchSchedules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @PathParam("default") DefaultName defaultParameter, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> listByRedisResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByRedisResourceNext( - @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 all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the patching schedule of a redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRedisResourceSinglePageAsync(String resourceGroupName, - String cacheName) { + public Mono> getWithResponseAsync(String resourceGroupName, String name, + DefaultName defaultParameter) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -139,33 +139,36 @@ private Mono> listByRedisResourceSinglePa return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (defaultParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByRedisResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, cacheName, 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, name, defaultParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @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 patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the patching schedule of a redis cache along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRedisResourceSinglePageAsync(String resourceGroupName, - String cacheName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String name, + DefaultName defaultParameter, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -178,94 +181,76 @@ private Mono> listByRedisResourceSinglePa return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (defaultParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByRedisResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, cacheName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, defaultParameter, accept, context); } /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedFlux}. + * @return the patching schedule of a redis cache on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName) { - return new PagedFlux<>(() -> listByRedisResourceSinglePageAsync(resourceGroupName, cacheName), - nextLink -> listByRedisResourceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String name, DefaultName defaultParameter) { + return getWithResponseAsync(resourceGroupName, name, defaultParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName, - Context context) { - return new PagedFlux<>(() -> listByRedisResourceSinglePageAsync(resourceGroupName, cacheName, context), - nextLink -> listByRedisResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all patch schedules in the specified redis cache (there is only one). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedIterable}. + * @return the patching schedule of a redis cache along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRedisResource(String resourceGroupName, String cacheName) { - return new PagedIterable<>(listByRedisResourceAsync(resourceGroupName, cacheName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String name, + DefaultName defaultParameter, Context context) { + return getWithResponseAsync(resourceGroupName, name, defaultParameter, context).block(); } /** - * Gets all patch schedules in the specified redis cache (there is only one). + * Gets the patching schedule of a redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param context The context to associate with this operation. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patch schedules in the specified redis cache (there is only one) as paginated response with - * {@link PagedIterable}. + * @return the patching schedule of a redis cache. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRedisResource(String resourceGroupName, String cacheName, - Context context) { - return new PagedIterable<>(listByRedisResourceAsync(resourceGroupName, cacheName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter) { + return getWithResponse(resourceGroupName, name, defaultParameter, Context.NONE).getValue(); } /** * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -280,6 +265,10 @@ public Mono> createOrUpdateWithResponseAsync(S 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.")); @@ -291,20 +280,17 @@ public Mono> createOrUpdateWithResponseAsync(S return Mono .error(new IllegalArgumentException("Parameter defaultParameter 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.createOrUpdate(this.client.getEndpoint(), resourceGroupName, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, defaultParameter, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -312,8 +298,8 @@ public Mono> createOrUpdateWithResponseAsync(S * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -329,6 +315,10 @@ private Mono> createOrUpdateWithResponseAsync( 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.")); @@ -340,27 +330,25 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter defaultParameter 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"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, defaultParameter, contentType, accept, parameters, + context); } /** * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -378,8 +366,8 @@ public Mono createOrUpdateAsync(String resourceGroupNam * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -397,8 +385,8 @@ public Response createOrUpdateWithResponse(String resou * Create or replace the patching schedule for Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param name The name of the redis cache. + * @param defaultParameter The name of the RedisPatchSchedule. * @param parameters Parameters to set the patching schedule for Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -417,7 +405,7 @@ public RedisPatchScheduleInner createOrUpdate(String resourceGroupName, String n * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -430,6 +418,10 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St 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.")); @@ -441,14 +433,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono .error(new IllegalArgumentException("Parameter defaultParameter 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, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, defaultParameter, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -457,7 +444,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -471,6 +458,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S 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.")); @@ -482,14 +473,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter defaultParameter 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, defaultParameter, context); } /** @@ -497,7 +483,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -513,7 +499,7 @@ public Mono deleteAsync(String resourceGroupName, String name, DefaultName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @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. @@ -531,7 +517,7 @@ public Response deleteWithResponse(String resourceGroupName, String name, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param defaultParameter The name of the RedisPatchSchedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -542,136 +528,150 @@ public void delete(String resourceGroupName, String name, DefaultName defaultPar } /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patching schedule of a redis cache along with {@link Response} on successful completion of - * {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String name, - DefaultName defaultParameter) { + private Mono> listByRedisResourceSinglePageAsync(String resourceGroupName, + String cacheName) { 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (defaultParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter defaultParameter 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 (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByRedisResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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 the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @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 patching schedule of a redis cache along with {@link Response} on successful completion of - * {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String name, - DefaultName defaultParameter, Context context) { + private Mono> listByRedisResourceSinglePageAsync(String resourceGroupName, + String cacheName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (defaultParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter defaultParameter 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 (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, name, defaultParameter, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service + .listByRedisResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patching schedule of a redis cache on successful completion of {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String name, DefaultName defaultParameter) { - return getWithResponseAsync(resourceGroupName, name, defaultParameter) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>(() -> listByRedisResourceSinglePageAsync(resourceGroupName, cacheName), + nextLink -> listByRedisResourceNextSinglePageAsync(nextLink)); } /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @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 patching schedule of a redis cache along with {@link Response}. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String name, - DefaultName defaultParameter, Context context) { - return getWithResponseAsync(resourceGroupName, name, defaultParameter, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName, + Context context) { + return new PagedFlux<>(() -> listByRedisResourceSinglePageAsync(resourceGroupName, cacheName, context), + nextLink -> listByRedisResourceNextSinglePageAsync(nextLink, context)); } /** - * Gets the patching schedule of a redis cache. + * Gets all patch schedules in the specified redis cache (there is only one). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param cacheName The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 patching schedule of a redis cache. + * @return all patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter) { - return getWithResponse(resourceGroupName, name, defaultParameter, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRedisResource(String resourceGroupName, String cacheName) { + return new PagedIterable<>(listByRedisResourceAsync(resourceGroupName, cacheName)); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 patch schedules in the specified redis cache (there is only one) as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRedisResource(String resourceGroupName, String cacheName, + Context context) { + return new PagedIterable<>(listByRedisResourceAsync(resourceGroupName, cacheName, context)); } /** @@ -681,8 +681,8 @@ public RedisPatchScheduleInner get(String resourceGroupName, String name, Defaul * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list patch schedules Redis operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByRedisResourceNextSinglePageAsync(String nextLink) { @@ -710,8 +710,8 @@ private Mono> listByRedisResourceNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list patch schedules Redis operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all patch schedules in the specified redis cache (there is only one) along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByRedisResourceNextSinglePageAsync(String nextLink, diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateEndpointConnectionsClientImpl.java index 4bee62d1101a8..cd48f35fe1210 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.implementation; @@ -33,7 +33,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.redis.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.redis.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.redis.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.redis.implementation.models.PrivateEndpointConnectionListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,193 +67,54 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * The interface defining all the services for RedisManagementClientPrivateEndpointConnections to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, - @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/redis/{cacheName}/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("cacheName") String cacheName, @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/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> put(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + Mono>> put(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @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/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/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("cacheName") String cacheName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cacheName) { - 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 (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName 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, cacheName, - 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())); - } - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String cacheName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (cacheName == null) { - return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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) - public PagedFlux listAsync(String resourceGroupName, String cacheName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName)); - } - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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 PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String cacheName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName, context)); - } - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 cacheName) { - return new PagedIterable<>(listAsync(resourceGroupName, cacheName)); - } - - /** - * List all the private endpoint connections associated with the redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @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 cacheName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, cacheName, 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); } /** @@ -276,6 +137,10 @@ public Mono> getWithResponseAsync(Strin 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.")); @@ -287,14 +152,10 @@ public Mono> getWithResponseAsync(Strin 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, cacheName, - privateEndpointConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -320,6 +181,10 @@ private Mono> getWithResponseAsync(Stri 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.")); @@ -331,14 +196,10 @@ private Mono> getWithResponseAsync(Stri 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"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, cacheName, privateEndpointConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, privateEndpointConnectionName, accept, context); } /** @@ -419,6 +280,10 @@ public Mono>> putWithResponseAsync(String resourceGrou 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.")); @@ -426,10 +291,6 @@ public Mono>> putWithResponseAsync(String resourceGrou if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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.")); @@ -439,11 +300,12 @@ public Mono>> putWithResponseAsync(String resourceGrou } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), resourceGroupName, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, - accept, context)) + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, privateEndpointConnectionName, + contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -469,6 +331,10 @@ private Mono>> putWithResponseAsync(String resourceGro 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.")); @@ -476,10 +342,6 @@ private Mono>> putWithResponseAsync(String resourceGro if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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.")); @@ -489,10 +351,11 @@ private Mono>> putWithResponseAsync(String resourceGro } else { properties.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), privateEndpointConnectionName, properties, accept, context); + return service.put(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, privateEndpointConnectionName, contentType, accept, properties, context); } /** @@ -687,6 +550,10 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St 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.")); @@ -694,19 +561,13 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -730,6 +591,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S 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.")); @@ -737,18 +602,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), privateEndpointConnectionName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, privateEndpointConnectionName, context); } /** @@ -803,4 +663,203 @@ public Response deleteWithResponse(String resourceGroupName, String cacheN public void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName) { deleteWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE); } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cacheName) { + 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 (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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())); + } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String cacheName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public PagedFlux listAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cacheName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, cacheName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cacheName) { + return new PagedIterable<>(listAsync(resourceGroupName, cacheName)); + } + + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @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 cacheName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cacheName, 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) { + 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(), 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. + * @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} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + 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"; + context = this.client.mergeContext(context); + return 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)); + } } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateLinkResourcesClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateLinkResourcesClientImpl.java index 2da4fee5c5495..2424b609c08aa 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.redis.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.redis.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.redis.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.redis.implementation.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** @@ -59,16 +59,24 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource * The interface defining all the services for RedisManagementClientPrivateLinkResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RedisManagementClien") + @Host("{endpoint}") + @ServiceInterface(name = "RedisManagementClientPrivateLinkResources") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRedisCache(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + Mono> listByRedisCache(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRedisCacheNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -90,6 +98,10 @@ private Mono> listByRedisCacheSinglePage 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.")); @@ -97,16 +109,12 @@ private Mono> listByRedisCacheSinglePage if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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.listByRedisCache(this.client.getEndpoint(), resourceGroupName, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByRedisCache(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, 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())); } @@ -129,6 +137,10 @@ private Mono> listByRedisCacheSinglePage 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.")); @@ -136,17 +148,13 @@ private Mono> listByRedisCacheSinglePage if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; context = this.client.mergeContext(context); return service - .listByRedisCache(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .listByRedisCache(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cacheName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -162,7 +170,8 @@ private Mono> listByRedisCacheSinglePage */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByRedisCacheAsync(String resourceGroupName, String cacheName) { - return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName)); + return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName), + nextLink -> listByRedisCacheNextSinglePageAsync(nextLink)); } /** @@ -180,7 +189,8 @@ public PagedFlux listByRedisCacheAsync(String resource @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByRedisCacheAsync(String resourceGroupName, String cacheName, Context context) { - return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName, context)); + return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName, context), + nextLink -> listByRedisCacheNextSinglePageAsync(nextLink, context)); } /** @@ -216,4 +226,59 @@ public PagedIterable listByRedisCache(String resourceG Context context) { return new PagedIterable<>(listByRedisCacheAsync(resourceGroupName, cacheName, 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 cache along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRedisCacheNextSinglePageAsync(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.listByRedisCacheNext(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. + * @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 cache along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRedisCacheNextSinglePageAsync(String nextLink, + Context context) { + 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"; + context = this.client.mergeContext(context); + return service.listByRedisCacheNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.java index 60d13d52dc81d..7ba7b7ee24187 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.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.redis.implementation; @@ -38,13 +38,13 @@ import com.azure.resourcemanager.redis.fluent.models.RedisForceRebootResponseInner; import com.azure.resourcemanager.redis.fluent.models.RedisResourceInner; import com.azure.resourcemanager.redis.fluent.models.UpgradeNotificationInner; +import com.azure.resourcemanager.redis.implementation.models.NotificationListResponse; +import com.azure.resourcemanager.redis.implementation.models.RedisListResult; import com.azure.resourcemanager.redis.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.redis.models.ExportRdbParameters; import com.azure.resourcemanager.redis.models.ImportRdbParameters; -import com.azure.resourcemanager.redis.models.NotificationListResponse; import com.azure.resourcemanager.redis.models.OperationStatusResult; import com.azure.resourcemanager.redis.models.RedisCreateParameters; -import com.azure.resourcemanager.redis.models.RedisListResult; import com.azure.resourcemanager.redis.models.RedisRebootParameters; import com.azure.resourcemanager.redis.models.RedisRegenerateKeyParameters; import com.azure.resourcemanager.redis.models.RedisUpdateParameters; @@ -84,153 +84,141 @@ public final class RedisClientImpl implements InnerSupportsGet> checkNameAvailability(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckNameAvailabilityParameters parameters, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listUpgradeNotifications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUpgradeNotifications(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("history") double history, @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/redis/{name}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono>> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisCreateParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisCreateParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisUpdateParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisUpdateParameters 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/redis/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + 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("name") String name, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redis") @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> list(@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}/providers/Microsoft.Cache/redis") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listUpgradeNotifications") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> listUpgradeNotifications(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("history") double history, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono> listKeys(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/regenerateKey") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKey(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono> regenerateKey(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisRegenerateKeyParameters parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisRegenerateKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/forceReboot") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> forceReboot(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono> forceReboot(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RedisRebootParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedisRebootParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/import") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> importData(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono>> importData(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImportRdbParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ImportRdbParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/export") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportData(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + Mono>> exportData(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ExportRdbParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ExportRdbParameters parameters, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/flush") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> flushCache(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, + Mono>> flushCache(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("cacheName") String cacheName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUpgradeNotificationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") CheckNameAvailabilityParameters parameters, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @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" }) @@ -238,56 +226,32 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @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); - } - /** - * Checks that the redis cache name is valid and is not already in use. - * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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) - public Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUpgradeNotificationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Checks that the redis cache name is valid and is not already in use. + * Gets a Redis cache (resource description). * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 a Redis cache (resource description) along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters parameters, - Context context) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -296,82 +260,6 @@ private Mono> checkNameAvailabilityWithResponseAsync(CheckNameAva return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); - } - - /** - * Checks that the redis cache name is valid and is not already in use. - * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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) - public Mono checkNameAvailabilityAsync(CheckNameAvailabilityParameters parameters) { - return checkNameAvailabilityWithResponseAsync(parameters).flatMap(ignored -> Mono.empty()); - } - - /** - * Checks that the redis cache name is valid and is not already in use. - * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityParameters parameters, - Context context) { - return checkNameAvailabilityWithResponseAsync(parameters, context).block(); - } - - /** - * Checks that the redis cache name is valid and is not already in use. - * - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource - * type is 'Microsoft.Cache/redis'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 checkNameAvailability(CheckNameAvailabilityParameters parameters) { - checkNameAvailabilityWithResponse(parameters, Context.NONE); - } - - /** - * Gets any upgrade notifications for a Redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any upgrade notifications for a Redis cache along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listUpgradeNotificationsSinglePageAsync(String resourceGroupName, String name, double history) { - 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.")); @@ -379,39 +267,36 @@ public void checkNameAvailability(CheckNameAvailabilityParameters parameters) { if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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.listUpgradeNotifications(this.client.getEndpoint(), resourceGroupName, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), history, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets any upgrade notifications for a Redis cache. + * Gets a Redis cache (resource description). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. + * @param name The name of the RedisResource. * @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 any upgrade notifications for a Redis cache along with {@link PagedResponse} on successful completion of + * @return a Redis cache (resource description) along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUpgradeNotificationsSinglePageAsync( - String resourceGroupName, String name, double history, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -419,96 +304,65 @@ private Mono> listUpgradeNotificationsSi if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service - .listUpgradeNotifications(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), history, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); } /** - * Gets any upgrade notifications for a Redis cache. + * Gets a Redis cache (resource description). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any upgrade notifications for a Redis cache as paginated response with {@link PagedFlux}. + * @return a Redis cache (resource description) on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, - double history) { - return new PagedFlux<>(() -> listUpgradeNotificationsSinglePageAsync(resourceGroupName, name, history), - nextLink -> listUpgradeNotificationsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets any upgrade notifications for a Redis cache. + * Gets a Redis cache (resource description). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. + * @param name The name of the RedisResource. * @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 any upgrade notifications for a Redis cache as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, - double history, Context context) { - return new PagedFlux<>(() -> listUpgradeNotificationsSinglePageAsync(resourceGroupName, name, history, context), - nextLink -> listUpgradeNotificationsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets any upgrade notifications for a Redis cache. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any upgrade notifications for a Redis cache as paginated response with {@link PagedIterable}. + * @return a Redis cache (resource description) along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpgradeNotifications(String resourceGroupName, String name, - double history) { - return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); } /** - * Gets any upgrade notifications for a Redis cache. + * Gets a Redis cache (resource description). * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications. - * @param context The context to associate with this operation. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any upgrade notifications for a Redis cache as paginated response with {@link PagedIterable}. + * @return a Redis cache (resource description). */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpgradeNotifications(String resourceGroupName, String name, - double history, Context context) { - return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); } /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -523,6 +377,10 @@ public Mono>> createWithResponseAsync(String resourceG 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.")); @@ -530,19 +388,16 @@ public Mono>> createWithResponseAsync(String resourceG if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -550,7 +405,7 @@ public Mono>> createWithResponseAsync(String resourceG * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,6 +421,10 @@ private Mono>> createWithResponseAsync(String resource 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.")); @@ -573,26 +432,23 @@ private Mono>> createWithResponseAsync(String resource if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, contentType, accept, parameters, context); } /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -611,7 +467,7 @@ public PollerFlux, RedisResourceInner> beginCreat * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -632,7 +488,7 @@ private PollerFlux, RedisResourceInner> beginCrea * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -649,7 +505,7 @@ public SyncPoller, RedisResourceInner> beginCreat * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -667,7 +523,7 @@ public SyncPoller, RedisResourceInner> beginCreat * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -685,7 +541,7 @@ public Mono createAsync(String resourceGroupName, String nam * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -704,7 +560,7 @@ private Mono createAsync(String resourceGroupName, String na * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -720,7 +576,7 @@ public RedisResourceInner create(String resourceGroupName, String name, RedisCre * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Create Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -738,7 +594,7 @@ public RedisResourceInner create(String resourceGroupName, String name, RedisCre * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -753,26 +609,27 @@ public Mono>> updateWithResponseAsync(String resourceG 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -780,7 +637,7 @@ public Mono>> updateWithResponseAsync(String resourceG * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -796,6 +653,10 @@ private Mono>> updateWithResponseAsync(String resource 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.")); @@ -803,26 +664,23 @@ private Mono>> updateWithResponseAsync(String resource if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, contentType, accept, parameters, context); } /** * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -841,7 +699,7 @@ public PollerFlux, RedisResourceInner> beginUpdat * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -862,7 +720,7 @@ private PollerFlux, RedisResourceInner> beginUpda * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -879,7 +737,7 @@ public SyncPoller, RedisResourceInner> beginUpdat * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -897,7 +755,7 @@ public SyncPoller, RedisResourceInner> beginUpdat * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -915,7 +773,7 @@ public Mono updateAsync(String resourceGroupName, String nam * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -934,7 +792,7 @@ private Mono updateAsync(String resourceGroupName, String na * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -950,7 +808,7 @@ public RedisResourceInner update(String resourceGroupName, String name, RedisUpd * Update an existing Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters supplied to the Update Redis operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -968,7 +826,7 @@ public RedisResourceInner update(String resourceGroupName, String name, RedisUpd * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -980,6 +838,10 @@ public Mono>> deleteWithResponseAsync(String resourceG 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.")); @@ -987,14 +849,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1002,7 +859,7 @@ public Mono>> deleteWithResponseAsync(String resourceG * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1016,6 +873,10 @@ private Mono>> deleteWithResponseAsync(String resource 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.")); @@ -1023,21 +884,16 @@ private Mono>> deleteWithResponseAsync(String resource if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, context); } /** * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1054,7 +910,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1074,7 +930,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1089,7 +945,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1105,7 +961,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1120,7 +976,7 @@ public Mono deleteAsync(String resourceGroupName, String name) { * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1136,7 +992,7 @@ private Mono deleteAsync(String resourceGroupName, String name, Context co * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1150,7 +1006,7 @@ public void delete(String resourceGroupName, String name) { * Deletes a Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1162,180 +1018,176 @@ public void delete(String resourceGroupName, String name, Context context) { } /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis cache (resource description) along with {@link Response} on successful completion of + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String name) { + 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, name, - 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())); } /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Redis cache (resource description) along with {@link Response} on successful completion of + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String name, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return 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)); } /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis cache (resource description) on successful completion of {@link Mono}. + * @return the response of list Redis operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Redis cache (resource description) along with {@link Response}. + * @return the response of list Redis operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Gets a Redis cache (resource description). + * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis cache (resource description). + * @return the response of list Redis operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RedisResourceInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** * Lists all Redis caches in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list Redis operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of list Redis operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Redis caches in the specified subscription. + * + * @throws 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 Redis caches in the specified subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono> listSinglePageAsync() { 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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 Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 list Redis operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all Redis caches in the specified subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); @@ -1343,82 +1195,81 @@ private Mono> listByResourceGroupSinglePageAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation as paginated response with {@link PagedFlux}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 list Redis operation as paginated response with {@link PagedFlux}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation as paginated response with {@link PagedIterable}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Lists all Redis caches in a resource group. + * Gets all Redis caches in the specified subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 list Redis operation as paginated response with {@link PagedIterable}. + * @return all Redis caches in the specified subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis caches in the specified subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of listUpgradeNotifications along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> + listUpgradeNotificationsSinglePageAsync(String resourceGroupName, String name, double history) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1427,27 +1278,39 @@ private Mono> listSinglePageAsync() { 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .withContext( + context -> service.listUpgradeNotifications(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, history, 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 all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. * @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 Redis caches in the specified subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of listUpgradeNotifications along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listUpgradeNotificationsSinglePageAsync( + String resourceGroupName, String name, double history, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1456,74 +1319,99 @@ private Mono> listSinglePageAsync(Context cont 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) + .listUpgradeNotifications(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, history, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis caches in the specified subscription as paginated response with {@link PagedFlux}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + public PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, + double history) { + return new PagedFlux<>(() -> listUpgradeNotificationsSinglePageAsync(resourceGroupName, name, history), + nextLink -> listUpgradeNotificationsNextSinglePageAsync(nextLink)); } /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. * @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 Redis caches in the specified subscription as paginated response with {@link PagedFlux}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + private PagedFlux listUpgradeNotificationsAsync(String resourceGroupName, String name, + double history, Context context) { + return new PagedFlux<>(() -> listUpgradeNotificationsSinglePageAsync(resourceGroupName, name, history, context), + nextLink -> listUpgradeNotificationsNextSinglePageAsync(nextLink, context)); } /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Redis caches in the specified subscription as paginated response with {@link PagedIterable}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable listUpgradeNotifications(String resourceGroupName, String name, + double history) { + return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history)); } /** - * Gets all Redis caches in the specified subscription. + * [Deprecated] Gets any upgrade notifications for a Redis cache. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the RedisResource. + * @param history how many minutes in past to look for upgrade notifications. * @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 Redis caches in the specified subscription as paginated response with {@link PagedIterable}. + * @return the response of listUpgradeNotifications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable listUpgradeNotifications(String resourceGroupName, String name, + double history, Context context) { + return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history, context)); } /** * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1535,6 +1423,10 @@ public Mono> listKeysWithResponseAsync(String res 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.")); @@ -1542,14 +1434,10 @@ public Mono> listKeysWithResponseAsync(String res if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1557,7 +1445,7 @@ public Mono> listKeysWithResponseAsync(String res * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1571,6 +1459,10 @@ private Mono> listKeysWithResponseAsync(String re 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.")); @@ -1578,21 +1470,17 @@ private Mono> listKeysWithResponseAsync(String re if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); } /** * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1607,7 +1495,7 @@ public Mono listKeysAsync(String resourceGroupName, String * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @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. @@ -1623,7 +1511,7 @@ public Response listKeysWithResponse(String resourceGroupN * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1638,7 +1526,7 @@ public RedisAccessKeysInner listKeys(String resourceGroupName, String name) { * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1652,6 +1540,10 @@ public Mono> regenerateKeyWithResponseAsync(Strin 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.")); @@ -1659,19 +1551,16 @@ public Mono> regenerateKeyWithResponseAsync(Strin if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1679,7 +1568,7 @@ public Mono> regenerateKeyWithResponseAsync(Strin * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1694,6 +1583,10 @@ private Mono> regenerateKeyWithResponseAsync(Stri 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.")); @@ -1701,26 +1594,23 @@ private Mono> regenerateKeyWithResponseAsync(Stri if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.regenerateKey(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context); } /** * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1738,7 +1628,7 @@ public Mono regenerateKeyAsync(String resourceGroupName, S * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1756,7 +1646,7 @@ public Response regenerateKeyWithResponse(String resourceG * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which key to regenerate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1774,7 +1664,7 @@ public RedisAccessKeysInner regenerateKey(String resourceGroupName, String name, * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1789,6 +1679,10 @@ public Mono> forceRebootWithResponseAsyn 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.")); @@ -1796,19 +1690,16 @@ public Mono> forceRebootWithResponseAsyn if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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.forceReboot(this.client.getEndpoint(), resourceGroupName, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.forceReboot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1817,7 +1708,7 @@ public Mono> forceRebootWithResponseAsyn * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1833,6 +1724,10 @@ private Mono> forceRebootWithResponseAsy 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.")); @@ -1840,19 +1735,16 @@ private Mono> forceRebootWithResponseAsy if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.forceReboot(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.forceReboot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, accept, parameters, context); } /** @@ -1860,7 +1752,7 @@ private Mono> forceRebootWithResponseAsy * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1879,7 +1771,7 @@ public Mono forceRebootAsync(String resourceGroup * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1898,7 +1790,7 @@ public Response forceRebootWithResponse(String re * potential data loss. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Specifies which Redis node(s) to reboot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1915,7 +1807,7 @@ public RedisForceRebootResponseInner forceReboot(String resourceGroupName, Strin * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1929,6 +1821,10 @@ public Mono>> importDataWithResponseAsync(String resou 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.")); @@ -1936,19 +1832,15 @@ public Mono>> importDataWithResponseAsync(String resou if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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.importData(this.client.getEndpoint(), resourceGroupName, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.importData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1956,7 +1848,7 @@ public Mono>> importDataWithResponseAsync(String resou * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1971,6 +1863,10 @@ private Mono>> importDataWithResponseAsync(String reso 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.")); @@ -1978,26 +1874,22 @@ private Mono>> importDataWithResponseAsync(String reso if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.importData(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.importData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, parameters, context); } /** * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2016,7 +1908,7 @@ public PollerFlux, Void> beginImportDataAsync(String resourceGr * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2038,7 +1930,7 @@ private PollerFlux, Void> beginImportDataAsync(String resourceG * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2055,7 +1947,7 @@ public SyncPoller, Void> beginImportData(String resourceGroupNa * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2073,7 +1965,7 @@ public SyncPoller, Void> beginImportData(String resourceGroupNa * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2090,7 +1982,7 @@ public Mono importDataAsync(String resourceGroupName, String name, ImportR * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2109,7 +2001,7 @@ private Mono importDataAsync(String resourceGroupName, String name, Import * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2124,7 +2016,7 @@ public void importData(String resourceGroupName, String name, ImportRdbParameter * Import data into Redis cache. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis import operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2140,7 +2032,7 @@ public void importData(String resourceGroupName, String name, ImportRdbParameter * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2154,6 +2046,10 @@ public Mono>> exportDataWithResponseAsync(String resou 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.")); @@ -2161,19 +2057,15 @@ public Mono>> exportDataWithResponseAsync(String resou if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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.exportData(this.client.getEndpoint(), resourceGroupName, name, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.exportData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2181,7 +2073,7 @@ public Mono>> exportDataWithResponseAsync(String resou * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2196,6 +2088,10 @@ private Mono>> exportDataWithResponseAsync(String reso 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.")); @@ -2203,26 +2099,22 @@ private Mono>> exportDataWithResponseAsync(String reso if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name 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"; context = this.client.mergeContext(context); - return service.exportData(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.exportData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, contentType, parameters, context); } /** * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2241,7 +2133,7 @@ public PollerFlux, Void> beginExportDataAsync(String resourceGr * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2263,7 +2155,7 @@ private PollerFlux, Void> beginExportDataAsync(String resourceG * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2280,7 +2172,7 @@ public SyncPoller, Void> beginExportData(String resourceGroupNa * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2298,7 +2190,7 @@ public SyncPoller, Void> beginExportData(String resourceGroupNa * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2315,7 +2207,7 @@ public Mono exportDataAsync(String resourceGroupName, String name, ExportR * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2334,7 +2226,7 @@ private Mono exportDataAsync(String resourceGroupName, String name, Export * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2349,7 +2241,7 @@ public void exportData(String resourceGroupName, String name, ExportRdbParameter * Export data from the redis cache to blobs in a container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. + * @param name The name of the RedisResource. * @param parameters Parameters for Redis export operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2378,6 +2270,10 @@ public Mono>> flushCacheWithResponseAsync(String resou 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.")); @@ -2385,14 +2281,10 @@ public Mono>> flushCacheWithResponseAsync(String resou if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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.flushCache(this.client.getEndpoint(), resourceGroupName, cacheName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.flushCache(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2415,6 +2307,10 @@ private Mono>> flushCacheWithResponseAsync(String reso 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.")); @@ -2422,14 +2318,10 @@ private Mono>> flushCacheWithResponseAsync(String reso if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName 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"; context = this.client.mergeContext(context); - return service.flushCache(this.client.getEndpoint(), resourceGroupName, cacheName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.flushCache(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cacheName, accept, context); } /** @@ -2567,6 +2459,112 @@ public OperationStatusResult flushCache(String resourceGroupName, String cacheNa return flushCacheAsync(resourceGroupName, cacheName, context).block(); } + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, parameters, context); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public Mono checkNameAvailabilityAsync(CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(parameters).flatMap(ignored -> Mono.empty()); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityParameters parameters, + Context context) { + return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 checkNameAvailability(CheckNameAvailabilityParameters parameters) { + checkNameAvailabilityWithResponse(parameters, Context.NONE); + } + /** * Get the next page of items. * @@ -2574,11 +2572,11 @@ public OperationStatusResult flushCache(String resourceGroupName, String cacheNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 listUpgradeNotifications along with {@link PagedResponse} on successful completion of + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUpgradeNotificationsNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2589,8 +2587,8 @@ private Mono> listUpgradeNotificationsNe final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listUpgradeNotificationsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + context -> service.listByResourceGroupNext(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())); } @@ -2603,11 +2601,11 @@ private Mono> listUpgradeNotificationsNe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 listUpgradeNotifications along with {@link PagedResponse} on successful completion of + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUpgradeNotificationsNextSinglePageAsync(String nextLink, + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2618,7 +2616,7 @@ private Mono> listUpgradeNotificationsNe } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listUpgradeNotificationsNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -2630,11 +2628,11 @@ private Mono> listUpgradeNotificationsNe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all Redis caches in the specified subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2645,7 +2643,7 @@ private Mono> listByResourceGroupNextSinglePag final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(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())); @@ -2659,11 +2657,11 @@ private Mono> listByResourceGroupNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all Redis caches in the specified subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2674,7 +2672,7 @@ private Mono> listByResourceGroupNextSinglePag } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -2686,11 +2684,11 @@ private Mono> listByResourceGroupNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation along with {@link PagedResponse} on successful completion of + * @return the response of listUpgradeNotifications along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listUpgradeNotificationsNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2701,8 +2699,8 @@ private Mono> listBySubscriptionNextSinglePage final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + context -> service.listUpgradeNotificationsNext(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())); } @@ -2715,11 +2713,11 @@ private Mono> listBySubscriptionNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list Redis operation along with {@link PagedResponse} on successful completion of + * @return the response of listUpgradeNotifications along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private Mono> listUpgradeNotificationsNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2730,7 +2728,7 @@ private Mono> listBySubscriptionNextSinglePage } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listUpgradeNotificationsNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientBuilder.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientBuilder.java index de7bea1aa2e0c..736877afbc61d 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientBuilder.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientBuilder.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.redis.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { RedisManagementClientImpl.class }) public final class RedisManagementClientBuilder { /* - * 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 RedisManagementClientBuilder. */ - public RedisManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public RedisManagementClientBuilder 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 RedisManagementClientBuilder. */ - public RedisManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public RedisManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public RedisManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); RedisManagementClientImpl client = new RedisManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientImpl.java index 0d5f8d5aa2255..9e1d383e83b17 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientImpl.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.redis.implementation; @@ -28,26 +28,12 @@ @ServiceClient(builder = RedisManagementClientBuilder.class) public final class RedisManagementClientImpl extends AzureServiceClient implements RedisManagementClient { /** - * 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. */ @@ -56,12 +42,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -69,6 +55,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. */ @@ -125,48 +125,6 @@ public OperationsClient getOperations() { return this.operations; } - /** - * The RedisClient object to access its operations. - */ - private final RedisClient redis; - - /** - * Gets the RedisClient object to access its operations. - * - * @return the RedisClient object. - */ - public RedisClient getRedis() { - return this.redis; - } - - /** - * The FirewallRulesClient object to access its operations. - */ - private final FirewallRulesClient firewallRules; - - /** - * Gets the FirewallRulesClient object to access its operations. - * - * @return the FirewallRulesClient object. - */ - public FirewallRulesClient getFirewallRules() { - return this.firewallRules; - } - - /** - * The PatchSchedulesClient object to access its operations. - */ - private final PatchSchedulesClient patchSchedules; - - /** - * Gets the PatchSchedulesClient object to access its operations. - * - * @return the PatchSchedulesClient object. - */ - public PatchSchedulesClient getPatchSchedules() { - return this.patchSchedules; - } - /** * The LinkedServersClient object to access its operations. */ @@ -195,6 +153,20 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } + /** + * The RedisClient object to access its operations. + */ + private final RedisClient redis; + + /** + * Gets the RedisClient object to access its operations. + * + * @return the RedisClient object. + */ + public RedisClient getRedis() { + return this.redis; + } + /** * The PrivateLinkResourcesClient object to access its operations. */ @@ -210,17 +182,31 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { } /** - * The AsyncOperationStatusClient object to access its operations. + * The FirewallRulesClient object to access its operations. */ - private final AsyncOperationStatusClient asyncOperationStatus; + private final FirewallRulesClient firewallRules; /** - * Gets the AsyncOperationStatusClient object to access its operations. + * Gets the FirewallRulesClient object to access its operations. * - * @return the AsyncOperationStatusClient object. + * @return the FirewallRulesClient object. */ - public AsyncOperationStatusClient getAsyncOperationStatus() { - return this.asyncOperationStatus; + public FirewallRulesClient getFirewallRules() { + return this.firewallRules; + } + + /** + * The PatchSchedulesClient object to access its operations. + */ + private final PatchSchedulesClient patchSchedules; + + /** + * Gets the PatchSchedulesClient object to access its operations. + * + * @return the PatchSchedulesClient object. + */ + public PatchSchedulesClient getPatchSchedules() { + return this.patchSchedules; } /** @@ -251,6 +237,20 @@ public AccessPolicyAssignmentsClient getAccessPolicyAssignments() { return this.accessPolicyAssignments; } + /** + * The AsyncOperationStatusClient object to access its operations. + */ + private final AsyncOperationStatusClient asyncOperationStatus; + + /** + * Gets the AsyncOperationStatusClient object to access its operations. + * + * @return the AsyncOperationStatusClient object. + */ + public AsyncOperationStatusClient getAsyncOperationStatus() { + return this.asyncOperationStatus; + } + /** * Initializes an instance of RedisManagementClient client. * @@ -258,27 +258,27 @@ public AccessPolicyAssignmentsClient getAccessPolicyAssignments() { * @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. */ RedisManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-11-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-08-01-preview"; this.operations = new OperationsClientImpl(this); - this.redis = new RedisClientImpl(this); - this.firewallRules = new FirewallRulesClientImpl(this); - this.patchSchedules = new PatchSchedulesClientImpl(this); this.linkedServers = new LinkedServersClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.redis = new RedisClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.asyncOperationStatus = new AsyncOperationStatusClientImpl(this); + this.firewallRules = new FirewallRulesClientImpl(this); + this.patchSchedules = new PatchSchedulesClientImpl(this); this.accessPolicies = new AccessPoliciesClientImpl(this); this.accessPolicyAssignments = new AccessPolicyAssignmentsClientImpl(this); + this.asyncOperationStatus = new AsyncOperationStatusClientImpl(this); } } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/NotificationListResponse.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/NotificationListResponse.java similarity index 75% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/NotificationListResponse.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/NotificationListResponse.java index 39b229f57d010..49229fae57aff 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/NotificationListResponse.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/NotificationListResponse.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * The response of listUpgradeNotifications. */ -@Fluent +@Immutable public final class NotificationListResponse implements JsonSerializable { /* - * List of all notifications. + * The UpgradeNotification items on this page */ private List value; /* - * Link for next set of notifications. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of NotificationListResponse class. */ - public NotificationListResponse() { + private NotificationListResponse() { } /** - * Get the value property: List of all notifications. + * Get the value property: The UpgradeNotification items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: List of all notifications. - * - * @param value the value value to set. - * @return the NotificationListResponse object itself. - */ - public NotificationListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of notifications. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model NotificationListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(NotificationListResponse.class); + /** * {@inheritDoc} */ @@ -81,6 +76,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 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NotificationListResponse 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 NotificationListResponse. */ public static NotificationListResponse fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/OperationListResult.java similarity index 81% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/OperationListResult.java index ecb2aaa973abd..fb06230c726dc 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +18,7 @@ * Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the * next set of results. */ -@Fluent +@Immutable public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider. @@ -32,7 +33,7 @@ public final class OperationListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: List of operations supported by the resource provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: URL to get the next set of operation list results if there are any. * @@ -70,11 +60,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ @@ -82,6 +77,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(); } @@ -91,6 +87,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateEndpointConnectionListResult.java similarity index 66% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateEndpointConnectionListResult.java index 2824198a8eca4..7b9a56b9c491d 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateEndpointConnectionListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,24 +15,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,14 +46,12 @@ public List value() { } /** - * Set the value property: Array of private endpoint connections. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. + * @return the nextLink value. */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -56,11 +60,17 @@ public PrivateEndpointConnectionListResult withValue(List e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionListResult.class); + /** * {@inheritDoc} */ @@ -68,6 +78,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 +88,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 +103,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkResourceListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateLinkResourceListResult.java similarity index 66% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkResourceListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateLinkResourceListResult.java index 05aaf30de82d1..487bb54619510 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkResourceListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateLinkResourceListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,23 +15,28 @@ import java.util.List; /** - * A list of private link resources. + * The response of a PrivateLinkResource list operation. */ -@Fluent +@Immutable public final class PrivateLinkResourceListResult implements JsonSerializable { /* - * Array of private link resources + * The PrivateLinkResource items on this page */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of PrivateLinkResourceListResult class. */ - public PrivateLinkResourceListResult() { + private PrivateLinkResourceListResult() { } /** - * Get the value property: Array of private link resources. + * Get the value property: The PrivateLinkResource items on this page. * * @return the value value. */ @@ -39,14 +45,12 @@ public List value() { } /** - * Set the value property: Array of private link resources. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. + * @return the nextLink value. */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -55,11 +59,17 @@ public PrivateLinkResourceListResult withValue(List va * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PrivateLinkResourceListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourceListResult.class); + /** * {@inheritDoc} */ @@ -67,6 +77,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(); } @@ -76,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateLinkResourceListResult 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 PrivateLinkResourceListResult. */ public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { @@ -90,6 +102,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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyAssignmentList.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyAssignmentList.java similarity index 75% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyAssignmentList.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyAssignmentList.java index 8201d6645ba93..4c1ebdcc288da 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyAssignmentList.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyAssignmentList.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +17,27 @@ /** * List of access policies assignments (with properties) of a Redis cache. */ -@Fluent +@Immutable public final class RedisCacheAccessPolicyAssignmentList implements JsonSerializable { /* - * List of access policies assignments (with properties) of a Redis cache. + * The RedisCacheAccessPolicyAssignment items on this page */ private List value; /* - * Link for next set. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisCacheAccessPolicyAssignmentList class. */ - public RedisCacheAccessPolicyAssignmentList() { + private RedisCacheAccessPolicyAssignmentList() { } /** - * Get the value property: List of access policies assignments (with properties) of a Redis cache. + * Get the value property: The RedisCacheAccessPolicyAssignment items on this page. * * @return the value value. */ @@ -45,18 +46,7 @@ public List value() { } /** - * Set the value property: List of access policies assignments (with properties) of a Redis cache. - * - * @param value the value value to set. - * @return the RedisCacheAccessPolicyAssignmentList object itself. - */ - public RedisCacheAccessPolicyAssignmentList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -70,11 +60,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedisCacheAccessPolicyAssignmentList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisCacheAccessPolicyAssignmentList.class); + /** * {@inheritDoc} */ @@ -82,6 +78,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(); } @@ -91,6 +88,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisCacheAccessPolicyAssignmentList 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 RedisCacheAccessPolicyAssignmentList. */ public static RedisCacheAccessPolicyAssignmentList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyList.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyList.java similarity index 74% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyList.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyList.java index 2a9bfb5e4b40b..e9b56741a0fec 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCacheAccessPolicyList.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyList.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * List of access policies (with properties) of a Redis cache. */ -@Fluent +@Immutable public final class RedisCacheAccessPolicyList implements JsonSerializable { /* - * List of access policies (with properties) of a Redis cache. + * The RedisCacheAccessPolicy items on this page */ private List value; /* - * Link for next set. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisCacheAccessPolicyList class. */ - public RedisCacheAccessPolicyList() { + private RedisCacheAccessPolicyList() { } /** - * Get the value property: List of access policies (with properties) of a Redis cache. + * Get the value property: The RedisCacheAccessPolicy items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: List of access policies (with properties) of a Redis cache. - * - * @param value the value value to set. - * @return the RedisCacheAccessPolicyList object itself. - */ - public RedisCacheAccessPolicyList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedisCacheAccessPolicyList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisCacheAccessPolicyList.class); + /** * {@inheritDoc} */ @@ -81,6 +77,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 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisCacheAccessPolicyList 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 RedisCacheAccessPolicyList. */ public static RedisCacheAccessPolicyList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisFirewallRuleListResult.java similarity index 73% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisFirewallRuleListResult.java index 45997f0d2ce9e..e993151e690e3 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisFirewallRuleListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * The response of list firewall rules Redis operation. + * The response of a RedisFirewallRule list operation. */ -@Fluent +@Immutable public final class RedisFirewallRuleListResult implements JsonSerializable { /* - * Results of the list firewall rules operation. + * The RedisFirewallRule items on this page */ private List value; /* - * Link for next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisFirewallRuleListResult class. */ - public RedisFirewallRuleListResult() { + private RedisFirewallRuleListResult() { } /** - * Get the value property: Results of the list firewall rules operation. + * Get the value property: The RedisFirewallRule items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: Results of the list firewall rules operation. - * - * @param value the value value to set. - * @return the RedisFirewallRuleListResult object itself. - */ - public RedisFirewallRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedisFirewallRuleListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisFirewallRuleListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +77,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 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisFirewallRuleListResult 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 RedisFirewallRuleListResult. */ public static RedisFirewallRuleListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisLinkedServerWithPropertiesList.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisLinkedServerWithPropertiesList.java similarity index 75% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisLinkedServerWithPropertiesList.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisLinkedServerWithPropertiesList.java index 92f5327774f65..0d088dd9d6cce 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisLinkedServerWithPropertiesList.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisLinkedServerWithPropertiesList.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +17,27 @@ /** * List of linked servers (with properties) of a Redis cache. */ -@Fluent +@Immutable public final class RedisLinkedServerWithPropertiesList implements JsonSerializable { /* - * List of linked servers (with properties) of a Redis cache. + * The RedisLinkedServerWithProperties items on this page */ private List value; /* - * Link for next set. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisLinkedServerWithPropertiesList class. */ - public RedisLinkedServerWithPropertiesList() { + private RedisLinkedServerWithPropertiesList() { } /** - * Get the value property: List of linked servers (with properties) of a Redis cache. + * Get the value property: The RedisLinkedServerWithProperties items on this page. * * @return the value value. */ @@ -45,18 +46,7 @@ public List value() { } /** - * Set the value property: List of linked servers (with properties) of a Redis cache. - * - * @param value the value value to set. - * @return the RedisLinkedServerWithPropertiesList object itself. - */ - public RedisLinkedServerWithPropertiesList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -70,11 +60,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedisLinkedServerWithPropertiesList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisLinkedServerWithPropertiesList.class); + /** * {@inheritDoc} */ @@ -82,6 +78,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(); } @@ -91,6 +88,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisLinkedServerWithPropertiesList 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 RedisLinkedServerWithPropertiesList. */ public static RedisLinkedServerWithPropertiesList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisListResult.java similarity index 74% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisListResult.java index 6e6f70d7bc5a2..35fa27e083517 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * The response of list Redis operation. */ -@Fluent +@Immutable public final class RedisListResult implements JsonSerializable { /* - * List of Redis cache instances. + * The RedisResource items on this page */ private List value; /* - * Link for next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisListResult class. */ - public RedisListResult() { + private RedisListResult() { } /** - * Get the value property: List of Redis cache instances. + * Get the value property: The RedisResource items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: List of Redis cache instances. - * - * @param value the value value to set. - * @return the RedisListResult object itself. - */ - public RedisListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RedisListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,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 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisListResult 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 RedisListResult. */ public static RedisListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisPatchScheduleListResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisPatchScheduleListResult.java similarity index 73% rename from sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisPatchScheduleListResult.java rename to sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisPatchScheduleListResult.java index 79111f2898385..37d2bc39cab55 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisPatchScheduleListResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisPatchScheduleListResult.java @@ -1,10 +1,11 @@ // 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.redis.models; +package com.azure.resourcemanager.redis.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * The response of list patch schedules Redis operation. + * The response of a RedisPatchSchedule list operation. */ -@Fluent +@Immutable public final class RedisPatchScheduleListResult implements JsonSerializable { /* - * Results of the list patch schedules operation. + * The RedisPatchSchedule items on this page */ private List value; /* - * Link for next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RedisPatchScheduleListResult class. */ - public RedisPatchScheduleListResult() { + private RedisPatchScheduleListResult() { } /** - * Get the value property: Results of the list patch schedules operation. + * Get the value property: The RedisPatchSchedule items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: Results of the list patch schedules operation. - * - * @param value the value value to set. - * @return the RedisPatchScheduleListResult object itself. - */ - public RedisPatchScheduleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedisPatchScheduleListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(RedisPatchScheduleListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +77,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 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RedisPatchScheduleListResult 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 RedisPatchScheduleListResult. */ public static RedisPatchScheduleListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyAssignmentProvisioningState.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyAssignmentProvisioningState.java index 7e8779bff6afa..06484c0355b30 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyAssignmentProvisioningState.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyAssignmentProvisioningState.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.redis.models; @@ -13,32 +13,34 @@ public final class AccessPolicyAssignmentProvisioningState extends ExpandableStringEnum { /** - * Static value Updating for AccessPolicyAssignmentProvisioningState. + * The access policy assignments are being updated. */ public static final AccessPolicyAssignmentProvisioningState UPDATING = fromString("Updating"); /** - * Static value Succeeded for AccessPolicyAssignmentProvisioningState. + * The access policy assignments were successfully updated. */ public static final AccessPolicyAssignmentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Deleting for AccessPolicyAssignmentProvisioningState. + * The access policy assignments are being deleted. */ public static final AccessPolicyAssignmentProvisioningState DELETING = fromString("Deleting"); /** - * Static value Deleted for AccessPolicyAssignmentProvisioningState. + * The access policy assignments are considered deleted, meaning no custom access policies are applied. */ public static final AccessPolicyAssignmentProvisioningState DELETED = fromString("Deleted"); /** - * Static value Canceled for AccessPolicyAssignmentProvisioningState. + * The operation was canceled. Access policy assignments may be in a partially updated state. Update them again to + * have a well-defined state. */ public static final AccessPolicyAssignmentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Failed for AccessPolicyAssignmentProvisioningState. + * The operation failed. Access policy assignments may be in a partially updated state. Update them again to have a + * well-defined state. */ public static final AccessPolicyAssignmentProvisioningState FAILED = fromString("Failed"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyProvisioningState.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyProvisioningState.java index afba98c622578..3dc4da303a1ff 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyProvisioningState.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyProvisioningState.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.redis.models; @@ -12,32 +12,34 @@ */ public final class AccessPolicyProvisioningState extends ExpandableStringEnum { /** - * Static value Updating for AccessPolicyProvisioningState. + * An operation is in progress. */ public static final AccessPolicyProvisioningState UPDATING = fromString("Updating"); /** - * Static value Succeeded for AccessPolicyProvisioningState. + * The operation succeeded. */ public static final AccessPolicyProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Deleting for AccessPolicyProvisioningState. + * A delete operation is in progress. */ public static final AccessPolicyProvisioningState DELETING = fromString("Deleting"); /** - * Static value Deleted for AccessPolicyProvisioningState. + * The access policy is considered deleted, if it still exists. */ public static final AccessPolicyProvisioningState DELETED = fromString("Deleted"); /** - * Static value Canceled for AccessPolicyProvisioningState. + * The operation was canceled. Access policies may be in a partially updated state. Update them again to have a + * well-defined state. */ public static final AccessPolicyProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Failed for AccessPolicyProvisioningState. + * The operation failed. Access policies may be in a partially updated state. Update them again to have a + * well-defined state. */ public static final AccessPolicyProvisioningState FAILED = fromString("Failed"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyType.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyType.java index 5c1d9bf69b514..dcd82ffffc40f 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyType.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyType.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.redis.models; @@ -12,12 +12,12 @@ */ public final class AccessPolicyType extends ExpandableStringEnum { /** - * Static value Custom for AccessPolicyType. + * User-configurable access policy, using the redis access policy authoring language. */ public static final AccessPolicyType CUSTOM = fromString("Custom"); /** - * Static value BuiltIn for AccessPolicyType. + * Built-in or well-known access policies, whose policy is not configurable. */ public static final AccessPolicyType BUILT_IN = fromString("BuiltIn"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/CheckNameAvailabilityParameters.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/CheckNameAvailabilityParameters.java index aa1c5fec53ef0..1067c35f7cba4 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/CheckNameAvailabilityParameters.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/CheckNameAvailabilityParameters.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.redis.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DayOfWeek.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DayOfWeek.java index ed0402d92a29e..e2b55e587a5cf 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DayOfWeek.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DayOfWeek.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.redis.models; @@ -44,12 +44,12 @@ public enum DayOfWeek { SUNDAY("Sunday"), /** - * Enum value Everyday. + * As a convenience, 'Everyday' is also accepted and means the same as specifying all days of the week. */ EVERYDAY("Everyday"), /** - * Enum value Weekend. + * As a convenience, 'Weekend' is also accepted and means the same as specifying Saturday and Sunday. */ WEEKEND("Weekend"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DefaultName.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DefaultName.java index c5f4cbacd768f..153f402f2da33 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DefaultName.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/DefaultName.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.redis.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Defines values for DefaultName. + * The name of the resource that is the target of a particular operation. For singleton resources, it must be 'Default'. */ public final class DefaultName extends ExpandableStringEnum { /** - * Static value default for DefaultName. + * The name of e.g. the patch schedules resource, which is a singleton, must always be 'Default'. */ public static final DefaultName DEFAULT = fromString("default"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ExportRdbParameters.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ExportRdbParameters.java index 6586bbd7d239c..36d5bf2a6ed8d 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ExportRdbParameters.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ExportRdbParameters.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.redis.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ImportRdbParameters.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ImportRdbParameters.java index 68a5a2125ba82..6a7107bb3d843 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ImportRdbParameters.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ImportRdbParameters.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.redis.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentity.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentity.java index 4084e5c4d1771..df7938d6bab81 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentity.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentity.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.redis.models; @@ -32,15 +32,12 @@ public final class ManagedServiceIdentity implements JsonSerializable userAssignedIdentities; @@ -71,8 +68,7 @@ public UUID 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 +77,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 +88,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 +97,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. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentityType.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentityType.java index dc0fee78781d3..db70353f02db3 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentityType.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationDisplay.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationDisplay.java index 91c6a178ba28a..6bf1b91961681 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationDisplay.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationDisplay.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.redis.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,7 +14,7 @@ /** * The object that describes the operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Friendly name of the resource provider @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { /* * Fully qualified ID for the async operation. @@ -40,7 +40,7 @@ public class OperationStatusResult implements JsonSerializable operations() { * @param operations the operations value to set. * @return the OperationStatusResult object itself. */ - public OperationStatusResult withOperations(List operations) { + OperationStatusResult withOperations(List operations) { this.operations = operations; return this; } @@ -223,7 +223,7 @@ public ManagementError error() { * @param error the error value to set. * @return the OperationStatusResult object itself. */ - public OperationStatusResult withError(ManagementError error) { + OperationStatusResult withError(ManagementError error) { this.error = error; return this; } @@ -287,7 +287,7 @@ public static OperationStatusResult fromJson(JsonReader jsonReader) throws IOExc } else if ("name".equals(fieldName)) { deserializedOperationStatusResult.name = reader.getString(); } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusResult.percentComplete = reader.getNullable(JsonReader::getFloat); + deserializedOperationStatusResult.percentComplete = reader.getNullable(JsonReader::getDouble); } else if ("startTime".equals(fieldName)) { deserializedOperationStatusResult.startTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpoint.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpoint.java index 4e0cebc3aec34..262e7e894ba0c 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpoint.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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. */ diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionProvisioningState.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionProvisioningState.java index bcaabf079ce45..841cfbff92811 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointServiceConnectionStatus.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointServiceConnectionStatus.java index b99b1f9d45ff5..de098a91430a6 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.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/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkServiceConnectionState.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkServiceConnectionState.java index 9a744ef02bec3..dd06b93517fe0 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkServiceConnectionState.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ProvisioningState.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ProvisioningState.java index d953925607a85..9716e18acaab0 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ProvisioningState.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; @@ -12,70 +12,96 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Creating for ProvisioningState. + * A create operation is in progress. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value Deleting for ProvisioningState. + * A delete operation is in progress. */ public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Static value Disabled for ProvisioningState. + * The cache is disabled and cannot be used. */ public static final ProvisioningState DISABLED = fromString("Disabled"); /** - * Static value Failed for ProvisioningState. + * An operation such as create or update failed. If you failed to create the cache it will not be in a usable state, + * so you should delete and recreate it. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Linking for ProvisioningState. + * Georeplication link is in progress. */ public static final ProvisioningState LINKING = fromString("Linking"); /** - * Static value Provisioning for ProvisioningState. + * An operation is in progress. */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); /** - * Static value RecoveringScaleFailure for ProvisioningState. + * A scaling operation encountered an error and recovery is in progress. */ public static final ProvisioningState RECOVERING_SCALE_FAILURE = fromString("RecoveringScaleFailure"); /** - * Static value Scaling for ProvisioningState. + * A scaling operation is in progress. */ public static final ProvisioningState SCALING = fromString("Scaling"); /** - * Static value Succeeded for ProvisioningState. + * The most recent operation successfully completed. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Unlinking for ProvisioningState. + * Georeplication unlink is in progress. */ public static final ProvisioningState UNLINKING = fromString("Unlinking"); /** - * Static value Unprovisioning for ProvisioningState. + * The cache may be being disabled. */ public static final ProvisioningState UNPROVISIONING = fromString("Unprovisioning"); /** - * Static value Updating for ProvisioningState. + * An update operation is in progress. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value ConfiguringAAD for ProvisioningState. + * An AAD configuration update operation is in progress. */ public static final ProvisioningState CONFIGURING_AAD = fromString("ConfiguringAAD"); + /** + * A migration to Azure Managed Redis is in progress. + */ + public static final ProvisioningState MIGRATING = fromString("Migrating"); + + /** + * A migration to Azure Managed Redis failed. + */ + public static final ProvisioningState MIGRATION_FAILED = fromString("MigrationFailed"); + + /** + * A migration to Azure Managed Redis succeeded. + */ + public static final ProvisioningState MIGRATION_SUCCEEDED = fromString("MigrationSucceeded"); + + /** + * A cancellation (rollback) of a migration to Azure Managed Redis is in progress. + */ + public static final ProvisioningState MIGRATION_CANCELLING = fromString("MigrationCancelling"); + + /** + * A cancellation (rollback) of a migration to Azure Managed Redis has failed. + */ + public static final ProvisioningState MIGRATION_CANCELLATION_FAILED = fromString("MigrationCancellationFailed"); + /** * Creates a new instance of ProvisioningState value. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PublicNetworkAccess.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PublicNetworkAccess.java index 0a6b3a6dd81d5..cb6087994d433 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/PublicNetworkAccess.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; @@ -14,12 +14,13 @@ */ public final class PublicNetworkAccess extends ExpandableStringEnum { /** - * Static value Enabled for PublicNetworkAccess. + * Public internet access to the cache, via its public IP address, is enabled. Connections may use any network path. */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); /** - * Static value Disabled for PublicNetworkAccess. + * Public internet access to the cache, via its public IP address, is disabled. Connections must use be made via + * private endpoints. */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RebootType.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RebootType.java index a9dd7324ac8d4..8ebd62dc12252 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RebootType.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RebootType.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.redis.models; @@ -12,17 +12,17 @@ */ public final class RebootType extends ExpandableStringEnum { /** - * Static value PrimaryNode for RebootType. + * Reboot the primary nodes used for redis write operations. (This may trigger role changes.). */ public static final RebootType PRIMARY_NODE = fromString("PrimaryNode"); /** - * Static value SecondaryNode for RebootType. + * Reboot only the secondary or replica nodes. */ public static final RebootType SECONDARY_NODE = fromString("SecondaryNode"); /** - * Static value AllNodes for RebootType. + * Reboot all nodes, not guaranteed to happen simultaneously. */ public static final RebootType ALL_NODES = fromString("AllNodes"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCommonProperties.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCommonProperties.java index f1e4c7ae093d8..4007a3f54885e 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCommonProperties.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCommonProperties.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.redis.models; @@ -64,8 +64,7 @@ public class RedisCommonProperties implements JsonSerializable { /* - * Specifies whether the rdb backup is enabled + * Specifies whether the RDB backup is enabled */ private String rdbBackupEnabled; @@ -105,7 +105,7 @@ public final class RedisConfiguration implements JsonSerializable additionalProperties; + private Map additionalProperties; /** * Creates an instance of RedisConfiguration class. @@ -134,7 +134,7 @@ public RedisConfiguration() { } /** - * Get the rdbBackupEnabled property: Specifies whether the rdb backup is enabled. + * Get the rdbBackupEnabled property: Specifies whether the RDB backup is enabled. * * @return the rdbBackupEnabled value. */ @@ -143,7 +143,7 @@ public String rdbBackupEnabled() { } /** - * Set the rdbBackupEnabled property: Specifies whether the rdb backup is enabled. + * Set the rdbBackupEnabled property: Specifies whether the RDB backup is enabled. * * @param rdbBackupEnabled the rdbBackupEnabled value to set. * @return the RedisConfiguration object itself. @@ -427,7 +427,7 @@ public String zonalConfiguration() { /** * Get the authnotrequired property: Specifies whether the authentication is disabled. Setting this property is - * highly discouraged from security point of view. + * highly discouraged from security point of view; you should never disable authentication using this property!. * * @return the authnotrequired value. */ @@ -437,7 +437,7 @@ public String authnotrequired() { /** * Set the authnotrequired property: Specifies whether the authentication is disabled. Setting this property is - * highly discouraged from security point of view. + * highly discouraged from security point of view; you should never disable authentication using this property!. * * @param authnotrequired the authnotrequired value to set. * @return the RedisConfiguration object itself. @@ -499,7 +499,7 @@ public RedisConfiguration withAadEnabled(String aadEnabled) { * * @return the additionalProperties value. */ - public Map additionalProperties() { + public Map additionalProperties() { return this.additionalProperties; } @@ -512,7 +512,7 @@ public Map additionalProperties() { * @param additionalProperties the additionalProperties value to set. * @return the RedisConfiguration object itself. */ - public RedisConfiguration withAdditionalProperties(Map additionalProperties) { + public RedisConfiguration withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } @@ -548,7 +548,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("storage-subscription-id", this.storageSubscriptionId); jsonWriter.writeStringField("aad-enabled", this.aadEnabled); if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); } } @@ -566,7 +566,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static RedisConfiguration fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { RedisConfiguration deserializedRedisConfiguration = new RedisConfiguration(); - Map additionalProperties = null; + Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -614,7 +614,7 @@ public static RedisConfiguration fromJson(JsonReader jsonReader) throws IOExcept additionalProperties = new LinkedHashMap<>(); } - additionalProperties.put(fieldName, reader.getString()); + additionalProperties.put(fieldName, reader.readUntyped()); } } deserializedRedisConfiguration.additionalProperties = additionalProperties; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCreateParameters.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCreateParameters.java index e431a374dc5aa..3f2503fac41f7 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCreateParameters.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCreateParameters.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.redis.models; @@ -414,7 +414,7 @@ public RedisCreateParameters withMinimumTlsVersion(TlsVersion minimumTlsVersion) /** * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this cache. Value is * optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive - * access method. Default value is 'Enabled'. + * access method. * * @return the publicNetworkAccess value. */ @@ -425,7 +425,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this cache. Value is * optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive - * access method. Default value is 'Enabled'. + * access method. * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the RedisCreateParameters object itself. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleCreateParameters.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleCreateParameters.java index b39838f169a47..f37b358939950 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleCreateParameters.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleCreateParameters.java @@ -1,10 +1,11 @@ // 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.redis.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -19,6 +20,11 @@ */ @Fluent public final class RedisFirewallRuleCreateParameters extends RedisFirewallRuleInner { + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * redis cache firewall rule properties */ @@ -45,6 +51,16 @@ public final class RedisFirewallRuleCreateParameters extends RedisFirewallRuleIn public RedisFirewallRuleCreateParameters() { } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + /** * Get the innerProperties property: redis cache firewall rule properties. * @@ -184,6 +200,8 @@ public static RedisFirewallRuleCreateParameters fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedRedisFirewallRuleCreateParameters.innerProperties = RedisFirewallRuleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRedisFirewallRuleCreateParameters.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisInstanceDetails.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisInstanceDetails.java index 20aa12bdeb511..9fbda0329cf68 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisInstanceDetails.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisInstanceDetails.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.redis.models; @@ -49,7 +49,7 @@ public final class RedisInstanceDetails implements JsonSerializable { /** - * Static value C for SkuFamily. + * The SKU family to use - must be 'C' for Basic/Standard SKU redis caches. */ public static final SkuFamily C = fromString("C"); /** - * Static value P for SkuFamily. + * The SKU family to use - must be 'P' for Premium SKU redis caches. */ public static final SkuFamily P = fromString("P"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/SkuName.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/SkuName.java index c9e7cd54043f7..6bb562527d25d 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/SkuName.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; @@ -12,17 +12,18 @@ */ public final class SkuName extends ExpandableStringEnum { /** - * Static value Basic for SkuName. + * The well known 'Basic' SKU for Azure Cache for Redis. Basic SKU does not have an availability SLA. */ public static final SkuName BASIC = fromString("Basic"); /** - * Static value Standard for SkuName. + * The well known 'Standard' SKU for Azure Cache for Redis. Standard SKU has an availability SLA. */ public static final SkuName STANDARD = fromString("Standard"); /** - * Static value Premium for SkuName. + * The well known 'Premium' SKU for Azure Cache for Redis. Premium SKU has an availability SLA, and higher + * performance tiers and more features compared with Standard SKU. */ public static final SkuName PREMIUM = fromString("Premium"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/TlsVersion.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/TlsVersion.java index e9f4c6e433e81..03ed070b3f051 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/TlsVersion.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; @@ -12,17 +12,18 @@ */ public final class TlsVersion extends ExpandableStringEnum { /** - * Static value 1.0 for TlsVersion. + * TLS protocol version 1.0 -- deprecated for security reasons. Do not use this value for new caches. */ public static final TlsVersion ONE_ZERO = fromString("1.0"); /** - * Static value 1.1 for TlsVersion. + * TLS protocol version 1.1 -- deprecated for security reasons. Do not use this value for new caches. */ public static final TlsVersion ONE_ONE = fromString("1.1"); /** - * Static value 1.2 for TlsVersion. + * TLS protocol version 1.2 -- use this value, or higher, for new caches. Or do not specify, so that your cache uses + * the recommended default value. */ public static final TlsVersion ONE_TWO = fromString("1.2"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UpdateChannel.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UpdateChannel.java index 597a308fb73f0..dc2b43ffd4cdf 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UpdateChannel.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UpdateChannel.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.redis.models; @@ -14,12 +14,14 @@ */ public final class UpdateChannel extends ExpandableStringEnum { /** - * Static value Stable for UpdateChannel. + * Stable channel receives updates, which may include important security and stability updates, later than Preview + * channel. */ public static final UpdateChannel STABLE = fromString("Stable"); /** - * Static value Preview for UpdateChannel. + * Preview channel normally receives updates before Stable channel, and is the recommended channel for + * non-production workloads. */ public static final UpdateChannel PREVIEW = fromString("Preview"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UserAssignedIdentity.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UserAssignedIdentity.java index 868870222e108..af081e6a342cc 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/UserAssignedIdentity.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/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.redis.models; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ZonalAllocationPolicy.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ZonalAllocationPolicy.java index aaab358551b3c..e99e1d68c506a 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ZonalAllocationPolicy.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/ZonalAllocationPolicy.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.redis.models; @@ -16,17 +16,18 @@ */ public final class ZonalAllocationPolicy extends ExpandableStringEnum { /** - * Static value Automatic for ZonalAllocationPolicy. + * The zones for the cache will be selected automatically based on availability and capacity. */ public static final ZonalAllocationPolicy AUTOMATIC = fromString("Automatic"); /** - * Static value UserDefined for ZonalAllocationPolicy. + * UserDefined means the zones for the cache are manually configured using the 'zones' property, and can not be + * automatically selected. */ public static final ZonalAllocationPolicy USER_DEFINED = fromString("UserDefined"); /** - * Static value NoZones for ZonalAllocationPolicy. + * The cache will not use multiple availability zones. */ public static final ZonalAllocationPolicy NO_ZONES = fromString("NoZones"); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/package-info.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/package-info.java index 4a6ebd027ff01..55ff0c3f8fbdd 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/package-info.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/package-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. /** * Package containing the data models for RedisManagementClient. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/package-info.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/package-info.java index 9a928eb9c8dfb..d86937a1f398c 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/package-info.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/package-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. /** * Package containing the classes for RedisManagementClient. diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/module-info.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/module-info.java index 7da9a52d63f38..858fe8df77fbb 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/module-info.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/module-info.java @@ -13,4 +13,5 @@ // open packages specifically for azure core opens com.azure.resourcemanager.redis.fluent.models to com.azure.core; opens com.azure.resourcemanager.redis.models to com.azure.core; + opens com.azure.resourcemanager.redis.implementation.models to com.azure.core; } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/resources/META-INF/azure-resourcemanager-redis_metadata.json b/sdk/redis/azure-resourcemanager-redis/src/main/resources/META-INF/azure-resourcemanager-redis_metadata.json new file mode 100644 index 0000000000000..862c9006c2a73 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/main/resources/META-INF/azure-resourcemanager-redis_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Cache":"2025-08-01-preview"},"generatedFiles":["src/main/java/com/azure/resourcemanager/redis/fluent/AccessPoliciesClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/AccessPolicyAssignmentsClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/AsyncOperationStatusClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/FirewallRulesClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/LinkedServersClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/PatchSchedulesClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/RedisClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/RedisManagementClient.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisAccessKeysInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisCacheAccessPolicyAssignmentInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisCacheAccessPolicyAssignmentProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisCacheAccessPolicyInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisCacheAccessPolicyProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisCreateProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisFirewallRuleInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisFirewallRuleProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisForceRebootResponseInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisLinkedServerCreateProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisLinkedServerProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisLinkedServerWithPropertiesInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisPatchScheduleInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisPropertiesInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisResourceInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/RedisUpdateProperties.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/ScheduleEntries.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/UpgradeNotificationInner.java","src/main/java/com/azure/resourcemanager/redis/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/redis/fluent/package-info.java","src/main/java/com/azure/resourcemanager/redis/implementation/AccessPoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/AccessPolicyAssignmentsClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/AsyncOperationStatusClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/FirewallRulesClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/LinkedServersClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/PatchSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/RedisClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/redis/implementation/RedisManagementClientImpl.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/NotificationListResponse.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyAssignmentList.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisCacheAccessPolicyList.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisFirewallRuleListResult.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisLinkedServerWithPropertiesList.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisListResult.java","src/main/java/com/azure/resourcemanager/redis/implementation/models/RedisPatchScheduleListResult.java","src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyAssignmentProvisioningState.java","src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyProvisioningState.java","src/main/java/com/azure/resourcemanager/redis/models/AccessPolicyType.java","src/main/java/com/azure/resourcemanager/redis/models/CheckNameAvailabilityParameters.java","src/main/java/com/azure/resourcemanager/redis/models/DayOfWeek.java","src/main/java/com/azure/resourcemanager/redis/models/DefaultName.java","src/main/java/com/azure/resourcemanager/redis/models/ExportRdbParameters.java","src/main/java/com/azure/resourcemanager/redis/models/ImportRdbParameters.java","src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/redis/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/redis/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/redis/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/redis/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/redis/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/redis/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/redis/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/redis/models/RebootType.java","src/main/java/com/azure/resourcemanager/redis/models/RedisCommonProperties.java","src/main/java/com/azure/resourcemanager/redis/models/RedisConfiguration.java","src/main/java/com/azure/resourcemanager/redis/models/RedisCreateParameters.java","src/main/java/com/azure/resourcemanager/redis/models/RedisFirewallRuleCreateParameters.java","src/main/java/com/azure/resourcemanager/redis/models/RedisInstanceDetails.java","src/main/java/com/azure/resourcemanager/redis/models/RedisKeyType.java","src/main/java/com/azure/resourcemanager/redis/models/RedisLinkedServer.java","src/main/java/com/azure/resourcemanager/redis/models/RedisLinkedServerCreateParameters.java","src/main/java/com/azure/resourcemanager/redis/models/RedisRebootParameters.java","src/main/java/com/azure/resourcemanager/redis/models/RedisRegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/redis/models/RedisUpdateParameters.java","src/main/java/com/azure/resourcemanager/redis/models/ReplicationRole.java","src/main/java/com/azure/resourcemanager/redis/models/ScheduleEntry.java","src/main/java/com/azure/resourcemanager/redis/models/Sku.java","src/main/java/com/azure/resourcemanager/redis/models/SkuFamily.java","src/main/java/com/azure/resourcemanager/redis/models/SkuName.java","src/main/java/com/azure/resourcemanager/redis/models/TlsVersion.java","src/main/java/com/azure/resourcemanager/redis/models/UpdateChannel.java","src/main/java/com/azure/resourcemanager/redis/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/redis/models/ZonalAllocationPolicy.java","src/main/java/com/azure/resourcemanager/redis/models/package-info.java","src/main/java/com/azure/resourcemanager/redis/package-info.java"]} \ No newline at end of file diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentCreateUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentCreateUpdateSamples.java new file mode 100644 index 0000000000000..5f95b015ea20f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentCreateUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.fluent.models.RedisCacheAccessPolicyAssignmentInner; + +/** + * Samples for AccessPolicyAssignment CreateUpdate. + */ +public final class AccessPolicyAssignmentCreateUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyAssignmentCreateUpdate.json + */ + /** + * Sample code: RedisCacheAccessPolicyAssignmentCreateUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void + redisCacheAccessPolicyAssignmentCreateUpdate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicyAssignments() + .createUpdate("rg1", "cache1", "accessPolicyAssignmentName1", + new RedisCacheAccessPolicyAssignmentInner().withObjectId("6497c918-11ad-41e7-1b0f-7c518a87d0b0") + .withObjectIdAlias("TestAADAppRedis") + .withAccessPolicyName("accessPolicy1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentDeleteSamples.java new file mode 100644 index 0000000000000..ca20a0851d974 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentDeleteSamples.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.redis.generated; + +/** + * Samples for AccessPolicyAssignment Delete. + */ +public final class AccessPolicyAssignmentDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyAssignmentDelete.json + */ + /** + * Sample code: RedisCacheAccessPolicyAssignmentDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyAssignmentDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicyAssignments() + .delete("rg1", "cache1", "accessPolicyAssignmentName1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentGetSamples.java new file mode 100644 index 0000000000000..1c449964a8da5 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentGetSamples.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.redis.generated; + +/** + * Samples for AccessPolicyAssignment Get. + */ +public final class AccessPolicyAssignmentGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyAssignmentGet.json + */ + /** + * Sample code: RedisCacheAccessPolicyAssignmentGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyAssignmentGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicyAssignments() + .getWithResponse("rg1", "cache1", "accessPolicyAssignmentName1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentListSamples.java new file mode 100644 index 0000000000000..903fcd5d5868d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyAssignmentListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for AccessPolicyAssignment List. + */ +public final class AccessPolicyAssignmentListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyAssignmentList.json + */ + /** + * Sample code: RedisCacheAccessPolicyAssignmentList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyAssignmentList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getAccessPolicyAssignments().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyCreateUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyCreateUpdateSamples.java new file mode 100644 index 0000000000000..a6a6873054758 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyCreateUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.fluent.models.RedisCacheAccessPolicyInner; + +/** + * Samples for AccessPolicy CreateUpdate. + */ +public final class AccessPolicyCreateUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyCreateUpdate.json + */ + /** + * Sample code: RedisCacheAccessPolicyCreateUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyCreateUpdate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicies() + .createUpdate("rg1", "cache1", "accessPolicy1", + new RedisCacheAccessPolicyInner().withPermissions("+get +hget"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyDeleteSamples.java new file mode 100644 index 0000000000000..41c512969fd4f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyDeleteSamples.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.redis.generated; + +/** + * Samples for AccessPolicy Delete. + */ +public final class AccessPolicyDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyDelete.json + */ + /** + * Sample code: RedisCacheAccessPolicyDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicies() + .delete("rg1", "cache1", "accessPolicy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyGetSamples.java new file mode 100644 index 0000000000000..fea0989ae424f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyGetSamples.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.redis.generated; + +/** + * Samples for AccessPolicy Get. + */ +public final class AccessPolicyGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyGet.json + */ + /** + * Sample code: RedisCacheAccessPolicyGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAccessPolicies() + .getWithResponse("rg1", "cache1", "accessPolicy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyListSamples.java new file mode 100644 index 0000000000000..b5ad750cd672c --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AccessPolicyListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for AccessPolicy List. + */ +public final class AccessPolicyListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAccessPolicyList.json + */ + /** + * Sample code: RedisCacheAccessPolicyList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAccessPolicyList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getAccessPolicies().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AsyncOperationStatusGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AsyncOperationStatusGetSamples.java new file mode 100644 index 0000000000000..f9d39d9667a9c --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/AsyncOperationStatusGetSamples.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.redis.generated; + +/** + * Samples for AsyncOperationStatus Get. + */ +public final class AsyncOperationStatusGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheAsyncOperationStatus.json + */ + /** + * Sample code: RedisCacheAsyncOperationStatus. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAsyncOperationStatus(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getAsyncOperationStatus() + .getWithResponse("East US", "c7ba2bf5-5939-4d79-b037-2964ccf097da", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3085a378b5df2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.fluent.models.RedisFirewallRuleInner; + +/** + * Samples for FirewallRules CreateOrUpdate. + */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheFirewallRuleCreate.json + */ + /** + * Sample code: RedisCacheFirewallRuleCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleCreate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getFirewallRules() + .createOrUpdateWithResponse("rg1", "cache1", "rule1", + new RedisFirewallRuleInner().withStartIp("192.168.1.1").withEndIp("192.168.1.4"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesDeleteSamples.java new file mode 100644 index 0000000000000..782fd4449a256 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesDeleteSamples.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.redis.generated; + +/** + * Samples for FirewallRules Delete. + */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheFirewallRuleDelete.json + */ + /** + * Sample code: RedisCacheFirewallRuleDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getFirewallRules() + .deleteWithResponse("rg1", "cache1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesGetSamples.java new file mode 100644 index 0000000000000..4a06503d94560 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesGetSamples.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.redis.generated; + +/** + * Samples for FirewallRules Get. + */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheFirewallRuleGet.json + */ + /** + * Sample code: RedisCacheFirewallRuleGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getFirewallRules() + .getWithResponse("rg1", "cache1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesListSamples.java new file mode 100644 index 0000000000000..793b1b0de8a4b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/FirewallRulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for FirewallRules List. + */ +public final class FirewallRulesListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheFirewallRulesList.json + */ + /** + * Sample code: RedisCacheFirewallRulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRulesList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getFirewallRules().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerCreateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerCreateSamples.java new file mode 100644 index 0000000000000..8df7d42fa7675 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.RedisLinkedServerCreateParameters; +import com.azure.resourcemanager.redis.models.ReplicationRole; + +/** + * Samples for LinkedServer Create. + */ +public final class LinkedServerCreateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheLinkedServer_Create.json + */ + /** + * Sample code: LinkedServer_Create. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerCreate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getLinkedServers() + .create("rg1", "cache1", "cache2", new RedisLinkedServerCreateParameters().withLinkedRedisCacheId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2") + .withLinkedRedisCacheLocation("West US") + .withServerRole(ReplicationRole.SECONDARY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerDeleteSamples.java new file mode 100644 index 0000000000000..314b225030f28 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for LinkedServer Delete. + */ +public final class LinkedServerDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheLinkedServer_Delete.json + */ + /** + * Sample code: LinkedServerDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getLinkedServers().delete("rg1", "cache1", "cache2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerGetSamples.java new file mode 100644 index 0000000000000..a7457d33a8bfc --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerGetSamples.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.redis.generated; + +/** + * Samples for LinkedServer Get. + */ +public final class LinkedServerGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheLinkedServer_Get.json + */ + /** + * Sample code: LinkedServer_Get. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getLinkedServers() + .getWithResponse("rg1", "cache1", "cache2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerListSamples.java new file mode 100644 index 0000000000000..346058eb850b5 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/LinkedServerListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for LinkedServer List. + */ +public final class LinkedServerListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheLinkedServer_List.json + */ + /** + * Sample code: LinkedServer_List. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getLinkedServers().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/OperationsListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..1c73f5ddac39f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheOperations.json + */ + /** + * Sample code: RedisCacheOperations. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheOperations(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesCreateOrUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a91b56f210b8d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesCreateOrUpdateSamples.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.redis.generated; + +import com.azure.resourcemanager.redis.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.models.DayOfWeek; +import com.azure.resourcemanager.redis.models.DefaultName; +import com.azure.resourcemanager.redis.models.ScheduleEntry; +import java.time.Duration; +import java.util.Arrays; + +/** + * Samples for PatchSchedules CreateOrUpdate. + */ +public final class PatchSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCachePatchSchedulesCreateOrUpdate.json + */ + /** + * Sample code: RedisCachePatchSchedulesCreateOrUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesCreateOrUpdate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPatchSchedules() + .createOrUpdateWithResponse("rg1", "cache1", DefaultName.DEFAULT, + new RedisPatchScheduleInner().withScheduleEntries(Arrays.asList( + new ScheduleEntry().withDayOfWeek(DayOfWeek.MONDAY) + .withStartHourUtc(12) + .withMaintenanceWindow(Duration.parse("PT5H")), + new ScheduleEntry().withDayOfWeek(DayOfWeek.TUESDAY).withStartHourUtc(12))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesDeleteSamples.java new file mode 100644 index 0000000000000..5145cecfd5b6b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesDeleteSamples.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.redis.generated; + +import com.azure.resourcemanager.redis.models.DefaultName; + +/** + * Samples for PatchSchedules Delete. + */ +public final class PatchSchedulesDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCachePatchSchedulesDelete.json + */ + /** + * Sample code: RedisCachePatchSchedulesDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPatchSchedules() + .deleteWithResponse("rg1", "cache1", DefaultName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesGetSamples.java new file mode 100644 index 0000000000000..a9ee5675746ce --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesGetSamples.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.redis.generated; + +import com.azure.resourcemanager.redis.models.DefaultName; + +/** + * Samples for PatchSchedules Get. + */ +public final class PatchSchedulesGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCachePatchSchedulesGet.json + */ + /** + * Sample code: RedisCachePatchSchedulesGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPatchSchedules() + .getWithResponse("rg1", "cache1", DefaultName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesListByRedisResourceSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesListByRedisResourceSamples.java new file mode 100644 index 0000000000000..17a48070b5850 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PatchSchedulesListByRedisResourceSamples.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.redis.generated; + +/** + * Samples for PatchSchedules ListByRedisResource. + */ +public final class PatchSchedulesListByRedisResourceSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCachePatchSchedulesList.json + */ + /** + * Sample code: RedisCachePatchSchedulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPatchSchedules() + .listByRedisResource("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..73132ee417ce9 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsDeleteSamples.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.redis.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDeletePrivateEndpointConnection(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPrivateEndpointConnections() + .deleteWithResponse("rgtest01", "cachetest01", "pectest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a13d00221a59b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsGetSamples.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.redis.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGetPrivateEndpointConnection(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse("rgtest01", "cachetest01", "pectest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..2513310a31a13 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsListSamples.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.redis.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisCacheListPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListPrivateEndpointConnection(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPrivateEndpointConnections() + .list("rgtest01", "cachetest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..531f65c3e1c99 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsPutSamples.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.redis.generated; + +import com.azure.resourcemanager.redis.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redis.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Put. + */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCachePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCachePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePutPrivateEndpointConnection(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPrivateEndpointConnections() + .put("rgtest01", "cachetest01", "pectest01", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateLinkResourcesListByRedisCacheSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateLinkResourcesListByRedisCacheSamples.java new file mode 100644 index 0000000000000..750c4c376a302 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateLinkResourcesListByRedisCacheSamples.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.redis.generated; + +/** + * Samples for PrivateLinkResources ListByRedisCache. + */ +public final class PrivateLinkResourcesListByRedisCacheSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to RedisManager. + */ + public static void storageAccountListPrivateLinkResources(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getPrivateLinkResources() + .listByRedisCache("rgtest01", "cacheTest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCheckNameAvailabilitySamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..ab5838e74fa64 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCheckNameAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.CheckNameAvailabilityParameters; + +/** + * Samples for Redis CheckNameAvailability. + */ +public final class RedisCheckNameAvailabilitySamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCheckNameAvailability.json + */ + /** + * Sample code: RedisCacheCheckNameAvailability. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCheckNameAvailability(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameters().withName("cacheName").withType("Microsoft.Cache/Redis"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCreateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCreateSamples.java new file mode 100644 index 0000000000000..36c70f3e4c9d1 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisCreateSamples.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.RedisConfiguration; +import com.azure.resourcemanager.redis.models.RedisCreateParameters; +import com.azure.resourcemanager.redis.models.Sku; +import com.azure.resourcemanager.redis.models.SkuFamily; +import com.azure.resourcemanager.redis.models.SkuName; +import com.azure.resourcemanager.redis.models.TlsVersion; +import com.azure.resourcemanager.redis.models.ZonalAllocationPolicy; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Redis Create. + */ +public final class RedisCreateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreateAutomaticZonalAllocationPolicy.json + */ + /** + * Sample code: RedisCacheCreateAutomaticZonalAllocationPolicy. + * + * @param manager Entry point to RedisManager. + */ + public static void + redisCacheCreateAutomaticZonalAllocationPolicy(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withZonalAllocationPolicy(ZonalAllocationPolicy.AUTOMATIC), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreateUserDefinedZonalAllocationPolicy.json + */ + /** + * Sample code: RedisCacheCreateUserDefinedZonalAllocationPolicy. + * + * @param manager Entry point to RedisManager. + */ + public static void + redisCacheCreateUserDefinedZonalAllocationPolicy(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withZones(Arrays.asList("1")) + .withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withRedisVersion("Latest") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withZonalAllocationPolicy(ZonalAllocationPolicy.USER_DEFINED), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreate.json + */ + /** + * Sample code: RedisCacheCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withZones(Arrays.asList("1")) + .withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withRedisVersion("4") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreateNoZonesZonalAllocationPolicy.json + */ + /** + * Sample code: RedisCacheCreateNoZonesZonalAllocationPolicy. + * + * @param manager Entry point to RedisManager. + */ + public static void + redisCacheCreateNoZonesZonalAllocationPolicy(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withZonalAllocationPolicy(ZonalAllocationPolicy.NO_ZONES), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreateDefaultVersion.json + */ + /** + * Sample code: RedisCacheCreateDefaultVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateDefaultVersion(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withZones(Arrays.asList("1")) + .withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheCreateLatestVersion.json + */ + /** + * Sample code: RedisCacheCreateLatestVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateLatestVersion(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .create("rg1", "cache1", new RedisCreateParameters().withZones(Arrays.asList("1")) + .withLocation("East US") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisConfiguration().withMaxmemoryPolicy("allkeys-lru").withAdditionalProperties(mapOf())) + .withRedisVersion("Latest") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO), com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisDeleteSamples.java new file mode 100644 index 0000000000000..02409adccf006 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for Redis Delete. + */ +public final class RedisDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheDelete.json + */ + /** + * Sample code: RedisCacheDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDelete(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getRedis().delete("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisExportDataSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisExportDataSamples.java new file mode 100644 index 0000000000000..1af149242e5c2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisExportDataSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.ExportRdbParameters; + +/** + * Samples for Redis ExportData. + */ +public final class RedisExportDataSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheExport.json + */ + /** + * Sample code: RedisCacheExport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheExport(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .exportData("rg1", "cache1", + new ExportRdbParameters().withFormat("RDB") + .withPrefix("datadump1") + .withContainer("https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters") + .withStorageSubscriptionId("storageSubId"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisFlushCacheSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisFlushCacheSamples.java new file mode 100644 index 0000000000000..b37d19e0cec67 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisFlushCacheSamples.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.redis.generated; + +/** + * Samples for Redis FlushCache. + */ +public final class RedisFlushCacheSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheFlush.json + */ + /** + * Sample code: RedisCacheFlush. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFlush(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .flushCache("resource-group-name", "cache-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisForceRebootSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisForceRebootSamples.java new file mode 100644 index 0000000000000..edd93d219aa7d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisForceRebootSamples.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.redis.generated; + +import com.azure.resourcemanager.redis.models.RebootType; +import com.azure.resourcemanager.redis.models.RedisRebootParameters; +import java.util.Arrays; + +/** + * Samples for Redis ForceReboot. + */ +public final class RedisForceRebootSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheForceReboot.json + */ + /** + * Sample code: RedisCacheForceReboot. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheForceReboot(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .forceRebootWithResponse("rg1", "cache1", + new RedisRebootParameters().withRebootType(RebootType.ALL_NODES) + .withShardId(0) + .withPorts(Arrays.asList(13000, 15001)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisGetByResourceGroupSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..2320964d4eee0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisGetByResourceGroupSamples.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.redis.generated; + +/** + * Samples for Redis GetByResourceGroup. + */ +public final class RedisGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheGet.json + */ + /** + * Sample code: RedisCacheGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGet(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisImportDataSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisImportDataSamples.java new file mode 100644 index 0000000000000..6be83ddce3603 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisImportDataSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.ImportRdbParameters; +import java.util.Arrays; + +/** + * Samples for Redis ImportData. + */ +public final class RedisImportDataSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheImport.json + */ + /** + * Sample code: RedisCacheImport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheImport(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .importData("rg1", "cache1", + new ImportRdbParameters().withFormat("RDB") + .withFiles(Arrays.asList("http://fileuris.contoso.com/pathtofile1")) + .withStorageSubscriptionId("storageSubId"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListByResourceGroupSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListByResourceGroupSamples.java new file mode 100644 index 0000000000000..627edd2335404 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for Redis ListByResourceGroup. + */ +public final class RedisListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheListByResourceGroup.json + */ + /** + * Sample code: RedisCacheListByResourceGroup. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListByResourceGroup(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getRedis().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListKeysSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListKeysSamples.java new file mode 100644 index 0000000000000..80e39dfae612a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for Redis ListKeys. + */ +public final class RedisListKeysSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheListKeys.json + */ + /** + * Sample code: RedisCacheListKeys. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListKeys(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getRedis().listKeysWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListSamples.java new file mode 100644 index 0000000000000..51e8125592b69 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +/** + * Samples for Redis List. + */ +public final class RedisListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheList.json + */ + /** + * Sample code: RedisCacheList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheList(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient().getRedis().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListUpgradeNotificationsSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListUpgradeNotificationsSamples.java new file mode 100644 index 0000000000000..70ad381cf129c --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisListUpgradeNotificationsSamples.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.redis.generated; + +/** + * Samples for Redis ListUpgradeNotifications. + */ +public final class RedisListUpgradeNotificationsSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheListUpgradeNotifications.json + */ + /** + * Sample code: RedisCacheListUpgradeNotifications. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListUpgradeNotifications(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .listUpgradeNotifications("rg1", "cache1", 5000.0, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisRegenerateKeySamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisRegenerateKeySamples.java new file mode 100644 index 0000000000000..4e1e6689b0bf7 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisRegenerateKeySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.RedisKeyType; +import com.azure.resourcemanager.redis.models.RedisRegenerateKeyParameters; + +/** + * Samples for Redis RegenerateKey. + */ +public final class RedisRegenerateKeySamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheRegenerateKey.json + */ + /** + * Sample code: RedisCacheRegenerateKey. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheRegenerateKey(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .regenerateKeyWithResponse("rg1", "cache1", + new RedisRegenerateKeyParameters().withKeyType(RedisKeyType.PRIMARY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisUpdateSamples.java new file mode 100644 index 0000000000000..9314b80279da0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/src/samples/java/com/azure/resourcemanager/redis/generated/RedisUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.resourcemanager.redis.models.RedisUpdateParameters; + +/** + * Samples for Redis Update. + */ +public final class RedisUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/RedisCacheUpdate.json + */ + /** + * Sample code: RedisCacheUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheUpdate(com.azure.resourcemanager.redis.RedisManager manager) { + manager.serviceClient() + .getRedis() + .update("rg1", "cache1", new RedisUpdateParameters().withEnableNonSslPort(true).withReplicasPerPrimary(2), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml new file mode 100644 index 0000000000000..ebdb70eeb0b8d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/redis/resource-manager/Microsoft.Cache/Redis +commit: HEAD +repo: Azure/azure-rest-api-specs +additionalDirectories: From 377918bd11a154280e1b170c5aa987544fd9bb58 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 12:02:25 +0800 Subject: [PATCH 2/8] Regenerate Redis SDK with alternateType fix for percentComplete Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/redis/azure-resourcemanager-redis/CHANGELOG.md | 3 +-- .../redis/fluent/models/OperationStatusInner.java | 6 +++--- .../redis/models/OperationStatusResult.java | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md index eace44d6b665f..b13215e6cd257 100644 --- a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md +++ b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md @@ -42,10 +42,9 @@ * `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` * `models.OperationStatusResult withOperations(java.util.List)` -> `models.OperationStatusResult withOperations(java.util.List)` * `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` -> `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` -* `withPercentComplete(java.lang.Float)` was removed +* `models.OperationStatusResult withPercentComplete(java.lang.Float)` -> `models.OperationStatusResult withPercentComplete(java.lang.Float)` * `models.OperationStatusResult withId(java.lang.String)` -> `models.OperationStatusResult withId(java.lang.String)` * `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` -* `java.lang.Float percentComplete()` -> `java.lang.Double percentComplete()` * `models.OperationStatusResult withName(java.lang.String)` -> `models.OperationStatusResult withName(java.lang.String)` #### `models.RedisLinkedServer` was modified diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java index b279acbbf6151..1cae8a76e5ff7 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/fluent/models/OperationStatusInner.java @@ -51,7 +51,7 @@ public final class OperationStatusInner extends OperationStatusResult { /* * Percent of the operation that is complete. */ - private Double percentComplete; + private Float percentComplete; /* * Operation status. @@ -129,7 +129,7 @@ public OffsetDateTime startTime() { * @return the percentComplete value. */ @Override - public Double percentComplete() { + public Float percentComplete() { return this.percentComplete; } @@ -224,7 +224,7 @@ public static OperationStatusInner fromJson(JsonReader jsonReader) throws IOExce } else if ("name".equals(fieldName)) { deserializedOperationStatusInner.name = reader.getString(); } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusInner.percentComplete = reader.getNullable(JsonReader::getDouble); + deserializedOperationStatusInner.percentComplete = reader.getNullable(JsonReader::getFloat); } else if ("startTime".equals(fieldName)) { deserializedOperationStatusInner.startTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationStatusResult.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationStatusResult.java index 68d516ef15256..66105648feee1 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationStatusResult.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/OperationStatusResult.java @@ -40,7 +40,7 @@ public class OperationStatusResult implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); From 2271ec1833ccc30df0c641054ee1e0ba9a9cc875 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 12:07:46 +0800 Subject: [PATCH 3/8] Regenerate Redis SDK - all revapi checks pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../redis/models/RedisConfiguration.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisConfiguration.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisConfiguration.java index 39867365f46b0..0baf77f041281 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisConfiguration.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisConfiguration.java @@ -125,7 +125,7 @@ public final class RedisConfiguration implements JsonSerializable additionalProperties; + private Map additionalProperties; /** * Creates an instance of RedisConfiguration class. @@ -499,7 +499,7 @@ public RedisConfiguration withAadEnabled(String aadEnabled) { * * @return the additionalProperties value. */ - public Map additionalProperties() { + public Map additionalProperties() { return this.additionalProperties; } @@ -512,7 +512,7 @@ public Map additionalProperties() { * @param additionalProperties the additionalProperties value to set. * @return the RedisConfiguration object itself. */ - public RedisConfiguration withAdditionalProperties(Map additionalProperties) { + public RedisConfiguration withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } @@ -548,7 +548,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("storage-subscription-id", this.storageSubscriptionId); jsonWriter.writeStringField("aad-enabled", this.aadEnabled); if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); } } @@ -566,7 +566,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static RedisConfiguration fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { RedisConfiguration deserializedRedisConfiguration = new RedisConfiguration(); - Map additionalProperties = null; + Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -614,7 +614,7 @@ public static RedisConfiguration fromJson(JsonReader jsonReader) throws IOExcept additionalProperties = new LinkedHashMap<>(); } - additionalProperties.put(fieldName, reader.readUntyped()); + additionalProperties.put(fieldName, reader.getString()); } } deserializedRedisConfiguration.additionalProperties = additionalProperties; From c48ef2688c2f3810e85b272ff612bd78ccadbfe2 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 12:09:09 +0800 Subject: [PATCH 4/8] Restore changelog from main, update tsp-location.yaml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-resourcemanager-redis/CHANGELOG.md | 71 ++----------------- .../tsp-location.yaml | 4 +- 2 files changed, 7 insertions(+), 68 deletions(-) diff --git a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md index b13215e6cd257..5a64072519538 100644 --- a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md +++ b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md @@ -1,77 +1,16 @@ # Release History -## 2.54.0-beta.1 (2026-04-01) - -### Breaking Changes - -#### `models.OperationListResult` was removed - -#### `models.RedisListResult` was removed - -#### `models.RedisCacheAccessPolicyAssignmentList` was removed - -#### `models.RedisFirewallRuleListResult` was removed - -#### `models.RedisPatchScheduleListResult` was removed - -#### `models.RedisCacheAccessPolicyList` was removed - -#### `models.PrivateLinkResourceListResult` was removed - -#### `models.NotificationListResponse` was removed - -#### `models.PrivateEndpointConnectionListResult` was removed - -#### `models.RedisLinkedServerWithPropertiesList` was removed - -#### `models.OperationDisplay` was modified - -* `OperationDisplay()` was changed to private access -* `withDescription(java.lang.String)` was removed -* `withResource(java.lang.String)` was removed -* `withOperation(java.lang.String)` was removed -* `withProvider(java.lang.String)` was removed - -#### `models.RedisInstanceDetails` was modified - -* `RedisInstanceDetails()` was changed to private access - -#### `models.OperationStatusResult` was modified - -* `models.OperationStatusResult withStatus(java.lang.String)` -> `models.OperationStatusResult withStatus(java.lang.String)` -* `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withEndTime(java.time.OffsetDateTime)` -* `models.OperationStatusResult withOperations(java.util.List)` -> `models.OperationStatusResult withOperations(java.util.List)` -* `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` -> `models.OperationStatusResult withError(com.azure.core.management.exception.ManagementError)` -* `models.OperationStatusResult withPercentComplete(java.lang.Float)` -> `models.OperationStatusResult withPercentComplete(java.lang.Float)` -* `models.OperationStatusResult withId(java.lang.String)` -> `models.OperationStatusResult withId(java.lang.String)` -* `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` -> `models.OperationStatusResult withStartTime(java.time.OffsetDateTime)` -* `models.OperationStatusResult withName(java.lang.String)` -> `models.OperationStatusResult withName(java.lang.String)` - -#### `models.RedisLinkedServer` was modified - -* `RedisLinkedServer()` was changed to private access +## 2.54.0-beta.1 (Unreleased) ### Features Added -#### `models.RedisCache` was modified +- Supported enabling/disabling authentication through access keys for `RedisCache`. -* `isAccessKeyAuthenticationEnabled()` was added - -#### `models.ProvisioningState` was modified - -* `MIGRATING` was added -* `MIGRATION_SUCCEEDED` was added -* `MIGRATION_FAILED` was added -* `MIGRATION_CANCELLATION_FAILED` was added -* `MIGRATION_CANCELLING` was added - -#### `models.RedisFirewallRuleCreateParameters` was modified - -* `systemData()` was added +### Breaking Changes -#### `models.RedisCachePremium` was modified +### Bugs Fixed -* `isAccessKeyAuthenticationEnabled()` was added +### Other Changes ## 2.53.6 (2026-01-29) diff --git a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml index ebdb70eeb0b8d..3990ed5c00fe6 100644 --- a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml +++ b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/redis/resource-manager/Microsoft.Cache/Redis -commit: HEAD -repo: Azure/azure-rest-api-specs +commit: 07b0b56d9865d820ec63b599d91a1ed99a8cb8ea +repo: cxznmhdcxz/azure-rest-api-specs additionalDirectories: From c99c563974aea093ddeacc0b904075a346a880fe Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 12:18:42 +0800 Subject: [PATCH 5/8] Update tsp-location.yaml to specs PR commit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- sdk/redis/azure-resourcemanager-redis/tsp-location.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml index 3990ed5c00fe6..3dd028176e0de 100644 --- a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml +++ b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/redis/resource-manager/Microsoft.Cache/Redis -commit: 07b0b56d9865d820ec63b599d91a1ed99a8cb8ea -repo: cxznmhdcxz/azure-rest-api-specs +commit: d9564a36a402eec0d8fe557948ca0c630c91caf0 +repo: weidongxu-microsoft/azure-rest-api-specs additionalDirectories: From aa684360af59e1bdf47ad3ec234780f9c02b48d3 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 13:33:37 +0800 Subject: [PATCH 6/8] commit on main --- .../resourcemanager/redis/RedisCacheOperationsTests.java | 6 ++++-- sdk/redis/azure-resourcemanager-redis/tsp-location.yaml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java b/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java index cb3b42432ea5e..25af9744e61aa 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java +++ b/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java @@ -209,9 +209,11 @@ public void canCRUDRedisCache() throws Exception { // "target":null}} // com.microsoft.azure.CloudException: One of the SAS URIs provided could not be used for the following reason: // The SAS token is poorly formatted. - /*premiumCache.exportData(storageAccount.name(),"snapshot1"); + /* + premiumCache.exportData(storageAccount.name(),"snapshot1"); - premiumCache.importData(Arrays.asList("snapshot1"));*/ + premiumCache.importData(Arrays.asList("snapshot1")); + */ } @Disabled("Cannot create cache. Redis version 4.0 is retiring.") diff --git a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml index 3dd028176e0de..39f15dea235d4 100644 --- a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml +++ b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/redis/resource-manager/Microsoft.Cache/Redis -commit: d9564a36a402eec0d8fe557948ca0c630c91caf0 +commit: a948f97ae6c6f91d9acb8cb29ab07008d2f8144e repo: weidongxu-microsoft/azure-rest-api-specs -additionalDirectories: +additionalDirectories: From c48ba8a148c9af50f3c3bece80813776f45911b6 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 14:21:45 +0800 Subject: [PATCH 7/8] record --- sdk/redis/azure-resourcemanager-redis/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/redis/azure-resourcemanager-redis/assets.json b/sdk/redis/azure-resourcemanager-redis/assets.json index d626082c69e94..115617ec2e958 100644 --- a/sdk/redis/azure-resourcemanager-redis/assets.json +++ b/sdk/redis/azure-resourcemanager-redis/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/redis/azure-resourcemanager-redis", - "Tag": "java/redis/azure-resourcemanager-redis_4829c91ebd" + "Tag": "java/redis/azure-resourcemanager-redis_c14ea1781b" } From f029efc57d44daf441ad0b8fac93d8b49031c5d5 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 1 Apr 2026 14:44:02 +0800 Subject: [PATCH 8/8] fix tsp-location --- sdk/redis/azure-resourcemanager-redis/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml index 39f15dea235d4..af394680cd437 100644 --- a/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml +++ b/sdk/redis/azure-resourcemanager-redis/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/redis/resource-manager/Microsoft.Cache/Redis commit: a948f97ae6c6f91d9acb8cb29ab07008d2f8144e -repo: weidongxu-microsoft/azure-rest-api-specs +repo: Azure/azure-rest-api-specs additionalDirectories: