diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a403c1bc65bd5..706feda21f73f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -380,6 +380,7 @@ com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securitydevops;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-redis-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 2c84021679677..fb7494b0d9762 100644 --- a/pom.xml +++ b/pom.xml @@ -136,6 +136,7 @@ sdk/quota sdk/recoveryservices sdk/recoveryservicesbackup + sdk/redis sdk/redisenterprise sdk/relay sdk/remoterendering diff --git a/sdk/redis/azure-resourcemanager-redis-generated/CHANGELOG.md b/sdk/redis/azure-resourcemanager-redis-generated/CHANGELOG.md new file mode 100644 index 0000000000000..c336bd9f3eb6b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-10-13) + +- Azure Resource Manager Redis client library for Java. This package contains Microsoft Azure SDK for Redis Management SDK. REST API for Azure Redis Cache Service. Package tag package-2022-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/redis/azure-resourcemanager-redis-generated/README.md b/sdk/redis/azure-resourcemanager-redis-generated/README.md new file mode 100644 index 0000000000000..0d5efe315ed56 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Redis client library for Java + +Azure Resource Manager Redis client library for Java. + +This package contains Microsoft Azure SDK for Redis Management SDK. REST API for Azure Redis Cache Service. Package tag package-2022-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-redis-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-redis-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +RedisManager manager = RedisManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/redis/azure-resourcemanager-redis-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/redis/azure-resourcemanager-redis-generated/SAMPLE.md b/sdk/redis/azure-resourcemanager-redis-generated/SAMPLE.md new file mode 100644 index 0000000000000..161a9a23af720 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/SAMPLE.md @@ -0,0 +1,922 @@ +# Code snippets and samples + + +## AsyncOperationStatus + +- [Get](#asyncoperationstatus_get) + +## FirewallRules + +- [CreateOrUpdate](#firewallrules_createorupdate) +- [Delete](#firewallrules_delete) +- [Get](#firewallrules_get) +- [List](#firewallrules_list) + +## LinkedServer + +- [Create](#linkedserver_create) +- [Delete](#linkedserver_delete) +- [Get](#linkedserver_get) +- [List](#linkedserver_list) + +## Operations + +- [List](#operations_list) + +## PatchSchedules + +- [CreateOrUpdate](#patchschedules_createorupdate) +- [Delete](#patchschedules_delete) +- [Get](#patchschedules_get) +- [ListByRedisResource](#patchschedules_listbyredisresource) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByRedisCache](#privatelinkresources_listbyrediscache) + +## Redis + +- [CheckNameAvailability](#redis_checknameavailability) +- [Create](#redis_create) +- [Delete](#redis_delete) +- [ExportData](#redis_exportdata) +- [ForceReboot](#redis_forcereboot) +- [GetByResourceGroup](#redis_getbyresourcegroup) +- [ImportData](#redis_importdata) +- [List](#redis_list) +- [ListByResourceGroup](#redis_listbyresourcegroup) +- [ListKeys](#redis_listkeys) +- [ListUpgradeNotifications](#redis_listupgradenotifications) +- [RegenerateKey](#redis_regeneratekey) +- [Update](#redis_update) +### AsyncOperationStatus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AsyncOperationStatus Get. */ +public final class AsyncOperationStatusGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheAsyncOperationStatus.json + */ + /** + * Sample code: RedisCacheAsyncOperationStatus. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAsyncOperationStatus(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.asyncOperationStatus().getWithResponse("East US", "c7ba2bf5-5939-4d79-b037-2964ccf097da", Context.NONE); + } +} +``` + +### FirewallRules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** Samples for FirewallRules CreateOrUpdate. */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleCreate.json + */ + /** + * Sample code: RedisCacheFirewallRuleCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .firewallRules() + .createOrUpdateWithResponse( + "rg1", + "cache1", + "rule1", + new RedisFirewallRuleInner().withStartIp("192.168.1.1").withEndIp("192.168.1.4"), + Context.NONE); + } +} +``` + +### FirewallRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallRules Delete. */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleDelete.json + */ + /** + * Sample code: RedisCacheFirewallRuleDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().deleteWithResponse("rg1", "cache1", "rule1", Context.NONE); + } +} +``` + +### FirewallRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallRules Get. */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleGet.json + */ + /** + * Sample code: RedisCacheFirewallRuleGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().getWithResponse("rg1", "cache1", "rule1", Context.NONE); + } +} +``` + +### FirewallRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallRules List. */ +public final class FirewallRulesListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRulesList.json + */ + /** + * Sample code: RedisCacheFirewallRulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRulesList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().list("rg1", "cache1", Context.NONE); + } +} +``` + +### LinkedServer_Create + +```java +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; + +/** Samples for LinkedServer Create. */ +public final class LinkedServerCreateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Create.json + */ + /** + * Sample code: LinkedServer_Create. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .linkedServers() + .define("cache2") + .withExistingRedi("rg1", "cache1") + .withLinkedRedisCacheId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2") + .withLinkedRedisCacheLocation("West US") + .withServerRole(ReplicationRole.SECONDARY) + .create(); + } +} +``` + +### LinkedServer_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServer Delete. */ +public final class LinkedServerDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Delete.json + */ + /** + * Sample code: LinkedServerDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().delete("rg1", "cache1", "cache2", Context.NONE); + } +} +``` + +### LinkedServer_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServer Get. */ +public final class LinkedServerGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Get.json + */ + /** + * Sample code: LinkedServer_Get. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().getWithResponse("rg1", "cache1", "cache2", Context.NONE); + } +} +``` + +### LinkedServer_List + +```java +import com.azure.core.util.Context; + +/** Samples for LinkedServer List. */ +public final class LinkedServerListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_List.json + */ + /** + * Sample code: LinkedServer_List. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().list("rg1", "cache1", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheOperations.json + */ + /** + * Sample code: RedisCacheOperations. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheOperations(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PatchSchedules_CreateOrUpdate + +```java +import com.azure.resourcemanager.redis.generated.models.DayOfWeek; +import com.azure.resourcemanager.redis.generated.models.DefaultName; +import com.azure.resourcemanager.redis.generated.models.ScheduleEntry; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for PatchSchedules CreateOrUpdate. */ +public final class PatchSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json + */ + /** + * Sample code: RedisCachePatchSchedulesCreateOrUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesCreateOrUpdate( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .patchSchedules() + .define(DefaultName.DEFAULT) + .withExistingRedi("rg1", "cache1") + .withScheduleEntries( + Arrays + .asList( + new ScheduleEntry() + .withDayOfWeek(DayOfWeek.MONDAY) + .withStartHourUtc(12) + .withMaintenanceWindow(Duration.parse("PT5H")), + new ScheduleEntry().withDayOfWeek(DayOfWeek.TUESDAY).withStartHourUtc(12))) + .create(); + } +} +``` + +### PatchSchedules_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.DefaultName; + +/** Samples for PatchSchedules Delete. */ +public final class PatchSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesDelete.json + */ + /** + * Sample code: RedisCachePatchSchedulesDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().deleteWithResponse("rg1", "cache1", DefaultName.DEFAULT, Context.NONE); + } +} +``` + +### PatchSchedules_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.DefaultName; + +/** Samples for PatchSchedules Get. */ +public final class PatchSchedulesGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesGet.json + */ + /** + * Sample code: RedisCachePatchSchedulesGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().getWithResponse("rg1", "cache1", DefaultName.DEFAULT, Context.NONE); + } +} +``` + +### PatchSchedules_ListByRedisResource + +```java +import com.azure.core.util.Context; + +/** Samples for PatchSchedules ListByRedisResource. */ +public final class PatchSchedulesListByRedisResourceSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesList.json + */ + /** + * Sample code: RedisCachePatchSchedulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().listByRedisResource("rg1", "cache1", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDeletePrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rgtest01", "cachetest01", "pectest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGetPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().getWithResponse("rgtest01", "cachetest01", "pectest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisCacheListPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().list("rgtest01", "cachetest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCachePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePutPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .privateEndpointConnections() + .define("pectest01") + .withExistingRedi("rgtest01", "cachetest01") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateLinkResources_ListByRedisCache + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByRedisCache. */ +public final class PrivateLinkResourcesListByRedisCacheSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to RedisManager. + */ + public static void storageAccountListPrivateLinkResources( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateLinkResources().listByRedisCache("rgtest01", "cacheTest01", Context.NONE); + } +} +``` + +### Redis_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.CheckNameAvailabilityParameters; + +/** Samples for Redis CheckNameAvailability. */ +public final class RedisCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCheckNameAvailability.json + */ + /** + * Sample code: RedisCacheCheckNameAvailability. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCheckNameAvailability(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameters().withName("cacheName").withType("Microsoft.Cache/Redis"), + Context.NONE); + } +} +``` + +### Redis_Create + +```java +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.SkuFamily; +import com.azure.resourcemanager.redis.generated.models.SkuName; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Redis Create. */ +public final class RedisCreateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreate.json + */ + /** + * Sample code: RedisCacheCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withRedisVersion("4") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreateDefaultVersion.json + */ + /** + * Sample code: RedisCacheCreateDefaultVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateDefaultVersion(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreateLatestVersion.json + */ + /** + * Sample code: RedisCacheCreateLatestVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateLatestVersion(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withRedisVersion("Latest") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Redis_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Redis Delete. */ +public final class RedisDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheDelete.json + */ + /** + * Sample code: RedisCacheDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().delete("rg1", "cache1", Context.NONE); + } +} +``` + +### Redis_ExportData + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; + +/** Samples for Redis ExportData. */ +public final class RedisExportDataSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheExport.json + */ + /** + * Sample code: RedisCacheExport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheExport(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .exportData( + "rg1", + "cache1", + new ExportRdbParameters() + .withFormat("RDB") + .withPrefix("datadump1") + .withContainer("https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters"), + Context.NONE); + } +} +``` + +### Redis_ForceReboot + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RebootType; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import java.util.Arrays; + +/** Samples for Redis ForceReboot. */ +public final class RedisForceRebootSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheForceReboot.json + */ + /** + * Sample code: RedisCacheForceReboot. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheForceReboot(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .forceRebootWithResponse( + "rg1", + "cache1", + new RedisRebootParameters() + .withRebootType(RebootType.ALL_NODES) + .withShardId(0) + .withPorts(Arrays.asList(13000, 15001)), + Context.NONE); + } +} +``` + +### Redis_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Redis GetByResourceGroup. */ +public final class RedisGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheGet.json + */ + /** + * Sample code: RedisCacheGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + } +} +``` + +### Redis_ImportData + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import java.util.Arrays; + +/** Samples for Redis ImportData. */ +public final class RedisImportDataSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheImport.json + */ + /** + * Sample code: RedisCacheImport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheImport(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .importData( + "rg1", + "cache1", + new ImportRdbParameters() + .withFormat("RDB") + .withFiles(Arrays.asList("http://fileuris.contoso.com/pathtofile1")), + Context.NONE); + } +} +``` + +### Redis_List + +```java +import com.azure.core.util.Context; + +/** Samples for Redis List. */ +public final class RedisListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheList.json + */ + /** + * Sample code: RedisCacheList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().list(Context.NONE); + } +} +``` + +### Redis_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Redis ListByResourceGroup. */ +public final class RedisListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListByResourceGroup.json + */ + /** + * Sample code: RedisCacheListByResourceGroup. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListByResourceGroup(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### Redis_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Redis ListKeys. */ +public final class RedisListKeysSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListKeys.json + */ + /** + * Sample code: RedisCacheListKeys. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListKeys(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listKeysWithResponse("rg1", "cache1", Context.NONE); + } +} +``` + +### Redis_ListUpgradeNotifications + +```java +import com.azure.core.util.Context; + +/** Samples for Redis ListUpgradeNotifications. */ +public final class RedisListUpgradeNotificationsSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListUpgradeNotifications.json + */ + /** + * Sample code: RedisCacheListUpgradeNotifications. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListUpgradeNotifications( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listUpgradeNotifications("rg1", "cache1", 5000.0, Context.NONE); + } +} +``` + +### Redis_RegenerateKey + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RedisKeyType; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; + +/** Samples for Redis RegenerateKey. */ +public final class RedisRegenerateKeySamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheRegenerateKey.json + */ + /** + * Sample code: RedisCacheRegenerateKey. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheRegenerateKey(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .regenerateKeyWithResponse( + "rg1", "cache1", new RedisRegenerateKeyParameters().withKeyType(RedisKeyType.PRIMARY), Context.NONE); + } +} +``` + +### Redis_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RedisResource; + +/** Samples for Redis Update. */ +public final class RedisUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheUpdate.json + */ + /** + * Sample code: RedisCacheUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheUpdate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + RedisResource resource = + manager.redis().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + resource.update().withEnableNonSslPort(true).withReplicasPerPrimary(2).apply(); + } +} +``` + diff --git a/sdk/redis/azure-resourcemanager-redis-generated/pom.xml b/sdk/redis/azure-resourcemanager-redis-generated/pom.xml new file mode 100644 index 0000000000000..8fd518d1c581f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-redis-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Redis Management + This package contains Microsoft Azure SDK for Redis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure Redis Cache Service. Package tag package-2022-06. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.33.0 + + + com.azure + azure-core-management + 1.8.1 + + + diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/RedisManager.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/RedisManager.java new file mode 100644 index 0000000000000..62e7eb7ee91e2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/RedisManager.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.RedisManagementClient; +import com.azure.resourcemanager.redis.generated.implementation.AsyncOperationStatusImpl; +import com.azure.resourcemanager.redis.generated.implementation.FirewallRulesImpl; +import com.azure.resourcemanager.redis.generated.implementation.LinkedServersImpl; +import com.azure.resourcemanager.redis.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.redis.generated.implementation.PatchSchedulesImpl; +import com.azure.resourcemanager.redis.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.redis.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.redis.generated.implementation.RedisImpl; +import com.azure.resourcemanager.redis.generated.implementation.RedisManagementClientBuilder; +import com.azure.resourcemanager.redis.generated.models.AsyncOperationStatus; +import com.azure.resourcemanager.redis.generated.models.FirewallRules; +import com.azure.resourcemanager.redis.generated.models.LinkedServers; +import com.azure.resourcemanager.redis.generated.models.Operations; +import com.azure.resourcemanager.redis.generated.models.PatchSchedules; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.redis.generated.models.Redis; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to RedisManager. REST API for Azure Redis Cache Service. */ +public final class RedisManager { + private Operations operations; + + private Redis redis; + + private FirewallRules firewallRules; + + private PatchSchedules patchSchedules; + + private LinkedServers linkedServers; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private AsyncOperationStatus asyncOperationStatus; + + private final RedisManagementClient clientObject; + + private RedisManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new RedisManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Redis service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Redis service API instance. + */ + public static RedisManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Redis service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Redis service API instance. + */ + public static RedisManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new RedisManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create RedisManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RedisManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Redis service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Redis service API instance. + */ + public RedisManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.redis.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RedisManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Redis. It manages RedisResource. + * + * @return Resource collection API of Redis. + */ + public Redis redis() { + if (this.redis == null) { + this.redis = new RedisImpl(clientObject.getRedis(), this); + } + return redis; + } + + /** + * Gets the resource collection API of FirewallRules. + * + * @return Resource collection API of FirewallRules. + */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); + } + return firewallRules; + } + + /** + * Gets the resource collection API of PatchSchedules. It manages RedisPatchSchedule. + * + * @return Resource collection API of PatchSchedules. + */ + public PatchSchedules patchSchedules() { + if (this.patchSchedules == null) { + this.patchSchedules = new PatchSchedulesImpl(clientObject.getPatchSchedules(), this); + } + return patchSchedules; + } + + /** + * Gets the resource collection API of LinkedServers. It manages RedisLinkedServerWithProperties. + * + * @return Resource collection API of LinkedServers. + */ + public LinkedServers linkedServers() { + if (this.linkedServers == null) { + this.linkedServers = new LinkedServersImpl(clientObject.getLinkedServers(), this); + } + return linkedServers; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of AsyncOperationStatus. + * + * @return Resource collection API of AsyncOperationStatus. + */ + public AsyncOperationStatus asyncOperationStatus() { + if (this.asyncOperationStatus == null) { + this.asyncOperationStatus = new AsyncOperationStatusImpl(clientObject.getAsyncOperationStatus(), this); + } + return asyncOperationStatus; + } + + /** + * @return Wrapped service client RedisManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public RedisManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/AsyncOperationStatusClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/AsyncOperationStatusClient.java new file mode 100644 index 0000000000000..f05bdfffd921b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/AsyncOperationStatusClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in AsyncOperationStatusClient. */ +public interface AsyncOperationStatusClient { + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asynchronous operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String operationId, Context context); + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous 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 asynchronous operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String location, String operationId); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/FirewallRulesClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/FirewallRulesClient.java new file mode 100644 index 0000000000000..73bd5598ad971 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/FirewallRulesClient.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ +public interface FirewallRulesClient { + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 all firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cacheName); + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 all firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cacheName, Context context); + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String cacheName, + String ruleName, + RedisFirewallRuleInner parameters, + Context context); + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisFirewallRuleInner createOrUpdate( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters); + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @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); + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, Context context); + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cacheName, String ruleName); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/LinkedServersClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/LinkedServersClient.java new file mode 100644 index 0000000000000..a586d5e32cc01 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/LinkedServersClient.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerCreateParameters; + +/** An instance of this class provides access to all the operations defined in LinkedServersClient. */ +public interface LinkedServersClient { + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisLinkedServerWithPropertiesInner> beginCreate( + String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters); + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisLinkedServerWithPropertiesInner> beginCreate( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context); + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisLinkedServerWithPropertiesInner create( + String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters); + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisLinkedServerWithPropertiesInner create( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, String linkedServerName); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String name, String linkedServerName, Context context); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, String linkedServerName); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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. + * @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. + * @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). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name); + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name, Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/OperationsClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..b2befa825759a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @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 result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PatchSchedulesClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PatchSchedulesClient.java new file mode 100644 index 0000000000000..1c1f8a9bd22a7 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PatchSchedulesClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.generated.models.DefaultName; + +/** An instance of this class provides access to all the operations defined in PatchSchedulesClient. */ +public interface PatchSchedulesClient { + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 all patch schedules in the specified redis cache (there is only one) as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisResource(String resourceGroupName, String cacheName); + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 all patch schedules in the specified redis cache (there is only one) as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisResource( + String resourceGroupName, String cacheName, Context context); + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String name, + DefaultName defaultParameter, + RedisPatchScheduleInner parameters, + Context context); + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisPatchScheduleInner createOrUpdate( + String resourceGroupName, String name, DefaultName defaultParameter, RedisPatchScheduleInner parameters); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, DefaultName defaultParameter); + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..0d5437719bdba --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; + +/** 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. + * @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. + * @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. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String cacheName, String privateEndpointConnectionName); + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginPut( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginPut( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner put( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner put( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateLinkResourcesClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..1b91010c6377b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisCache(String resourceGroupName, String cacheName); + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRedisCache( + String resourceGroupName, String cacheName, Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisClient.java new file mode 100644 index 0000000000000..232dbaa7fbd13 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisClient.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import com.azure.resourcemanager.redis.generated.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.RedisCreateParameters; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; +import com.azure.resourcemanager.redis.generated.models.RedisUpdateParameters; + +/** An instance of this class provides access to all the operations defined in RedisClient. */ +public interface RedisClient { + /** + * 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 com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void checkNameAvailability(CheckNameAvailabilityParameters parameters); + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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); + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisResourceInner> beginCreate( + String resourceGroupName, String name, RedisCreateParameters parameters); + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisResourceInner> beginCreate( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner create(String resourceGroupName, String name, RedisCreateParameters parameters); + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.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 Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner create(String resourceGroupName, String name, RedisCreateParameters parameters, Context context); + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisResourceInner> beginUpdate( + String resourceGroupName, String name, RedisUpdateParameters parameters); + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedisResourceInner> beginUpdate( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context); + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner update(String resourceGroupName, String name, RedisUpdateParameters parameters); + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.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 Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner update(String resourceGroupName, String name, RedisUpdateParameters parameters, Context context); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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. + * @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). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisResourceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Redis caches in the specified subscription. + * + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Redis caches in the specified subscription. + * + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(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. + * @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 redis cache access keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String name, 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. + * @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 redis cache access keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * @param name The name of the Redis cache. + * @param parameters Specifies which key to regenerate. + * @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 redis cache access keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters, Context context); + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisAccessKeysInner regenerateKey(String resourceGroupName, String name, RedisRegenerateKeyParameters parameters); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response forceRebootWithResponse( + String resourceGroupName, String name, RedisRebootParameters parameters, Context context); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedisForceRebootResponseInner forceReboot(String resourceGroupName, String name, RedisRebootParameters parameters); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginImportData( + String resourceGroupName, String name, ImportRdbParameters parameters); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginImportData( + String resourceGroupName, String name, ImportRdbParameters parameters, Context context); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importData(String resourceGroupName, String name, ImportRdbParameters parameters); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importData(String resourceGroupName, String name, ImportRdbParameters parameters, Context context); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginExportData( + String resourceGroupName, String name, ExportRdbParameters parameters); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginExportData( + String resourceGroupName, String name, ExportRdbParameters parameters, Context context); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void exportData(String resourceGroupName, String name, ExportRdbParameters parameters); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void exportData(String resourceGroupName, String name, ExportRdbParameters parameters, Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisManagementClient.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisManagementClient.java new file mode 100644 index 0000000000000..7f3e25855e2e9 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/RedisManagementClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for RedisManagementClient class. */ +public interface RedisManagementClient { + /** + * Gets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + 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. + * + * @return the LinkedServersClient object. + */ + LinkedServersClient getLinkedServers(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the AsyncOperationStatusClient object to access its operations. + * + * @return the AsyncOperationStatusClient object. + */ + AsyncOperationStatusClient getAsyncOperationStatus(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..92c3d7a2169e9 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API operation. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + 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. + * + * @return the display value. + */ + 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. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationStatusInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationStatusInner.java new file mode 100644 index 0000000000000..6de730cec4700 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/OperationStatusInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.models.ErrorDetailAutoGenerated; +import com.azure.resourcemanager.redis.generated.models.OperationStatusResult; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Asynchronous operation status. */ +@Fluent +public final class OperationStatusInner extends OperationStatusResult { + /* + * Additional properties from RP, only when operation is successful + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /** Creates an instance of OperationStatusInner class. */ + public OperationStatusInner() { + } + + /** + * Get the properties property: Additional properties from RP, only when operation is successful. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Additional properties from RP, only when operation is successful. + * + * @param properties the properties value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withPercentComplete(Float percentComplete) { + super.withPercentComplete(percentComplete); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withOperations(List operations) { + super.withOperations(operations); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationStatusInner withError(ErrorDetailAutoGenerated error) { + super.withError(error); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..d4d79bc435f8d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..5993f13c2f911 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..10d6e8c064f1a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..41ada021ed1af --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisAccessKeysInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisAccessKeysInner.java new file mode 100644 index 0000000000000..8e342e2f67388 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisAccessKeysInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Redis cache access keys. */ +@Immutable +public final class RedisAccessKeysInner { + /* + * The current primary key that clients can use to authenticate with Redis cache. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /* + * The current secondary key that clients can use to authenticate with Redis cache. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** Creates an instance of RedisAccessKeysInner class. */ + public RedisAccessKeysInner() { + } + + /** + * Get the primaryKey property: The current primary key that clients can use to authenticate with Redis cache. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get the secondaryKey property: The current secondary key that clients can use to authenticate with Redis cache. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisCreateProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisCreateProperties.java new file mode 100644 index 0000000000000..0fd85387a1a43 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisCreateProperties.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisCommonProperties; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties supplied to Create Redis operation. */ +@Fluent +public class RedisCreateProperties extends RedisCommonProperties { + /* + * The SKU of the Redis cache to deploy. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /* + * Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual + * Network; auto assigned by default. + */ + @JsonProperty(value = "staticIP") + private String staticIp; + + /** Creates an instance of RedisCreateProperties class. */ + public RedisCreateProperties() { + } + + /** + * Get the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the Redis cache to deploy. + * + * @param sku the sku value to set. + * @return the RedisCreateProperties object itself. + */ + public RedisCreateProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @param subnetId the subnetId value to set. + * @return the RedisCreateProperties object itself. + */ + public RedisCreateProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.staticIp; + } + + /** + * Set the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @param staticIp the staticIp value to set. + * @return the RedisCreateProperties object itself. + */ + public RedisCreateProperties withStaticIp(String staticIp) { + this.staticIp = staticIp; + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + super.withRedisConfiguration(redisConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withRedisVersion(String redisVersion) { + super.withRedisVersion(redisVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withEnableNonSslPort(Boolean enableNonSslPort) { + super.withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withReplicasPerMaster(Integer replicasPerMaster) { + super.withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withReplicasPerPrimary(Integer replicasPerPrimary) { + super.withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withTenantSettings(Map tenantSettings) { + super.withTenantSettings(tenantSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withShardCount(Integer shardCount) { + super.withShardCount(shardCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + super.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisCreateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + super.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model RedisCreateProperties")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisCreateProperties.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleInner.java new file mode 100644 index 0000000000000..b55e42c2c38bc --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted to connect. + */ +@Fluent +public class RedisFirewallRuleInner extends ProxyResource { + /* + * redis cache firewall rule properties + */ + @JsonProperty(value = "properties", required = true) + private RedisFirewallRuleProperties innerProperties = new RedisFirewallRuleProperties(); + + /** Creates an instance of RedisFirewallRuleInner class. */ + public RedisFirewallRuleInner() { + } + + /** + * Get the innerProperties property: redis cache firewall rule properties. + * + * @return the innerProperties value. + */ + private RedisFirewallRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the startIp property: lowest IP address included in the range. + * + * @return the startIp value. + */ + public String startIp() { + return this.innerProperties() == null ? null : this.innerProperties().startIp(); + } + + /** + * Set the startIp property: lowest IP address included in the range. + * + * @param startIp the startIp value to set. + * @return the RedisFirewallRuleInner object itself. + */ + public RedisFirewallRuleInner withStartIp(String startIp) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisFirewallRuleProperties(); + } + this.innerProperties().withStartIp(startIp); + return this; + } + + /** + * Get the endIp property: highest IP address included in the range. + * + * @return the endIp value. + */ + public String endIp() { + return this.innerProperties() == null ? null : this.innerProperties().endIp(); + } + + /** + * Set the endIp property: highest IP address included in the range. + * + * @param endIp the endIp value to set. + * @return the RedisFirewallRuleInner object itself. + */ + public RedisFirewallRuleInner withEndIp(String endIp) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisFirewallRuleProperties(); + } + this.innerProperties().withEndIp(endIp); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RedisFirewallRuleInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisFirewallRuleInner.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleProperties.java new file mode 100644 index 0000000000000..d7df52c9aa732 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisFirewallRuleProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies a range of IP addresses permitted to connect to the cache. */ +@Fluent +public final class RedisFirewallRuleProperties { + /* + * lowest IP address included in the range + */ + @JsonProperty(value = "startIP", required = true) + private String startIp; + + /* + * highest IP address included in the range + */ + @JsonProperty(value = "endIP", required = true) + private String endIp; + + /** Creates an instance of RedisFirewallRuleProperties class. */ + public RedisFirewallRuleProperties() { + } + + /** + * Get the startIp property: lowest IP address included in the range. + * + * @return the startIp value. + */ + public String startIp() { + return this.startIp; + } + + /** + * Set the startIp property: lowest IP address included in the range. + * + * @param startIp the startIp value to set. + * @return the RedisFirewallRuleProperties object itself. + */ + public RedisFirewallRuleProperties withStartIp(String startIp) { + this.startIp = startIp; + return this; + } + + /** + * Get the endIp property: highest IP address included in the range. + * + * @return the endIp value. + */ + public String endIp() { + return this.endIp; + } + + /** + * Set the endIp property: highest IP address included in the range. + * + * @param endIp the endIp value to set. + * @return the RedisFirewallRuleProperties object itself. + */ + public RedisFirewallRuleProperties withEndIp(String endIp) { + this.endIp = endIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startIp() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startIp in model RedisFirewallRuleProperties")); + } + if (endIp() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endIp in model RedisFirewallRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisFirewallRuleProperties.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisForceRebootResponseInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisForceRebootResponseInner.java new file mode 100644 index 0000000000000..1875de298c0a1 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisForceRebootResponseInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response to force reboot for Redis cache. */ +@Immutable +public final class RedisForceRebootResponseInner { + /* + * Status message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of RedisForceRebootResponseInner class. */ + public RedisForceRebootResponseInner() { + } + + /** + * Get the message property: Status message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerCreateProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerCreateProperties.java new file mode 100644 index 0000000000000..da1cf9e433987 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerCreateProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create properties for a linked server. */ +@Fluent +public class RedisLinkedServerCreateProperties { + /* + * Fully qualified resourceId of the linked redis cache. + */ + @JsonProperty(value = "linkedRedisCacheId", required = true) + private String linkedRedisCacheId; + + /* + * Location of the linked redis cache. + */ + @JsonProperty(value = "linkedRedisCacheLocation", required = true) + private String linkedRedisCacheLocation; + + /* + * Role of the linked server. + */ + @JsonProperty(value = "serverRole", required = true) + private ReplicationRole serverRole; + + /* + * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for + * seamless Geo Failover experience. + */ + @JsonProperty(value = "geoReplicatedPrimaryHostName", access = JsonProperty.Access.WRITE_ONLY) + private String geoReplicatedPrimaryHostname; + + /* + * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or + * after the Geo Failover. + */ + @JsonProperty(value = "primaryHostName", access = JsonProperty.Access.WRITE_ONLY) + private String primaryHostname; + + /** Creates an instance of RedisLinkedServerCreateProperties class. */ + public RedisLinkedServerCreateProperties() { + } + + /** + * Get the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @return the linkedRedisCacheId value. + */ + public String linkedRedisCacheId() { + return this.linkedRedisCacheId; + } + + /** + * Set the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @param linkedRedisCacheId the linkedRedisCacheId value to set. + * @return the RedisLinkedServerCreateProperties object itself. + */ + public RedisLinkedServerCreateProperties withLinkedRedisCacheId(String linkedRedisCacheId) { + this.linkedRedisCacheId = linkedRedisCacheId; + return this; + } + + /** + * Get the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @return the linkedRedisCacheLocation value. + */ + public String linkedRedisCacheLocation() { + return this.linkedRedisCacheLocation; + } + + /** + * Set the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @param linkedRedisCacheLocation the linkedRedisCacheLocation value to set. + * @return the RedisLinkedServerCreateProperties object itself. + */ + public RedisLinkedServerCreateProperties withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + this.linkedRedisCacheLocation = linkedRedisCacheLocation; + return this; + } + + /** + * Get the serverRole property: Role of the linked server. + * + * @return the serverRole value. + */ + public ReplicationRole serverRole() { + return this.serverRole; + } + + /** + * Set the serverRole property: Role of the linked server. + * + * @param serverRole the serverRole value to set. + * @return the RedisLinkedServerCreateProperties object itself. + */ + public RedisLinkedServerCreateProperties withServerRole(ReplicationRole serverRole) { + this.serverRole = serverRole; + return this; + } + + /** + * Get the geoReplicatedPrimaryHostname property: The unchanging DNS name which will always point to current + * geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * + * @return the geoReplicatedPrimaryHostname value. + */ + public String geoReplicatedPrimaryHostname() { + return this.geoReplicatedPrimaryHostname; + } + + /** + * Get the primaryHostname property: The changing DNS name that resolves to the current geo-primary cache among the + * linked redis caches before or after the Geo Failover. + * + * @return the primaryHostname value. + */ + public String primaryHostname() { + return this.primaryHostname; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkedRedisCacheId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property linkedRedisCacheId in model RedisLinkedServerCreateProperties")); + } + if (linkedRedisCacheLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property linkedRedisCacheLocation in model" + + " RedisLinkedServerCreateProperties")); + } + if (serverRole() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serverRole in model RedisLinkedServerCreateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisLinkedServerCreateProperties.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerProperties.java new file mode 100644 index 0000000000000..074eba5a8f0a5 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a linked server to be returned in get/put response. */ +@Fluent +public final class RedisLinkedServerProperties extends RedisLinkedServerCreateProperties { + /* + * Terminal state of the link between primary and secondary redis cache. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of RedisLinkedServerProperties class. */ + public RedisLinkedServerProperties() { + } + + /** + * Get the provisioningState property: Terminal state of the link between primary and secondary redis cache. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public RedisLinkedServerProperties withLinkedRedisCacheId(String linkedRedisCacheId) { + super.withLinkedRedisCacheId(linkedRedisCacheId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisLinkedServerProperties withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + super.withLinkedRedisCacheLocation(linkedRedisCacheLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisLinkedServerProperties withServerRole(ReplicationRole serverRole) { + super.withServerRole(serverRole); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerWithPropertiesInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerWithPropertiesInner.java new file mode 100644 index 0000000000000..5c34331273413 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisLinkedServerWithPropertiesInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response to put/get linked server (with properties) for Redis cache. */ +@Fluent +public final class RedisLinkedServerWithPropertiesInner extends ProxyResource { + /* + * Properties of the linked server. + */ + @JsonProperty(value = "properties") + private RedisLinkedServerProperties innerProperties; + + /** Creates an instance of RedisLinkedServerWithPropertiesInner class. */ + public RedisLinkedServerWithPropertiesInner() { + } + + /** + * Get the innerProperties property: Properties of the linked server. + * + * @return the innerProperties value. + */ + private RedisLinkedServerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Terminal state of the link between primary and secondary redis cache. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @return the linkedRedisCacheId value. + */ + public String linkedRedisCacheId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRedisCacheId(); + } + + /** + * Set the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @param linkedRedisCacheId the linkedRedisCacheId value to set. + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withLinkedRedisCacheId(String linkedRedisCacheId) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerProperties(); + } + this.innerProperties().withLinkedRedisCacheId(linkedRedisCacheId); + return this; + } + + /** + * Get the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @return the linkedRedisCacheLocation value. + */ + public String linkedRedisCacheLocation() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRedisCacheLocation(); + } + + /** + * Set the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @param linkedRedisCacheLocation the linkedRedisCacheLocation value to set. + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerProperties(); + } + this.innerProperties().withLinkedRedisCacheLocation(linkedRedisCacheLocation); + return this; + } + + /** + * Get the serverRole property: Role of the linked server. + * + * @return the serverRole value. + */ + public ReplicationRole serverRole() { + return this.innerProperties() == null ? null : this.innerProperties().serverRole(); + } + + /** + * Set the serverRole property: Role of the linked server. + * + * @param serverRole the serverRole value to set. + * @return the RedisLinkedServerWithPropertiesInner object itself. + */ + public RedisLinkedServerWithPropertiesInner withServerRole(ReplicationRole serverRole) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerProperties(); + } + this.innerProperties().withServerRole(serverRole); + return this; + } + + /** + * Get the geoReplicatedPrimaryHostname property: The unchanging DNS name which will always point to current + * geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * + * @return the geoReplicatedPrimaryHostname value. + */ + public String geoReplicatedPrimaryHostname() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplicatedPrimaryHostname(); + } + + /** + * Get the primaryHostname property: The changing DNS name that resolves to the current geo-primary cache among the + * linked redis caches before or after the Geo Failover. + * + * @return the primaryHostname value. + */ + public String primaryHostname() { + return this.innerProperties() == null ? null : this.innerProperties().primaryHostname(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPatchScheduleInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPatchScheduleInner.java new file mode 100644 index 0000000000000..aae7acd6f2c7e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPatchScheduleInner.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.ScheduleEntry; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response to put/get patch schedules for Redis cache. */ +@Fluent +public final class RedisPatchScheduleInner extends ProxyResource { + /* + * List of patch schedules for a Redis cache. + */ + @JsonProperty(value = "properties", required = true) + private ScheduleEntries innerProperties = new ScheduleEntries(); + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** Creates an instance of RedisPatchScheduleInner class. */ + public RedisPatchScheduleInner() { + } + + /** + * Get the innerProperties property: List of patch schedules for a Redis cache. + * + * @return the innerProperties value. + */ + private ScheduleEntries innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the scheduleEntries property: List of patch schedules for a Redis cache. + * + * @return the scheduleEntries value. + */ + public List scheduleEntries() { + return this.innerProperties() == null ? null : this.innerProperties().scheduleEntries(); + } + + /** + * Set the scheduleEntries property: List of patch schedules for a Redis cache. + * + * @param scheduleEntries the scheduleEntries value to set. + * @return the RedisPatchScheduleInner object itself. + */ + public RedisPatchScheduleInner withScheduleEntries(List scheduleEntries) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleEntries(); + } + this.innerProperties().withScheduleEntries(scheduleEntries); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RedisPatchScheduleInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisPatchScheduleInner.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPropertiesInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPropertiesInner.java new file mode 100644 index 0000000000000..8985c83c20078 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisPropertiesInner.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.models.ProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.RedisInstanceDetails; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServer; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties of the redis cache. */ +@Fluent +public final class RedisPropertiesInner extends RedisCreateProperties { + /* + * Redis instance provisioning status. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Redis host name. + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Redis non-SSL port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Integer port; + + /* + * Redis SSL port. + */ + @JsonProperty(value = "sslPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer sslPort; + + /* + * The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache + */ + @JsonProperty(value = "accessKeys", access = JsonProperty.Access.WRITE_ONLY) + private RedisAccessKeysInner accessKeys; + + /* + * List of the linked servers associated with the cache + */ + @JsonProperty(value = "linkedServers", access = JsonProperty.Access.WRITE_ONLY) + private List linkedServers; + + /* + * List of the Redis instances associated with the cache + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /* + * List of private endpoint connection associated with the specified redis cache + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** Creates an instance of RedisPropertiesInner class. */ + public RedisPropertiesInner() { + } + + /** + * Get the provisioningState property: Redis instance provisioning status. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the hostname property: Redis host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the port property: Redis non-SSL port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Get the sslPort property: Redis SSL port. + * + * @return the sslPort value. + */ + public Integer sslPort() { + return this.sslPort; + } + + /** + * Get the accessKeys property: The keys of the Redis cache - not set if this object is not the response to Create + * or Update redis cache. + * + * @return the accessKeys value. + */ + public RedisAccessKeysInner accessKeys() { + return this.accessKeys; + } + + /** + * Get the linkedServers property: List of the linked servers associated with the cache. + * + * @return the linkedServers value. + */ + public List linkedServers() { + return this.linkedServers; + } + + /** + * Get the instances property: List of the Redis instances associated with the cache. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * redis cache. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withSubnetId(String subnetId) { + super.withSubnetId(subnetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withStaticIp(String staticIp) { + super.withStaticIp(staticIp); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + super.withRedisConfiguration(redisConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withRedisVersion(String redisVersion) { + super.withRedisVersion(redisVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withEnableNonSslPort(Boolean enableNonSslPort) { + super.withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withReplicasPerMaster(Integer replicasPerMaster) { + super.withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withReplicasPerPrimary(Integer replicasPerPrimary) { + super.withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withTenantSettings(Map tenantSettings) { + super.withTenantSettings(tenantSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withShardCount(Integer shardCount) { + super.withShardCount(shardCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + super.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisPropertiesInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + super.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (accessKeys() != null) { + accessKeys().validate(); + } + if (linkedServers() != null) { + linkedServers().forEach(e -> e.validate()); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisResourceInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisResourceInner.java new file mode 100644 index 0000000000000..eb1143dfb9090 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisResourceInner.java @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redis.generated.models.ProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.RedisInstanceDetails; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServer; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A single Redis item in List or Get Operation. */ +@Fluent +public final class RedisResourceInner extends Resource { + /* + * Redis cache properties. + */ + @JsonProperty(value = "properties", required = true) + private RedisPropertiesInner innerProperties = new RedisPropertiesInner(); + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /** Creates an instance of RedisResourceInner class. */ + public RedisResourceInner() { + } + + /** + * Get the innerProperties property: Redis cache properties. + * + * @return the innerProperties value. + */ + private RedisPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Redis instance provisioning status. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the hostname property: Redis host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the port property: Redis non-SSL port. + * + * @return the port value. + */ + public Integer port() { + return this.innerProperties() == null ? null : this.innerProperties().port(); + } + + /** + * Get the sslPort property: Redis SSL port. + * + * @return the sslPort value. + */ + public Integer sslPort() { + return this.innerProperties() == null ? null : this.innerProperties().sslPort(); + } + + /** + * Get the accessKeys property: The keys of the Redis cache - not set if this object is not the response to Create + * or Update redis cache. + * + * @return the accessKeys value. + */ + public RedisAccessKeysInner accessKeys() { + return this.innerProperties() == null ? null : this.innerProperties().accessKeys(); + } + + /** + * Get the linkedServers property: List of the linked servers associated with the cache. + * + * @return the linkedServers value. + */ + public List linkedServers() { + return this.innerProperties() == null ? null : this.innerProperties().linkedServers(); + } + + /** + * Get the instances property: List of the Redis instances associated with the cache. + * + * @return the instances value. + */ + public List instances() { + return this.innerProperties() == null ? null : this.innerProperties().instances(); + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * redis cache. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + public Sku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the Redis cache to deploy. + * + * @param sku the sku value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withSku(Sku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + + /** + * Set the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @param subnetId the subnetId value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withSubnetId(String subnetId) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withSubnetId(subnetId); + return this; + } + + /** + * Get the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.innerProperties() == null ? null : this.innerProperties().staticIp(); + } + + /** + * Set the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @param staticIp the staticIp value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withStaticIp(String staticIp) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withStaticIp(staticIp); + return this; + } + + /** + * Get the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().redisConfiguration(); + } + + /** + * Set the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param redisConfiguration the redisConfiguration value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withRedisConfiguration(redisConfiguration); + return this; + } + + /** + * Get the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); + } + + /** + * Set the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @param redisVersion the redisVersion value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withRedisVersion(String redisVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withRedisVersion(redisVersion); + return this; + } + + /** + * Get the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + public Boolean enableNonSslPort() { + return this.innerProperties() == null ? null : this.innerProperties().enableNonSslPort(); + } + + /** + * Set the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @param enableNonSslPort the enableNonSslPort value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withEnableNonSslPort(Boolean enableNonSslPort) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** + * Get the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + public Integer replicasPerMaster() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerMaster(); + } + + /** + * Set the replicasPerMaster property: The number of replicas to be created per primary. + * + * @param replicasPerMaster the replicasPerMaster value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withReplicasPerMaster(Integer replicasPerMaster) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** + * Get the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + public Integer replicasPerPrimary() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerPrimary(); + } + + /** + * Set the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @param replicasPerPrimary the replicasPerPrimary value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withReplicasPerPrimary(Integer replicasPerPrimary) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** + * Get the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + public Map tenantSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tenantSettings(); + } + + /** + * Set the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings the tenantSettings value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withTenantSettings(Map tenantSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withTenantSettings(tenantSettings); + return this; + } + + /** + * Get the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + public Integer shardCount() { + return this.innerProperties() == null ? null : this.innerProperties().shardCount(); + } + + /** + * Set the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @param shardCount the shardCount value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withShardCount(Integer shardCount) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withShardCount(shardCount); + return this; + } + + /** + * Get the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * 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'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().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'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RedisResourceInner object itself. + */ + public RedisResourceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisPropertiesInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RedisResourceInner")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisResourceInner.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisUpdateProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisUpdateProperties.java new file mode 100644 index 0000000000000..be9b756c0a96a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/RedisUpdateProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisCommonProperties; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Patchable properties of the redis cache. */ +@Fluent +public final class RedisUpdateProperties extends RedisCommonProperties { + /* + * The SKU of the Redis cache to deploy. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of RedisUpdateProperties class. */ + public RedisUpdateProperties() { + } + + /** + * Get the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the Redis cache to deploy. + * + * @param sku the sku value to set. + * @return the RedisUpdateProperties object itself. + */ + public RedisUpdateProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + super.withRedisConfiguration(redisConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withRedisVersion(String redisVersion) { + super.withRedisVersion(redisVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withEnableNonSslPort(Boolean enableNonSslPort) { + super.withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withReplicasPerMaster(Integer replicasPerMaster) { + super.withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withReplicasPerPrimary(Integer replicasPerPrimary) { + super.withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withTenantSettings(Map tenantSettings) { + super.withTenantSettings(tenantSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withShardCount(Integer shardCount) { + super.withShardCount(shardCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + super.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + super.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/ScheduleEntries.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/ScheduleEntries.java new file mode 100644 index 0000000000000..a80022a101eeb --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/ScheduleEntries.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.models.ScheduleEntry; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of patch schedules for a Redis cache. */ +@Fluent +public final class ScheduleEntries { + /* + * List of patch schedules for a Redis cache. + */ + @JsonProperty(value = "scheduleEntries", required = true) + private List scheduleEntries; + + /** Creates an instance of ScheduleEntries class. */ + public ScheduleEntries() { + } + + /** + * Get the scheduleEntries property: List of patch schedules for a Redis cache. + * + * @return the scheduleEntries value. + */ + public List scheduleEntries() { + return this.scheduleEntries; + } + + /** + * Set the scheduleEntries property: List of patch schedules for a Redis cache. + * + * @param scheduleEntries the scheduleEntries value to set. + * @return the ScheduleEntries object itself. + */ + public ScheduleEntries withScheduleEntries(List scheduleEntries) { + this.scheduleEntries = scheduleEntries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scheduleEntries() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property scheduleEntries in model ScheduleEntries")); + } else { + scheduleEntries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduleEntries.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/UpgradeNotificationInner.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/UpgradeNotificationInner.java new file mode 100644 index 0000000000000..16d615e51e39f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/UpgradeNotificationInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Properties of upgrade notification. */ +@Immutable +public final class UpgradeNotificationInner { + /* + * Name of upgrade notification. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Timestamp when upgrade notification occurred. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Details about this upgrade notification + */ + @JsonProperty(value = "upsellNotification", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map upsellNotification; + + /** Creates an instance of UpgradeNotificationInner class. */ + public UpgradeNotificationInner() { + } + + /** + * Get the name property: Name of upgrade notification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the timestamp property: Timestamp when upgrade notification occurred. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the upsellNotification property: Details about this upgrade notification. + * + * @return the upsellNotification value. + */ + public Map upsellNotification() { + return this.upsellNotification; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/package-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..4244ca85ab12a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for RedisManagementClient. REST API for Azure Redis Cache Service. */ +package com.azure.resourcemanager.redis.generated.fluent.models; diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/package-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/package-info.java new file mode 100644 index 0000000000000..8f343e378949f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for RedisManagementClient. REST API for Azure Redis Cache Service. */ +package com.azure.resourcemanager.redis.generated.fluent; diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusClientImpl.java new file mode 100644 index 0000000000000..dd11668fec3e0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusClientImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redis.generated.fluent.AsyncOperationStatusClient; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AsyncOperationStatusClient. */ +public final class AsyncOperationStatusClientImpl implements AsyncOperationStatusClient { + /** The proxy service used to perform REST calls. */ + private final AsyncOperationStatusService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of AsyncOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AsyncOperationStatusClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy + .create(AsyncOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientAsyncOperationStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private 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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous 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 asynchronous operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asynchronous operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous 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 asynchronous operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId) { + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asynchronous operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String operationId, Context context) { + return getWithResponseAsync(location, operationId, context).block(); + } + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous 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 asynchronous operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusImpl.java new file mode 100644 index 0000000000000..90b3609259627 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/AsyncOperationStatusImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.AsyncOperationStatusClient; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.redis.generated.models.AsyncOperationStatus; +import com.azure.resourcemanager.redis.generated.models.OperationStatus; + +public final class AsyncOperationStatusImpl implements AsyncOperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(AsyncOperationStatusImpl.class); + + private final AsyncOperationStatusClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public AsyncOperationStatusImpl( + AsyncOperationStatusClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String operationId, Context context) { + Response inner = this.serviceClient().getWithResponse(location, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus get(String location, String operationId) { + OperationStatusInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private AsyncOperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesClientImpl.java new file mode 100644 index 0000000000000..ae6a30c38f2a1 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesClientImpl.java @@ -0,0 +1,886 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redis.generated.fluent.FirewallRulesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; +import com.azure.resourcemanager.redis.generated.models.RedisFirewallRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ +public final class FirewallRulesClientImpl implements FirewallRulesClient { + /** The proxy service used to perform REST calls. */ + private final FirewallRulesService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallRulesClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientFirewallRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private interface FirewallRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis" + + "/{cacheName}/firewallRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") 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"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis" + + "/{cacheName}/firewallRules/{ruleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @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, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis" + + "/{cacheName}/firewallRules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @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); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis" + + "/{cacheName}/firewallRules/{ruleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @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); + + @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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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())); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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)); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cacheName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @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}. + */ + @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. + * @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)); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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.")); + } + 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 + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String cacheName, + String ruleName, + RedisFirewallRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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.")); + } + 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 + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + ruleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, cacheName, ruleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String cacheName, + String ruleName, + RedisFirewallRuleInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, cacheName, ruleName, parameters, context).block(); + } + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisFirewallRuleInner createOrUpdate( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, cacheName, ruleName, parameters, Context.NONE).getValue(); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 single firewall rule in a specified redis cache along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private 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.")); + } + 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 (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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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> 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.")); + } + 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 (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); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 single firewall rule in a specified redis cache on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String cacheName, String ruleName) { + return getWithResponseAsync(resourceGroupName, cacheName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 a single firewall rule in a specified redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String cacheName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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(); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private 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 (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 (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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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 (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); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cacheName, String ruleName) { + return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String cacheName, String ruleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, cacheName, ruleName, context).block(); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cacheName, String ruleName) { + deleteWithResponse(resourceGroupName, cacheName, ruleName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of list firewall rules Redis 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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}. + */ + @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-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesImpl.java new file mode 100644 index 0000000000000..5ac0f4b239d9b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/FirewallRulesImpl.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.FirewallRulesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; +import com.azure.resourcemanager.redis.generated.models.FirewallRules; +import com.azure.resourcemanager.redis.generated.models.RedisFirewallRule; + +public final class FirewallRulesImpl implements FirewallRules { + private static final ClientLogger LOGGER = new ClientLogger(FirewallRulesImpl.class); + + private final FirewallRulesClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public FirewallRulesImpl( + FirewallRulesClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String cacheName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cacheName); + return Utils.mapPage(inner, inner1 -> new RedisFirewallRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String cacheName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cacheName, context); + return Utils.mapPage(inner, inner1 -> new RedisFirewallRuleImpl(inner1, this.manager())); + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String cacheName, + String ruleName, + RedisFirewallRuleInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, cacheName, ruleName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisFirewallRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisFirewallRule createOrUpdate( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters) { + RedisFirewallRuleInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, cacheName, ruleName, parameters); + if (inner != null) { + return new RedisFirewallRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String cacheName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, cacheName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisFirewallRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisFirewallRule get(String resourceGroupName, String cacheName, String ruleName) { + RedisFirewallRuleInner inner = this.serviceClient().get(resourceGroupName, cacheName, ruleName); + if (inner != null) { + return new RedisFirewallRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String cacheName, String ruleName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, cacheName, ruleName, context); + } + + public void delete(String resourceGroupName, String cacheName, String ruleName) { + this.serviceClient().delete(resourceGroupName, cacheName, ruleName); + } + + private FirewallRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersClientImpl.java new file mode 100644 index 0000000000000..3cc8150a37b0f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersClientImpl.java @@ -0,0 +1,1147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.LinkedServersClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerCreateParameters; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerWithPropertiesList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LinkedServersClient. */ +public final class LinkedServersClientImpl implements LinkedServersClient { + /** The proxy service used to perform REST calls. */ + private final LinkedServersService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of LinkedServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LinkedServersClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy.create(LinkedServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientLinkedServers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private interface LinkedServersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}" + + "/linkedServers/{linkedServerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @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, + @BodyParam("application/json") RedisLinkedServerCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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, + @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") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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.")); + } + 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + name, + linkedServerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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.")); + } + 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + name, + linkedServerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisLinkedServerWithPropertiesInner> + beginCreateAsync( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, name, linkedServerName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RedisLinkedServerWithPropertiesInner.class, + RedisLinkedServerWithPropertiesInner.class, + this.client.getContext()); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisLinkedServerWithPropertiesInner> + beginCreateAsync( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, name, linkedServerName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RedisLinkedServerWithPropertiesInner.class, + RedisLinkedServerWithPropertiesInner.class, + context); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisLinkedServerWithPropertiesInner> + beginCreate( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, name, linkedServerName, parameters).getSyncPoller(); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response to put/get linked server (with properties) for Redis + * cache. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisLinkedServerWithPropertiesInner> + beginCreate( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, name, linkedServerName, parameters, context).getSyncPoller(); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, name, linkedServerName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, name, linkedServerName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisLinkedServerWithPropertiesInner create( + String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters) { + return createAsync(resourceGroupName, name, linkedServerName, parameters).block(); + } + + /** + * Adds a linked server to the Redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get linked server (with properties) for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisLinkedServerWithPropertiesInner create( + String resourceGroupName, + String name, + String linkedServerName, + RedisLinkedServerCreateParameters parameters, + Context context) { + return createAsync(resourceGroupName, name, linkedServerName, parameters, context).block(); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + name, + linkedServerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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>> deleteWithResponseAsync( + 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + name, + linkedServerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, String linkedServerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, linkedServerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, String linkedServerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, name, linkedServerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String name, String linkedServerName) { + return beginDeleteAsync(resourceGroupName, name, linkedServerName).getSyncPoller(); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String name, String linkedServerName, Context context) { + return beginDeleteAsync(resourceGroupName, name, linkedServerName, context).getSyncPoller(); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, String linkedServerName) { + return beginDeleteAsync(resourceGroupName, name, linkedServerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, String linkedServerName, Context context) { + return beginDeleteAsync(resourceGroupName, name, linkedServerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, String linkedServerName) { + deleteAsync(resourceGroupName, name, linkedServerName).block(); + } + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, String linkedServerName, Context context) { + 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. + * @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) + private 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. + * @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. + * @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) + private 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. + * @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. + * @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). + * + * @param resourceGroupName The name of the resource group. + * @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 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> listSinglePageAsync( + String resourceGroupName, String name) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + name, + 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())); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 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> listSinglePageAsync( + 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 (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.")); + } + 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) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, name), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, name, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String name) { + return new PagedIterable<>(listAsync(resourceGroupName, name)); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String name, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, name, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of linked servers (with properties) of a Redis cache 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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}. + */ + @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-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersImpl.java new file mode 100644 index 0000000000000..bd17277e029bb --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/LinkedServersImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.LinkedServersClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.azure.resourcemanager.redis.generated.models.LinkedServers; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerWithProperties; + +public final class LinkedServersImpl implements LinkedServers { + private static final ClientLogger LOGGER = new ClientLogger(LinkedServersImpl.class); + + private final LinkedServersClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public LinkedServersImpl( + LinkedServersClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String name, String linkedServerName) { + this.serviceClient().delete(resourceGroupName, name, linkedServerName); + } + + public void delete(String resourceGroupName, String name, String linkedServerName, Context context) { + this.serviceClient().delete(resourceGroupName, name, linkedServerName, context); + } + + public Response getWithResponse( + String resourceGroupName, String name, String linkedServerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, name, linkedServerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisLinkedServerWithPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisLinkedServerWithProperties get(String resourceGroupName, String name, String linkedServerName) { + RedisLinkedServerWithPropertiesInner inner = + this.serviceClient().get(resourceGroupName, name, linkedServerName); + if (inner != null) { + return new RedisLinkedServerWithPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, name); + return Utils.mapPage(inner, inner1 -> new RedisLinkedServerWithPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String name, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, name, context); + return Utils.mapPage(inner, inner1 -> new RedisLinkedServerWithPropertiesImpl(inner1, this.manager())); + } + + public RedisLinkedServerWithProperties getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String linkedServerName = Utils.getValueFromIdByName(id, "linkedServers"); + if (linkedServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'linkedServers'.", id))); + } + return this.getWithResponse(resourceGroupName, name, linkedServerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String linkedServerName = Utils.getValueFromIdByName(id, "linkedServers"); + if (linkedServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'linkedServers'.", id))); + } + return this.getWithResponse(resourceGroupName, name, linkedServerName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String linkedServerName = Utils.getValueFromIdByName(id, "linkedServers"); + if (linkedServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'linkedServers'.", id))); + } + this.delete(resourceGroupName, name, linkedServerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String linkedServerName = Utils.getValueFromIdByName(id, "linkedServers"); + if (linkedServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'linkedServers'.", id))); + } + this.delete(resourceGroupName, name, linkedServerName, context); + } + + private LinkedServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + public RedisLinkedServerWithPropertiesImpl define(String name) { + return new RedisLinkedServerWithPropertiesImpl(name, this.manager()); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..4077bc2daab45 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.redis.generated.models.Operation; +import com.azure.resourcemanager.redis.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationStatusImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationStatusImpl.java new file mode 100644 index 0000000000000..b6cb768504780 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationStatusImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.redis.generated.models.ErrorDetailAutoGenerated; +import com.azure.resourcemanager.redis.generated.models.OperationStatus; +import com.azure.resourcemanager.redis.generated.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + OperationStatusImpl( + OperationStatusInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ErrorDetailAutoGenerated error() { + return this.innerModel().error(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..0f6ff0670e9a2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redis.generated.fluent.OperationsClient; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.redis.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Cache/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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 of the available REST API operations of the Microsoft.Cache provider. + * + * @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 result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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. + * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @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 result of the request to list REST API operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @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 result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations 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-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..fb9358047a76f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.OperationsClient; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.redis.generated.models.Operation; +import com.azure.resourcemanager.redis.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesClientImpl.java new file mode 100644 index 0000000000000..092ea238b1a09 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesClientImpl.java @@ -0,0 +1,902 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redis.generated.fluent.PatchSchedulesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.generated.models.DefaultName; +import com.azure.resourcemanager.redis.generated.models.RedisPatchScheduleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PatchSchedulesClient. */ +public final class PatchSchedulesClientImpl implements PatchSchedulesClient { + /** The proxy service used to perform REST calls. */ + private final PatchSchedulesService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of PatchSchedulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PatchSchedulesClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy.create(PatchSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientPatchSchedules to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private interface PatchSchedulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis" + + "/{cacheName}/patchSchedules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRedisResource( + @HostParam("$host") 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"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}" + + "/patchSchedules/{default}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @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, + @BodyParam("application/json") RedisPatchScheduleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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, + @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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}" + + "/patchSchedules/{default}") + @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); + + @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, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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) along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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 + .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 all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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) along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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 + .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 all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRedisResourceAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>( + () -> listByRedisResourceSinglePageAsync(resourceGroupName, cacheName), + nextLink -> listByRedisResourceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 + * 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. + * @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}. + */ + @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. + * @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)); + } + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, DefaultName defaultParameter, RedisPatchScheduleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (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 + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + name, + defaultParameter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String name, + DefaultName defaultParameter, + RedisPatchScheduleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (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 + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + name, + defaultParameter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, DefaultName defaultParameter, RedisPatchScheduleInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, name, defaultParameter, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String name, + DefaultName defaultParameter, + RedisPatchScheduleInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, name, defaultParameter, parameters, context).block(); + } + + /** + * Create or replace the patching schedule for Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to put/get patch schedules for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisPatchScheduleInner createOrUpdate( + String resourceGroupName, String name, DefaultName defaultParameter, RedisPatchScheduleInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, name, defaultParameter, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 ManagementException 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> deleteWithResponseAsync( + 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.")); + } + 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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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> deleteWithResponseAsync( + 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.")); + } + 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.")); + } + 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); + } + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, DefaultName defaultParameter) { + return deleteWithResponseAsync(resourceGroupName, name, defaultParameter).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context) { + return deleteWithResponseAsync(resourceGroupName, name, defaultParameter, context).block(); + } + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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 delete(String resourceGroupName, String name, DefaultName defaultParameter) { + deleteWithResponse(resourceGroupName, name, defaultParameter, Context.NONE); + } + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private 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.")); + } + 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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + 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.")); + } + 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); + } + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String name, DefaultName defaultParameter) { + return getWithResponseAsync(resourceGroupName, name, defaultParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context) { + return getWithResponseAsync(resourceGroupName, name, defaultParameter, context).block(); + } + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 ManagementException 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) + public RedisPatchScheduleInner get(String resourceGroupName, String name, DefaultName defaultParameter) { + return getWithResponse(resourceGroupName, name, defaultParameter, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of list patch schedules Redis operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRedisResourceNextSinglePageAsync(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.listByRedisResourceNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRedisResourceNextSinglePageAsync( + 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 + .listByRedisResourceNext(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-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesImpl.java new file mode 100644 index 0000000000000..70c8baa125843 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PatchSchedulesImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.PatchSchedulesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.generated.models.DefaultName; +import com.azure.resourcemanager.redis.generated.models.PatchSchedules; +import com.azure.resourcemanager.redis.generated.models.RedisPatchSchedule; + +public final class PatchSchedulesImpl implements PatchSchedules { + private static final ClientLogger LOGGER = new ClientLogger(PatchSchedulesImpl.class); + + private final PatchSchedulesClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public PatchSchedulesImpl( + PatchSchedulesClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByRedisResource(String resourceGroupName, String cacheName) { + PagedIterable inner = + this.serviceClient().listByRedisResource(resourceGroupName, cacheName); + return Utils.mapPage(inner, inner1 -> new RedisPatchScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listByRedisResource( + String resourceGroupName, String cacheName, Context context) { + PagedIterable inner = + this.serviceClient().listByRedisResource(resourceGroupName, cacheName, context); + return Utils.mapPage(inner, inner1 -> new RedisPatchScheduleImpl(inner1, this.manager())); + } + + public Response deleteWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, name, defaultParameter, context); + } + + public void delete(String resourceGroupName, String name, DefaultName defaultParameter) { + this.serviceClient().delete(resourceGroupName, name, defaultParameter); + } + + public Response getWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, name, defaultParameter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisPatchScheduleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisPatchSchedule get(String resourceGroupName, String name, DefaultName defaultParameter) { + RedisPatchScheduleInner inner = this.serviceClient().get(resourceGroupName, name, defaultParameter); + if (inner != null) { + return new RedisPatchScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public RedisPatchSchedule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String defaultParameterLocal = Utils.getValueFromIdByName(id, "patchSchedules"); + if (defaultParameterLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'patchSchedules'.", id))); + } + DefaultName defaultParameter = DefaultName.fromString(defaultParameterLocal); + return this.getWithResponse(resourceGroupName, name, defaultParameter, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String defaultParameterLocal = Utils.getValueFromIdByName(id, "patchSchedules"); + if (defaultParameterLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'patchSchedules'.", id))); + } + DefaultName defaultParameter = DefaultName.fromString(defaultParameterLocal); + return this.getWithResponse(resourceGroupName, name, defaultParameter, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String defaultParameterLocal = Utils.getValueFromIdByName(id, "patchSchedules"); + if (defaultParameterLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'patchSchedules'.", id))); + } + DefaultName defaultParameter = DefaultName.fromString(defaultParameterLocal); + this.deleteWithResponse(resourceGroupName, name, defaultParameter, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String defaultParameterLocal = Utils.getValueFromIdByName(id, "patchSchedules"); + if (defaultParameterLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'patchSchedules'.", id))); + } + DefaultName defaultParameter = DefaultName.fromString(defaultParameterLocal); + return this.deleteWithResponse(resourceGroupName, name, defaultParameter, context); + } + + private PatchSchedulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + public RedisPatchScheduleImpl define(DefaultName name) { + return new RedisPatchScheduleImpl(name, this.manager()); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..0d69e6a965964 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cacheName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingRedi(String resourceGroupName, String cacheName) { + this.resourceGroupName = resourceGroupName; + this.cacheName = cacheName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(resourceGroupName, cacheName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(resourceGroupName, cacheName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(resourceGroupName, cacheName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(resourceGroupName, cacheName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cacheName = Utils.getValueFromIdByName(innerObject.id(), "redis"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..83a72e0287c04 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,984 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private 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, + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cacheName") String cacheName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @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. + * @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. + * @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. + * @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) + private 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. + * @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. + * @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. + * @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)); + } + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + 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.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String 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); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + Mono>> mono = + putWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + putWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginPut( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return beginPutAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties).getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginPut( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return beginPutAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return beginPutAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return beginPutAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner put( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner put( + String resourceGroupName, + String cacheName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return putAsync(resourceGroupName, cacheName, privateEndpointConnectionName, properties, context).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, 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.")); + } + 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); + } + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + return deleteWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, cacheName, privateEndpointConnectionName, context).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + deleteWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..aa3443b5a19ee --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String cacheName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cacheName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String cacheName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, cacheName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get( + String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, cacheName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, context); + } + + public void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, cacheName, privateEndpointConnectionName); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cacheName = Utils.getValueFromIdByName(id, "redis"); + if (cacheName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cacheName = Utils.getValueFromIdByName(id, "redis"); + if (cacheName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cacheName = Utils.getValueFromIdByName(id, "redis"); + if (cacheName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.deleteWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cacheName = Utils.getValueFromIdByName(id, "redis"); + if (cacheName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, cacheName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourceImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..7301944e41552 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..7fd6b919cb687 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redis.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(RedisManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private 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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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> listByRedisCacheSinglePageAsync( + 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 + .listByRedisCache( + 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())); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 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> listByRedisCacheSinglePageAsync( + 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 + .listByRedisCache( + 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)); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRedisCacheAsync(String resourceGroupName, String cacheName) { + return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName)); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRedisCacheAsync( + String resourceGroupName, String cacheName, Context context) { + return new PagedFlux<>(() -> listByRedisCacheSinglePageAsync(resourceGroupName, cacheName, context)); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRedisCache(String resourceGroupName, String cacheName) { + return new PagedIterable<>(listByRedisCacheAsync(resourceGroupName, cacheName)); + } + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRedisCache( + String resourceGroupName, String cacheName, Context context) { + return new PagedIterable<>(listByRedisCacheAsync(resourceGroupName, cacheName, context)); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..60d9d071672d0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByRedisCache(String resourceGroupName, String cacheName) { + PagedIterable inner = + this.serviceClient().listByRedisCache(resourceGroupName, cacheName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByRedisCache( + String resourceGroupName, String cacheName, Context context) { + PagedIterable inner = + this.serviceClient().listByRedisCache(resourceGroupName, cacheName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisAccessKeysImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisAccessKeysImpl.java new file mode 100644 index 0000000000000..33660fef12ce3 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisAccessKeysImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.models.RedisAccessKeys; + +public final class RedisAccessKeysImpl implements RedisAccessKeys { + private RedisAccessKeysInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + RedisAccessKeysImpl( + RedisAccessKeysInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public RedisAccessKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisClientImpl.java new file mode 100644 index 0000000000000..ddc6a13ac39c8 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisClientImpl.java @@ -0,0 +1,3041 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redis.generated.fluent.RedisClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import com.azure.resourcemanager.redis.generated.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.NotificationListResponse; +import com.azure.resourcemanager.redis.generated.models.RedisCreateParameters; +import com.azure.resourcemanager.redis.generated.models.RedisListResult; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; +import com.azure.resourcemanager.redis.generated.models.RedisUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RedisClient. */ +public final class RedisClientImpl implements RedisClient { + /** The proxy service used to perform REST calls. */ + private final RedisService service; + + /** The service client containing this operation class. */ + private final RedisManagementClientImpl client; + + /** + * Initializes an instance of RedisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RedisClientImpl(RedisManagementClientImpl client) { + this.service = RestProxy.create(RedisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedisManagementClientRedis to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RedisManagementClien") + private interface RedisService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/CheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") 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); + + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RedisCreateParameters parameters, + @HeaderParam("Accept") String accept, + 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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RedisUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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, + @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}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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") + @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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redis") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RedisRegenerateKeyParameters parameters, + @HeaderParam("Accept") String accept, + 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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RedisRebootParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ImportRdbParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @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, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExportRdbParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUpgradeNotificationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + 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, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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) + private 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())); + } + + /** + * 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} 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 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) + private 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. + * @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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, 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.")); + } + 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)); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUpgradeNotificationsAsync( + String resourceGroupName, String name, double history) { + return new PagedFlux<>( + () -> listUpgradeNotificationsSinglePageAsync(resourceGroupName, name, history), + nextLink -> listUpgradeNotificationsNextSinglePageAsync(nextLink)); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpgradeNotifications( + String resourceGroupName, String name, double history) { + return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history)); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public PagedIterable listUpgradeNotifications( + String resourceGroupName, String name, double history, Context context) { + return new PagedIterable<>(listUpgradeNotificationsAsync(resourceGroupName, name, history, context)); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String name, RedisCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisResourceInner> beginCreateAsync( + String resourceGroupName, String name, RedisCreateParameters parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RedisResourceInner.class, + RedisResourceInner.class, + this.client.getContext()); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisResourceInner> beginCreateAsync( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RedisResourceInner.class, RedisResourceInner.class, context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisResourceInner> beginCreate( + String resourceGroupName, String name, RedisCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisResourceInner> beginCreate( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context) { + return beginCreateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String name, RedisCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context) { + return beginCreateAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner create(String resourceGroupName, String name, RedisCreateParameters parameters) { + return createAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner create( + String resourceGroupName, String name, RedisCreateParameters parameters, Context context) { + return createAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisResourceInner> beginUpdateAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RedisResourceInner.class, + RedisResourceInner.class, + this.client.getContext()); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedisResourceInner> beginUpdateAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RedisResourceInner.class, RedisResourceInner.class, context); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisResourceInner> beginUpdate( + String resourceGroupName, String name, RedisUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedisResourceInner> beginUpdate( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner update(String resourceGroupName, String name, RedisUpdateParameters parameters) { + return updateAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Update an existing Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws 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 Redis item in List or Get Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner update( + String resourceGroupName, String name, RedisUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + 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 (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.")); + } + 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); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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 {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private 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.")); + } + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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 {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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.")); + } + 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); + } + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisResourceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>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. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + 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. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @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. + * @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}. + */ + @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> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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())); + } + + /** + * Gets all Redis caches in the specified subscription. + * + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 (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(), + 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)); + } + + /** + * 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Redis caches in the specified subscription. + * + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Redis caches in the specified subscription. + * + * @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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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. + * @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 redis cache access keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String name) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @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 redis cache access keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + 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 (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.")); + } + 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); + } + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @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 redis cache access keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String name) { + return listKeysWithResponseAsync(resourceGroupName, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @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 redis cache access keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse(String resourceGroupName, String name, Context context) { + return listKeysWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @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 redis cache access keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisAccessKeysInner listKeys(String resourceGroupName, String name) { + return listKeysWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Specifies which key to regenerate. + * @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 redis cache access keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters) { + return regenerateKeyWithResponseAsync(resourceGroupName, name, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Specifies which key to regenerate. + * @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 redis cache access keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters, Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisAccessKeysInner regenerateKey( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters) { + return regenerateKeyWithResponse(resourceGroupName, name, parameters, Context.NONE).getValue(); + } + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> forceRebootWithResponseAsync( + String resourceGroupName, String name, RedisRebootParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .forceReboot( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> forceRebootWithResponseAsync( + String resourceGroupName, String name, RedisRebootParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .forceReboot( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceRebootAsync( + String resourceGroupName, String name, RedisRebootParameters parameters) { + return forceRebootWithResponseAsync(resourceGroupName, name, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response forceRebootWithResponse( + String resourceGroupName, String name, RedisRebootParameters parameters, Context context) { + return forceRebootWithResponseAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedisForceRebootResponseInner forceReboot( + String resourceGroupName, String name, RedisRebootParameters parameters) { + return forceRebootWithResponse(resourceGroupName, name, parameters, Context.NONE).getValue(); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @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>> importDataWithResponseAsync( + String resourceGroupName, String name, ImportRdbParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .importData( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> importDataWithResponseAsync( + String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .importData( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginImportDataAsync( + String resourceGroupName, String name, ImportRdbParameters parameters) { + Mono>> mono = importDataWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginImportDataAsync( + String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + importDataWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportData( + String resourceGroupName, String name, ImportRdbParameters parameters) { + return beginImportDataAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportData( + String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + return beginImportDataAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importDataAsync(String resourceGroupName, String name, ImportRdbParameters parameters) { + return beginImportDataAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importDataAsync( + String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + return beginImportDataAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importData(String resourceGroupName, String name, ImportRdbParameters parameters) { + importDataAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importData(String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + importDataAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @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>> exportDataWithResponseAsync( + String resourceGroupName, String name, ExportRdbParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + return FluxUtil + .withContext( + context -> + service + .exportData( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportDataWithResponseAsync( + String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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"; + context = this.client.mergeContext(context); + return service + .exportData( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginExportDataAsync( + String resourceGroupName, String name, ExportRdbParameters parameters) { + Mono>> mono = exportDataWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginExportDataAsync( + String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + exportDataWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginExportData( + String resourceGroupName, String name, ExportRdbParameters parameters) { + return beginExportDataAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginExportData( + String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + return beginExportDataAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportDataAsync(String resourceGroupName, String name, ExportRdbParameters parameters) { + return beginExportDataAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportDataAsync( + String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + return beginExportDataAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void exportData(String resourceGroupName, String name, ExportRdbParameters parameters) { + exportDataAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void exportData(String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + exportDataAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of listUpgradeNotifications along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpgradeNotificationsNextSinglePageAsync(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.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())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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 + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpgradeNotificationsNextSinglePageAsync( + 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 + .listUpgradeNotificationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + 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())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + 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 + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of list Redis operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.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())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisFirewallRuleImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisFirewallRuleImpl.java new file mode 100644 index 0000000000000..c9c29cc7ea489 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisFirewallRuleImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; +import com.azure.resourcemanager.redis.generated.models.RedisFirewallRule; + +public final class RedisFirewallRuleImpl implements RedisFirewallRule { + private RedisFirewallRuleInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + RedisFirewallRuleImpl( + RedisFirewallRuleInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String startIp() { + return this.innerModel().startIp(); + } + + public String endIp() { + return this.innerModel().endIp(); + } + + public RedisFirewallRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisForceRebootResponseImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisForceRebootResponseImpl.java new file mode 100644 index 0000000000000..104deda4ca244 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisForceRebootResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner; +import com.azure.resourcemanager.redis.generated.models.RedisForceRebootResponse; + +public final class RedisForceRebootResponseImpl implements RedisForceRebootResponse { + private RedisForceRebootResponseInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + RedisForceRebootResponseImpl( + RedisForceRebootResponseInner innerObject, + com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public RedisForceRebootResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisImpl.java new file mode 100644 index 0000000000000..4e51333fc7594 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.RedisClient; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import com.azure.resourcemanager.redis.generated.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.Redis; +import com.azure.resourcemanager.redis.generated.models.RedisAccessKeys; +import com.azure.resourcemanager.redis.generated.models.RedisForceRebootResponse; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; +import com.azure.resourcemanager.redis.generated.models.RedisResource; +import com.azure.resourcemanager.redis.generated.models.UpgradeNotification; + +public final class RedisImpl implements Redis { + private static final ClientLogger LOGGER = new ClientLogger(RedisImpl.class); + + private final RedisClient innerClient; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public RedisImpl(RedisClient innerClient, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityParameters parameters, Context context) { + return this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); + } + + public void checkNameAvailability(CheckNameAvailabilityParameters parameters) { + this.serviceClient().checkNameAvailability(parameters); + } + + public PagedIterable listUpgradeNotifications( + String resourceGroupName, String name, double history) { + PagedIterable inner = + this.serviceClient().listUpgradeNotifications(resourceGroupName, name, history); + return Utils.mapPage(inner, inner1 -> new UpgradeNotificationImpl(inner1, this.manager())); + } + + public PagedIterable listUpgradeNotifications( + String resourceGroupName, String name, double history, Context context) { + PagedIterable inner = + this.serviceClient().listUpgradeNotifications(resourceGroupName, name, history, context); + return Utils.mapPage(inner, inner1 -> new UpgradeNotificationImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisResource getByResourceGroup(String resourceGroupName, String name) { + RedisResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RedisResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RedisResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RedisResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RedisResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RedisResourceImpl(inner1, this.manager())); + } + + public Response listKeysWithResponse(String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisAccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisAccessKeys listKeys(String resourceGroupName, String name) { + RedisAccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, name); + if (inner != null) { + return new RedisAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeyWithResponse( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters, Context context) { + Response inner = + this.serviceClient().regenerateKeyWithResponse(resourceGroupName, name, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisAccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisAccessKeys regenerateKey( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters) { + RedisAccessKeysInner inner = this.serviceClient().regenerateKey(resourceGroupName, name, parameters); + if (inner != null) { + return new RedisAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response forceRebootWithResponse( + String resourceGroupName, String name, RedisRebootParameters parameters, Context context) { + Response inner = + this.serviceClient().forceRebootWithResponse(resourceGroupName, name, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RedisForceRebootResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedisForceRebootResponse forceReboot( + String resourceGroupName, String name, RedisRebootParameters parameters) { + RedisForceRebootResponseInner inner = this.serviceClient().forceReboot(resourceGroupName, name, parameters); + if (inner != null) { + return new RedisForceRebootResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void importData(String resourceGroupName, String name, ImportRdbParameters parameters) { + this.serviceClient().importData(resourceGroupName, name, parameters); + } + + public void importData(String resourceGroupName, String name, ImportRdbParameters parameters, Context context) { + this.serviceClient().importData(resourceGroupName, name, parameters, context); + } + + public void exportData(String resourceGroupName, String name, ExportRdbParameters parameters) { + this.serviceClient().exportData(resourceGroupName, name, parameters); + } + + public void exportData(String resourceGroupName, String name, ExportRdbParameters parameters, Context context) { + this.serviceClient().exportData(resourceGroupName, name, parameters, context); + } + + public RedisResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "redis"); + if (name == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redis'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RedisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + public RedisResourceImpl define(String name) { + return new RedisResourceImpl(name, this.manager()); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisLinkedServerWithPropertiesImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisLinkedServerWithPropertiesImpl.java new file mode 100644 index 0000000000000..88446434f518a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisLinkedServerWithPropertiesImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerCreateParameters; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServerWithProperties; +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; + +public final class RedisLinkedServerWithPropertiesImpl + implements RedisLinkedServerWithProperties, RedisLinkedServerWithProperties.Definition { + private RedisLinkedServerWithPropertiesInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + RedisLinkedServerWithPropertiesImpl( + RedisLinkedServerWithPropertiesInner innerObject, + com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkedRedisCacheId() { + return this.innerModel().linkedRedisCacheId(); + } + + public String linkedRedisCacheLocation() { + return this.innerModel().linkedRedisCacheLocation(); + } + + public ReplicationRole serverRole() { + return this.innerModel().serverRole(); + } + + public String geoReplicatedPrimaryHostname() { + return this.innerModel().geoReplicatedPrimaryHostname(); + } + + public String primaryHostname() { + return this.innerModel().primaryHostname(); + } + + public RedisLinkedServerWithPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private String linkedServerName; + + private RedisLinkedServerCreateParameters createParameters; + + public RedisLinkedServerWithPropertiesImpl withExistingRedi(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + public RedisLinkedServerWithProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedServers() + .create(resourceGroupName, name, linkedServerName, createParameters, Context.NONE); + return this; + } + + public RedisLinkedServerWithProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedServers() + .create(resourceGroupName, name, linkedServerName, createParameters, context); + return this; + } + + RedisLinkedServerWithPropertiesImpl( + String name, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = new RedisLinkedServerWithPropertiesInner(); + this.serviceManager = serviceManager; + this.linkedServerName = name; + this.createParameters = new RedisLinkedServerCreateParameters(); + } + + public RedisLinkedServerWithProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedServers() + .getWithResponse(resourceGroupName, name, linkedServerName, Context.NONE) + .getValue(); + return this; + } + + public RedisLinkedServerWithProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLinkedServers() + .getWithResponse(resourceGroupName, name, linkedServerName, context) + .getValue(); + return this; + } + + public RedisLinkedServerWithPropertiesImpl withLinkedRedisCacheId(String linkedRedisCacheId) { + this.createParameters.withLinkedRedisCacheId(linkedRedisCacheId); + return this; + } + + public RedisLinkedServerWithPropertiesImpl withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + this.createParameters.withLinkedRedisCacheLocation(linkedRedisCacheLocation); + return this; + } + + public RedisLinkedServerWithPropertiesImpl withServerRole(ReplicationRole serverRole) { + this.createParameters.withServerRole(serverRole); + return this; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientBuilder.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientBuilder.java new file mode 100644 index 0000000000000..c2b849ffd6cf0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the RedisManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {RedisManagementClientImpl.class}) +public final class RedisManagementClientBuilder { + /* + * Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the RedisManagementClientBuilder. + */ + public RedisManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of RedisManagementClientImpl with the provided parameters. + * + * @return an instance of RedisManagementClientImpl. + */ + public RedisManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + RedisManagementClientImpl client = + new RedisManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientImpl.java new file mode 100644 index 0000000000000..a6964a35d1e1c --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisManagementClientImpl.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.redis.generated.fluent.AsyncOperationStatusClient; +import com.azure.resourcemanager.redis.generated.fluent.FirewallRulesClient; +import com.azure.resourcemanager.redis.generated.fluent.LinkedServersClient; +import com.azure.resourcemanager.redis.generated.fluent.OperationsClient; +import com.azure.resourcemanager.redis.generated.fluent.PatchSchedulesClient; +import com.azure.resourcemanager.redis.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.redis.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.redis.generated.fluent.RedisClient; +import com.azure.resourcemanager.redis.generated.fluent.RedisManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the RedisManagementClientImpl type. */ +@ServiceClient(builder = RedisManagementClientBuilder.class) +public final class RedisManagementClientImpl implements RedisManagementClient { + /** + * Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + 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. */ + private final LinkedServersClient linkedServers; + + /** + * Gets the LinkedServersClient object to access its operations. + * + * @return the LinkedServersClient object. + */ + public LinkedServersClient getLinkedServers() { + return this.linkedServers; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** 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. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @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 Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + RedisManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-06-01"; + 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.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.asyncOperationStatus = new AsyncOperationStatusClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisManagementClientImpl.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPatchScheduleImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPatchScheduleImpl.java new file mode 100644 index 0000000000000..6840d53921a84 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPatchScheduleImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import com.azure.resourcemanager.redis.generated.models.DefaultName; +import com.azure.resourcemanager.redis.generated.models.RedisPatchSchedule; +import com.azure.resourcemanager.redis.generated.models.ScheduleEntry; +import java.util.Collections; +import java.util.List; + +public final class RedisPatchScheduleImpl + implements RedisPatchSchedule, RedisPatchSchedule.Definition, RedisPatchSchedule.Update { + private RedisPatchScheduleInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public List scheduleEntries() { + List inner = this.innerModel().scheduleEntries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RedisPatchScheduleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private DefaultName defaultParameter; + + public RedisPatchScheduleImpl withExistingRedi(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + public RedisPatchSchedule create() { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .createOrUpdateWithResponse(resourceGroupName, name, defaultParameter, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RedisPatchSchedule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .createOrUpdateWithResponse(resourceGroupName, name, defaultParameter, this.innerModel(), context) + .getValue(); + return this; + } + + RedisPatchScheduleImpl(DefaultName name, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = new RedisPatchScheduleInner(); + this.serviceManager = serviceManager; + this.defaultParameter = name; + } + + public RedisPatchScheduleImpl update() { + return this; + } + + public RedisPatchSchedule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .createOrUpdateWithResponse(resourceGroupName, name, defaultParameter, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RedisPatchSchedule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .createOrUpdateWithResponse(resourceGroupName, name, defaultParameter, this.innerModel(), context) + .getValue(); + return this; + } + + RedisPatchScheduleImpl( + RedisPatchScheduleInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "redis"); + this.defaultParameter = DefaultName.fromString(Utils.getValueFromIdByName(innerObject.id(), "patchSchedules")); + } + + public RedisPatchSchedule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .getWithResponse(resourceGroupName, name, defaultParameter, Context.NONE) + .getValue(); + return this; + } + + public RedisPatchSchedule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPatchSchedules() + .getWithResponse(resourceGroupName, name, defaultParameter, context) + .getValue(); + return this; + } + + public RedisPatchScheduleImpl withScheduleEntries(List scheduleEntries) { + this.innerModel().withScheduleEntries(scheduleEntries); + return this; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPropertiesImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPropertiesImpl.java new file mode 100644 index 0000000000000..e3a986ea74989 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisPropertiesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPropertiesInner; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redis.generated.models.ProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisAccessKeys; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.RedisInstanceDetails; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServer; +import com.azure.resourcemanager.redis.generated.models.RedisProperties; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RedisPropertiesImpl implements RedisProperties { + private RedisPropertiesInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + RedisPropertiesImpl( + RedisPropertiesInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.innerModel().redisConfiguration(); + } + + public String redisVersion() { + return this.innerModel().redisVersion(); + } + + public Boolean enableNonSslPort() { + return this.innerModel().enableNonSslPort(); + } + + public Integer replicasPerMaster() { + return this.innerModel().replicasPerMaster(); + } + + public Integer replicasPerPrimary() { + return this.innerModel().replicasPerPrimary(); + } + + public Map tenantSettings() { + Map inner = this.innerModel().tenantSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shardCount() { + return this.innerModel().shardCount(); + } + + public TlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String staticIp() { + return this.innerModel().staticIp(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer port() { + return this.innerModel().port(); + } + + public Integer sslPort() { + return this.innerModel().sslPort(); + } + + public RedisAccessKeys accessKeys() { + RedisAccessKeysInner inner = this.innerModel().accessKeys(); + if (inner != null) { + return new RedisAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public List linkedServers() { + List inner = this.innerModel().linkedServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List instances() { + List inner = this.innerModel().instances(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RedisPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisResourceImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisResourceImpl.java new file mode 100644 index 0000000000000..036eeb1e0918b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/RedisResourceImpl.java @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import com.azure.resourcemanager.redis.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.redis.generated.models.ProvisioningState; +import com.azure.resourcemanager.redis.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.redis.generated.models.RedisAccessKeys; +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.RedisCreateParameters; +import com.azure.resourcemanager.redis.generated.models.RedisForceRebootResponse; +import com.azure.resourcemanager.redis.generated.models.RedisInstanceDetails; +import com.azure.resourcemanager.redis.generated.models.RedisLinkedServer; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; +import com.azure.resourcemanager.redis.generated.models.RedisResource; +import com.azure.resourcemanager.redis.generated.models.RedisUpdateParameters; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RedisResourceImpl implements RedisResource, RedisResource.Definition, RedisResource.Update { + private RedisResourceInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer port() { + return this.innerModel().port(); + } + + public Integer sslPort() { + return this.innerModel().sslPort(); + } + + public RedisAccessKeys accessKeys() { + RedisAccessKeysInner inner = this.innerModel().accessKeys(); + if (inner != null) { + return new RedisAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public List linkedServers() { + List inner = this.innerModel().linkedServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List instances() { + List inner = this.innerModel().instances(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String staticIp() { + return this.innerModel().staticIp(); + } + + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.innerModel().redisConfiguration(); + } + + public String redisVersion() { + return this.innerModel().redisVersion(); + } + + public Boolean enableNonSslPort() { + return this.innerModel().enableNonSslPort(); + } + + public Integer replicasPerMaster() { + return this.innerModel().replicasPerMaster(); + } + + public Integer replicasPerPrimary() { + return this.innerModel().replicasPerPrimary(); + } + + public Map tenantSettings() { + Map inner = this.innerModel().tenantSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shardCount() { + return this.innerModel().shardCount(); + } + + public TlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RedisResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RedisCreateParameters createParameters; + + private RedisUpdateParameters updateParameters; + + public RedisResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RedisResource create() { + this.innerObject = + serviceManager.serviceClient().getRedis().create(resourceGroupName, name, createParameters, Context.NONE); + return this; + } + + public RedisResource create(Context context) { + this.innerObject = + serviceManager.serviceClient().getRedis().create(resourceGroupName, name, createParameters, context); + return this; + } + + RedisResourceImpl(String name, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = new RedisResourceInner(); + this.serviceManager = serviceManager; + this.name = name; + this.createParameters = new RedisCreateParameters(); + } + + public RedisResourceImpl update() { + this.updateParameters = new RedisUpdateParameters(); + return this; + } + + public RedisResource apply() { + this.innerObject = + serviceManager.serviceClient().getRedis().update(resourceGroupName, name, updateParameters, Context.NONE); + return this; + } + + public RedisResource apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getRedis().update(resourceGroupName, name, updateParameters, context); + return this; + } + + RedisResourceImpl( + RedisResourceInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "redis"); + } + + public RedisResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRedis() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RedisResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRedis() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(Context context) { + return serviceManager.redis().listKeysWithResponse(resourceGroupName, name, context); + } + + public RedisAccessKeys listKeys() { + return serviceManager.redis().listKeys(resourceGroupName, name); + } + + public Response regenerateKeyWithResponse( + RedisRegenerateKeyParameters parameters, Context context) { + return serviceManager.redis().regenerateKeyWithResponse(resourceGroupName, name, parameters, context); + } + + public RedisAccessKeys regenerateKey(RedisRegenerateKeyParameters parameters) { + return serviceManager.redis().regenerateKey(resourceGroupName, name, parameters); + } + + public Response forceRebootWithResponse( + RedisRebootParameters parameters, Context context) { + return serviceManager.redis().forceRebootWithResponse(resourceGroupName, name, parameters, context); + } + + public RedisForceRebootResponse forceReboot(RedisRebootParameters parameters) { + return serviceManager.redis().forceReboot(resourceGroupName, name, parameters); + } + + public void importData(ImportRdbParameters parameters) { + serviceManager.redis().importData(resourceGroupName, name, parameters); + } + + public void importData(ImportRdbParameters parameters, Context context) { + serviceManager.redis().importData(resourceGroupName, name, parameters, context); + } + + public void exportData(ExportRdbParameters parameters) { + serviceManager.redis().exportData(resourceGroupName, name, parameters); + } + + public void exportData(ExportRdbParameters parameters, Context context) { + serviceManager.redis().exportData(resourceGroupName, name, parameters, context); + } + + public RedisResourceImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public RedisResourceImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public RedisResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameters.withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public RedisResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RedisResourceImpl withZones(List zones) { + this.createParameters.withZones(zones); + return this; + } + + public RedisResourceImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.createParameters.withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public RedisResourceImpl withSubnetId(String subnetId) { + this.createParameters.withSubnetId(subnetId); + return this; + } + + public RedisResourceImpl withStaticIp(String staticIp) { + this.createParameters.withStaticIp(staticIp); + return this; + } + + public RedisResourceImpl withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + if (isInCreateMode()) { + this.createParameters.withRedisConfiguration(redisConfiguration); + return this; + } else { + this.updateParameters.withRedisConfiguration(redisConfiguration); + return this; + } + } + + public RedisResourceImpl withRedisVersion(String redisVersion) { + if (isInCreateMode()) { + this.createParameters.withRedisVersion(redisVersion); + return this; + } else { + this.updateParameters.withRedisVersion(redisVersion); + return this; + } + } + + public RedisResourceImpl withEnableNonSslPort(Boolean enableNonSslPort) { + if (isInCreateMode()) { + this.createParameters.withEnableNonSslPort(enableNonSslPort); + return this; + } else { + this.updateParameters.withEnableNonSslPort(enableNonSslPort); + return this; + } + } + + public RedisResourceImpl withReplicasPerMaster(Integer replicasPerMaster) { + if (isInCreateMode()) { + this.createParameters.withReplicasPerMaster(replicasPerMaster); + return this; + } else { + this.updateParameters.withReplicasPerMaster(replicasPerMaster); + return this; + } + } + + public RedisResourceImpl withReplicasPerPrimary(Integer replicasPerPrimary) { + if (isInCreateMode()) { + this.createParameters.withReplicasPerPrimary(replicasPerPrimary); + return this; + } else { + this.updateParameters.withReplicasPerPrimary(replicasPerPrimary); + return this; + } + } + + public RedisResourceImpl withTenantSettings(Map tenantSettings) { + if (isInCreateMode()) { + this.createParameters.withTenantSettings(tenantSettings); + return this; + } else { + this.updateParameters.withTenantSettings(tenantSettings); + return this; + } + } + + public RedisResourceImpl withShardCount(Integer shardCount) { + if (isInCreateMode()) { + this.createParameters.withShardCount(shardCount); + return this; + } else { + this.updateParameters.withShardCount(shardCount); + return this; + } + } + + public RedisResourceImpl withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } else { + this.updateParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + } + + public RedisResourceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.createParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/UpgradeNotificationImpl.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/UpgradeNotificationImpl.java new file mode 100644 index 0000000000000..d48ceac774ab8 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/UpgradeNotificationImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import com.azure.resourcemanager.redis.generated.models.UpgradeNotification; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class UpgradeNotificationImpl implements UpgradeNotification { + private UpgradeNotificationInner innerObject; + + private final com.azure.resourcemanager.redis.generated.RedisManager serviceManager; + + UpgradeNotificationImpl( + UpgradeNotificationInner innerObject, com.azure.resourcemanager.redis.generated.RedisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OffsetDateTime timestamp() { + return this.innerModel().timestamp(); + } + + public Map upsellNotification() { + Map inner = this.innerModel().upsellNotification(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public UpgradeNotificationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redis.generated.RedisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/Utils.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/Utils.java new file mode 100644 index 0000000000000..4bbafdb6299e8 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/package-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/package-info.java new file mode 100644 index 0000000000000..e0677076d6037 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for RedisManagementClient. REST API for Azure Redis Cache Service. */ +package com.azure.resourcemanager.redis.generated.implementation; diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/AsyncOperationStatus.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/AsyncOperationStatus.java new file mode 100644 index 0000000000000..3b96a2d089290 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/AsyncOperationStatus.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AsyncOperationStatus. */ +public interface AsyncOperationStatus { + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asynchronous operation status along with {@link Response}. + */ + Response getWithResponse(String location, String operationId, Context context); + + /** + * For checking the ongoing status of an operation. + * + * @param location The location at which operation was triggered. + * @param operationId The ID of asynchronous 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 asynchronous operation status. + */ + OperationStatus get(String location, String operationId); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/CheckNameAvailabilityParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..321b2d1d9a33d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/CheckNameAvailabilityParameters.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters body to pass for resource name availability check. */ +@Fluent +public final class CheckNameAvailabilityParameters { + /* + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Resource type. The only legal value of this property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of CheckNameAvailabilityParameters class. */ + public CheckNameAvailabilityParameters() { + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. The only legal value of this property for checking redis cache name + * availability is 'Microsoft.Cache/redis'. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. The only legal value of this property for checking redis cache name + * availability is 'Microsoft.Cache/redis'. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CheckNameAvailabilityParameters")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model CheckNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DayOfWeek.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DayOfWeek.java new file mode 100644 index 0000000000000..e545c3f69b083 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DayOfWeek.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Day of the week when a cache can be patched. */ +public enum DayOfWeek { + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"), + + /** Enum value Sunday. */ + SUNDAY("Sunday"), + + /** Enum value Everyday. */ + EVERYDAY("Everyday"), + + /** Enum value Weekend. */ + WEEKEND("Weekend"); + + /** The actual serialized value for a DayOfWeek instance. */ + private final String value; + + DayOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DayOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DayOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DayOfWeek fromString(String value) { + if (value == null) { + return null; + } + DayOfWeek[] items = DayOfWeek.values(); + for (DayOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DefaultName.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DefaultName.java new file mode 100644 index 0000000000000..4505884b63738 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/DefaultName.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultName. */ +public final class DefaultName extends ExpandableStringEnum { + /** Static value default for DefaultName. */ + public static final DefaultName DEFAULT = fromString("default"); + + /** + * Creates or finds a DefaultName from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultName. + */ + @JsonCreator + public static DefaultName fromString(String name) { + return fromString(name, DefaultName.class); + } + + /** + * Gets known DefaultName values. + * + * @return known DefaultName values. + */ + public static Collection values() { + return values(DefaultName.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorAdditionalInfo.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..7e49c896d1e02 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorAdditionalInfo.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** Creates an instance of ErrorAdditionalInfo class. */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorDetailAutoGenerated.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorDetailAutoGenerated.java new file mode 100644 index 0000000000000..79daa1b4eee5f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ErrorDetailAutoGenerated.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The error detail. */ +@Immutable +public final class ErrorDetailAutoGenerated { + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** Creates an instance of ErrorDetailAutoGenerated class. */ + public ErrorDetailAutoGenerated() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the additionalInfo property: The error additional info. + * + * @return the additionalInfo value. + */ + public List additionalInfo() { + return this.additionalInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (additionalInfo() != null) { + additionalInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ExportRdbParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ExportRdbParameters.java new file mode 100644 index 0000000000000..45567327f9feb --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ExportRdbParameters.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for Redis export operation. */ +@Fluent +public final class ExportRdbParameters { + /* + * File format. + */ + @JsonProperty(value = "format") + private String format; + + /* + * Prefix to use for exported files. + */ + @JsonProperty(value = "prefix", required = true) + private String prefix; + + /* + * Container name to export to. + */ + @JsonProperty(value = "container", required = true) + private String container; + + /* + * Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, + * default value is SAS + */ + @JsonProperty(value = "preferred-data-archive-auth-method") + private String preferredDataArchiveAuthMethod; + + /** Creates an instance of ExportRdbParameters class. */ + public ExportRdbParameters() { + } + + /** + * Get the format property: File format. + * + * @return the format value. + */ + public String format() { + return this.format; + } + + /** + * Set the format property: File format. + * + * @param format the format value to set. + * @return the ExportRdbParameters object itself. + */ + public ExportRdbParameters withFormat(String format) { + this.format = format; + return this; + } + + /** + * Get the prefix property: Prefix to use for exported files. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Prefix to use for exported files. + * + * @param prefix the prefix value to set. + * @return the ExportRdbParameters object itself. + */ + public ExportRdbParameters withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the container property: Container name to export to. + * + * @return the container value. + */ + public String container() { + return this.container; + } + + /** + * Set the container property: Container name to export to. + * + * @param container the container value to set. + * @return the ExportRdbParameters object itself. + */ + public ExportRdbParameters withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the preferredDataArchiveAuthMethod property: Preferred auth method to communicate to storage account used for + * data archive, specify SAS or ManagedIdentity, default value is SAS. + * + * @return the preferredDataArchiveAuthMethod value. + */ + public String preferredDataArchiveAuthMethod() { + return this.preferredDataArchiveAuthMethod; + } + + /** + * Set the preferredDataArchiveAuthMethod property: Preferred auth method to communicate to storage account used for + * data archive, specify SAS or ManagedIdentity, default value is SAS. + * + * @param preferredDataArchiveAuthMethod the preferredDataArchiveAuthMethod value to set. + * @return the ExportRdbParameters object itself. + */ + public ExportRdbParameters withPreferredDataArchiveAuthMethod(String preferredDataArchiveAuthMethod) { + this.preferredDataArchiveAuthMethod = preferredDataArchiveAuthMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prefix() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property prefix in model ExportRdbParameters")); + } + if (container() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property container in model ExportRdbParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportRdbParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/FirewallRules.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/FirewallRules.java new file mode 100644 index 0000000000000..074b8af197138 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/FirewallRules.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** Resource collection API of FirewallRules. */ +public interface FirewallRules { + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 all firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String cacheName); + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 all firewall rules in the specified redis cache as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String cacheName, Context context); + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String cacheName, + String ruleName, + RedisFirewallRuleInner parameters, + Context context); + + /** + * Create or update a redis cache firewall rule. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param ruleName The name of the firewall rule. + * @param parameters Parameters supplied to the create or update redis firewall rule 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 firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted + * to connect. + */ + RedisFirewallRule createOrUpdate( + String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleInner parameters); + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 a single firewall rule in a specified redis cache along with {@link Response}. + */ + 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. + * @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. + */ + RedisFirewallRule get(String resourceGroupName, String cacheName, String ruleName); + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + Response deleteWithResponse(String resourceGroupName, String cacheName, String ruleName, Context context); + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + void delete(String resourceGroupName, String cacheName, String ruleName); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ImportRdbParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ImportRdbParameters.java new file mode 100644 index 0000000000000..2c93a8bd5d3c3 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ImportRdbParameters.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for Redis import operation. */ +@Fluent +public final class ImportRdbParameters { + /* + * File format. + */ + @JsonProperty(value = "format") + private String format; + + /* + * files to import. + */ + @JsonProperty(value = "files", required = true) + private List files; + + /* + * Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, + * default value is SAS + */ + @JsonProperty(value = "preferred-data-archive-auth-method") + private String preferredDataArchiveAuthMethod; + + /** Creates an instance of ImportRdbParameters class. */ + public ImportRdbParameters() { + } + + /** + * Get the format property: File format. + * + * @return the format value. + */ + public String format() { + return this.format; + } + + /** + * Set the format property: File format. + * + * @param format the format value to set. + * @return the ImportRdbParameters object itself. + */ + public ImportRdbParameters withFormat(String format) { + this.format = format; + return this; + } + + /** + * Get the files property: files to import. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: files to import. + * + * @param files the files value to set. + * @return the ImportRdbParameters object itself. + */ + public ImportRdbParameters withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the preferredDataArchiveAuthMethod property: Preferred auth method to communicate to storage account used for + * data archive, specify SAS or ManagedIdentity, default value is SAS. + * + * @return the preferredDataArchiveAuthMethod value. + */ + public String preferredDataArchiveAuthMethod() { + return this.preferredDataArchiveAuthMethod; + } + + /** + * Set the preferredDataArchiveAuthMethod property: Preferred auth method to communicate to storage account used for + * data archive, specify SAS or ManagedIdentity, default value is SAS. + * + * @param preferredDataArchiveAuthMethod the preferredDataArchiveAuthMethod value to set. + * @return the ImportRdbParameters object itself. + */ + public ImportRdbParameters withPreferredDataArchiveAuthMethod(String preferredDataArchiveAuthMethod) { + this.preferredDataArchiveAuthMethod = preferredDataArchiveAuthMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (files() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property files in model ImportRdbParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportRdbParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/LinkedServers.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/LinkedServers.java new file mode 100644 index 0000000000000..50f544bcf545a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/LinkedServers.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LinkedServers. */ +public interface LinkedServers { + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param linkedServerName The name of the linked server 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. + */ + void delete(String resourceGroupName, String name, String linkedServerName); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void 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. + * @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}. + */ + 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. + * @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). + */ + RedisLinkedServerWithProperties get(String resourceGroupName, String name, String linkedServerName); + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String name); + + /** + * Gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @param resourceGroupName The name of the resource group. + * @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 the list of linked servers associated with this redis cache (requires Premium SKU) as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String name, Context context); + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + RedisLinkedServerWithProperties getById(String id); + + /** + * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @param id the resource ID. + * @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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the linked server from a redis cache (requires Premium SKU). + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RedisLinkedServerWithProperties resource. + * + * @param name resource name. + * @return the first stage of the new RedisLinkedServerWithProperties definition. + */ + RedisLinkedServerWithProperties.DefinitionStages.Blank define(String name); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentity.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..286c11f7172f0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentityType.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..d41dead41a234 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ManagedServiceIdentityType.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/NotificationListResponse.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/NotificationListResponse.java new file mode 100644 index 0000000000000..c8af022864e55 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/NotificationListResponse.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of listUpgradeNotifications. */ +@Fluent +public final class NotificationListResponse { + /* + * List of all notifications. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for next set of notifications. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of NotificationListResponse class. */ + public NotificationListResponse() { + } + + /** + * Get the value property: List of all notifications. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operation.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operation.java new file mode 100644 index 0000000000000..93f08d3685d12 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationDisplay.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..1bea9ca1ed655 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that describes the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Friendly name of the resource provider + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Operation type: read, write, delete, listKeys/action, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Friendly name of the operation + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: Friendly name of the resource provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Friendly name of the resource provider. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation property: Operation type: read, write, delete, listKeys/action, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: read, write, delete, listKeys/action, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource property: Resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource type on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description property: Friendly name of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Friendly name of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..2cfe091e1fce0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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 +public final class OperationListResult { + /* + * List of operations supported by the resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatus.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatus.java new file mode 100644 index 0000000000000..7e7d9ec58efb9 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatus.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ErrorDetailAutoGenerated error(); + + /** + * Gets the properties property: Additional properties from RP, only when operation is successful. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatusResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatusResult.java new file mode 100644 index 0000000000000..764fd9c804c79 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/OperationStatusResult.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The current status of an async operation. */ +@Fluent +public class OperationStatusResult { + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ErrorDetailAutoGenerated error; + + /** Creates an instance of OperationStatusResult class. */ + public OperationStatusResult() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ErrorDetailAutoGenerated error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withError(ErrorDetailAutoGenerated error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model OperationStatusResult")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + if (error() != null) { + error().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResult.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operations.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operations.java new file mode 100644 index 0000000000000..49170542eda2f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.Cache 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. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.Cache provider. + * + * @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 result of the request to list REST API operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PatchSchedules.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PatchSchedules.java new file mode 100644 index 0000000000000..5f2e6ad7037ef --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PatchSchedules.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PatchSchedules. */ +public interface PatchSchedules { + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 all patch schedules in the specified redis cache (there is only one) as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByRedisResource(String resourceGroupName, String cacheName); + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param resourceGroupName The name of the resource group. + * @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 all patch schedules in the specified redis cache (there is only one) as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByRedisResource(String resourceGroupName, String cacheName, Context context); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String name, DefaultName defaultParameter, Context context); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + void delete(String resourceGroupName, String name, DefaultName defaultParameter); + + /** + * Gets the patching schedule of a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @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}. + */ + 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. + * @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. + */ + RedisPatchSchedule get(String resourceGroupName, String name, DefaultName defaultParameter); + + /** + * Gets the patching schedule of a redis cache. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + RedisPatchSchedule getById(String id); + + /** + * Gets the patching schedule of a redis cache. + * + * @param id the resource ID. + * @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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the patching schedule of a redis cache. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RedisPatchSchedule resource. + * + * @param name resource name. + * @return the first stage of the new RedisPatchSchedule definition. + */ + RedisPatchSchedule.DefinitionStages.Blank define(DefaultName name); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpoint.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..5361a33fd89c1 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnection.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..2473e42f2d170 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, cacheName. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @return the next definition stage. + */ + WithCreate withExistingRedi(String resourceGroupName, String cacheName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..b483692779bc5 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connection associated with the specified storage account. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..34cabdd6cb1a9 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnections.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..9e516db3b676b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * List all the private endpoint connections associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + 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. + * @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}. + */ + PagedIterable list(String resourceGroupName, String cacheName, Context context); + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache. + */ + PrivateEndpointConnection get(String resourceGroupName, String cacheName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String cacheName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param cacheName The name of the Redis cache. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cacheName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the redis cache. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the redis cache along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the redis cache. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointServiceConnectionStatus.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..2698b187816bb --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResource.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..631b8114db90d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResource.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResourceListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..e2f13934a1aec --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResult { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResources.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..99695099165fd --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkResources.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByRedisCache(String resourceGroupName, String cacheName); + + /** + * Gets the private link resources that need to be created for a redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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 private link resources that need to be created for a redis cache as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByRedisCache(String resourceGroupName, String cacheName, Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkServiceConnectionState.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..4853843b34792 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ProvisioningState.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..681b5f16a59f7 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ProvisioningState.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Redis instance provisioning status. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Disabled for ProvisioningState. */ + public static final ProvisioningState DISABLED = fromString("Disabled"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Linking for ProvisioningState. */ + public static final ProvisioningState LINKING = fromString("Linking"); + + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value RecoveringScaleFailure for ProvisioningState. */ + public static final ProvisioningState RECOVERING_SCALE_FAILURE = fromString("RecoveringScaleFailure"); + + /** Static value Scaling for ProvisioningState. */ + public static final ProvisioningState SCALING = fromString("Scaling"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Unlinking for ProvisioningState. */ + public static final ProvisioningState UNLINKING = fromString("Unlinking"); + + /** Static value Unprovisioning for ProvisioningState. */ + public static final ProvisioningState UNPROVISIONING = fromString("Unprovisioning"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PublicNetworkAccess.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..687493c8d831e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/PublicNetworkAccess.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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'. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RebootType.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RebootType.java new file mode 100644 index 0000000000000..6ff30c6cde1e3 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RebootType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Which Redis node(s) to reboot. Depending on this value data loss is possible. */ +public final class RebootType extends ExpandableStringEnum { + /** Static value PrimaryNode for RebootType. */ + public static final RebootType PRIMARY_NODE = fromString("PrimaryNode"); + + /** Static value SecondaryNode for RebootType. */ + public static final RebootType SECONDARY_NODE = fromString("SecondaryNode"); + + /** Static value AllNodes for RebootType. */ + public static final RebootType ALL_NODES = fromString("AllNodes"); + + /** + * Creates or finds a RebootType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RebootType. + */ + @JsonCreator + public static RebootType fromString(String name) { + return fromString(name, RebootType.class); + } + + /** + * Gets known RebootType values. + * + * @return known RebootType values. + */ + public static Collection values() { + return values(RebootType.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Redis.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Redis.java new file mode 100644 index 0000000000000..2948adfa76695 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Redis.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Redis. */ +public interface Redis { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response 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. + */ + void checkNameAvailability(CheckNameAvailabilityParameters parameters); + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + PagedIterable listUpgradeNotifications(String resourceGroupName, String name, double history); + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + PagedIterable listUpgradeNotifications( + String resourceGroupName, String name, double history, Context context); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Deletes a Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @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. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Gets a Redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @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). + */ + RedisResource getByResourceGroup(String resourceGroupName, String name); + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Redis caches in the specified subscription. + * + * @throws com.azure.core.management.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}. + */ + PagedIterable list(); + + /** + * Gets all Redis caches in the specified subscription. + * + * @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}. + */ + PagedIterable list(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. + * @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 redis cache access keys along with {@link Response}. + */ + Response listKeysWithResponse(String resourceGroupName, String name, 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. + * @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 redis cache access keys. + */ + RedisAccessKeys 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. + * @param name The name of the Redis cache. + * @param parameters Specifies which key to regenerate. + * @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 redis cache access keys along with {@link Response}. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, String name, RedisRegenerateKeyParameters parameters, Context context); + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys. + */ + RedisAccessKeys regenerateKey(String resourceGroupName, String name, RedisRegenerateKeyParameters parameters); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response}. + */ + Response forceRebootWithResponse( + String resourceGroupName, String name, RedisRebootParameters parameters, Context context); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache. + */ + RedisForceRebootResponse forceReboot(String resourceGroupName, String name, RedisRebootParameters parameters); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importData(String resourceGroupName, String name, ImportRdbParameters parameters); + + /** + * Import data into Redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importData(String resourceGroupName, String name, ImportRdbParameters parameters, Context context); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void exportData(String resourceGroupName, String name, ExportRdbParameters parameters); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void exportData(String resourceGroupName, String name, ExportRdbParameters parameters, Context context); + + /** + * Gets a Redis cache (resource description). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + RedisResource getById(String id); + + /** + * Gets a Redis cache (resource description). + * + * @param id the resource ID. + * @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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Redis cache. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Redis cache. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RedisResource resource. + * + * @param name resource name. + * @return the first stage of the new RedisResource definition. + */ + RedisResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisAccessKeys.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisAccessKeys.java new file mode 100644 index 0000000000000..cd617960de067 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisAccessKeys.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner; + +/** An immutable client-side representation of RedisAccessKeys. */ +public interface RedisAccessKeys { + /** + * Gets the primaryKey property: The current primary key that clients can use to authenticate with Redis cache. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: The current secondary key that clients can use to authenticate with Redis cache. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisAccessKeysInner object. + * + * @return the inner object. + */ + RedisAccessKeysInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonProperties.java new file mode 100644 index 0000000000000..10f4a69d26a3f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonProperties.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Create/Update/Get common properties of the redis cache. */ +@Fluent +public class RedisCommonProperties { + /* + * All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + */ + @JsonProperty(value = "redisConfiguration") + private RedisCommonPropertiesRedisConfiguration redisConfiguration; + + /* + * Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which + * refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default + * value is 'latest'. + */ + @JsonProperty(value = "redisVersion") + private String redisVersion; + + /* + * Specifies whether the non-ssl Redis server port (6379) is enabled. + */ + @JsonProperty(value = "enableNonSslPort") + private Boolean enableNonSslPort; + + /* + * The number of replicas to be created per primary. + */ + @JsonProperty(value = "replicasPerMaster") + private Integer replicasPerMaster; + + /* + * The number of replicas to be created per primary. + */ + @JsonProperty(value = "replicasPerPrimary") + private Integer replicasPerPrimary; + + /* + * A dictionary of tenant settings + */ + @JsonProperty(value = "tenantSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tenantSettings; + + /* + * The number of shards to be created on a Premium Cluster Cache. + */ + @JsonProperty(value = "shardCount") + private Integer shardCount; + + /* + * Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') + */ + @JsonProperty(value = "minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /* + * 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' + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** Creates an instance of RedisCommonProperties class. */ + public RedisCommonProperties() { + } + + /** + * Get the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.redisConfiguration; + } + + /** + * Set the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param redisConfiguration the redisConfiguration value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + this.redisConfiguration = redisConfiguration; + return this; + } + + /** + * Get the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.redisVersion; + } + + /** + * Set the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @param redisVersion the redisVersion value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withRedisVersion(String redisVersion) { + this.redisVersion = redisVersion; + return this; + } + + /** + * Get the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + public Boolean enableNonSslPort() { + return this.enableNonSslPort; + } + + /** + * Set the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @param enableNonSslPort the enableNonSslPort value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withEnableNonSslPort(Boolean enableNonSslPort) { + this.enableNonSslPort = enableNonSslPort; + return this; + } + + /** + * Get the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + public Integer replicasPerMaster() { + return this.replicasPerMaster; + } + + /** + * Set the replicasPerMaster property: The number of replicas to be created per primary. + * + * @param replicasPerMaster the replicasPerMaster value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withReplicasPerMaster(Integer replicasPerMaster) { + this.replicasPerMaster = replicasPerMaster; + return this; + } + + /** + * Get the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + public Integer replicasPerPrimary() { + return this.replicasPerPrimary; + } + + /** + * Set the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @param replicasPerPrimary the replicasPerPrimary value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withReplicasPerPrimary(Integer replicasPerPrimary) { + this.replicasPerPrimary = replicasPerPrimary; + return this; + } + + /** + * Get the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + public Map tenantSettings() { + return this.tenantSettings; + } + + /** + * Set the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings the tenantSettings value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withTenantSettings(Map tenantSettings) { + this.tenantSettings = tenantSettings; + return this; + } + + /** + * Get the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + public Integer shardCount() { + return this.shardCount; + } + + /** + * Set the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @param shardCount the shardCount value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withShardCount(Integer shardCount) { + this.shardCount = shardCount; + return this; + } + + /** + * Get the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * 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'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.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'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RedisCommonProperties object itself. + */ + public RedisCommonProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (redisConfiguration() != null) { + redisConfiguration().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonPropertiesRedisConfiguration.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonPropertiesRedisConfiguration.java new file mode 100644 index 0000000000000..164460c98df99 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCommonPropertiesRedisConfiguration.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** + * All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + */ +@Fluent +public final class RedisCommonPropertiesRedisConfiguration { + /* + * Specifies whether the rdb backup is enabled + */ + @JsonProperty(value = "rdb-backup-enabled") + private String rdbBackupEnabled; + + /* + * Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440) + */ + @JsonProperty(value = "rdb-backup-frequency") + private String rdbBackupFrequency; + + /* + * Specifies the maximum number of snapshots for rdb backup + */ + @JsonProperty(value = "rdb-backup-max-snapshot-count") + private String rdbBackupMaxSnapshotCount; + + /* + * The storage account connection string for storing rdb file + */ + @JsonProperty(value = "rdb-storage-connection-string") + private String rdbStorageConnectionString; + + /* + * Specifies whether the aof backup is enabled + */ + @JsonProperty(value = "aof-backup-enabled") + private String aofBackupEnabled; + + /* + * First storage account connection string + */ + @JsonProperty(value = "aof-storage-connection-string-0") + private String aofStorageConnectionString0; + + /* + * Second storage account connection string + */ + @JsonProperty(value = "aof-storage-connection-string-1") + private String aofStorageConnectionString1; + + /* + * Value in megabytes reserved for fragmentation per shard + */ + @JsonProperty(value = "maxfragmentationmemory-reserved") + private String maxfragmentationmemoryReserved; + + /* + * The eviction strategy used when your data won't fit within its memory limit. + */ + @JsonProperty(value = "maxmemory-policy") + private String maxmemoryPolicy; + + /* + * Value in megabytes reserved for non-cache usage per shard e.g. failover. + */ + @JsonProperty(value = "maxmemory-reserved") + private String maxmemoryReserved; + + /* + * Value in megabytes reserved for non-cache usage per shard e.g. failover. + */ + @JsonProperty(value = "maxmemory-delta") + private String maxmemoryDelta; + + /* + * The max clients config + */ + @JsonProperty(value = "maxclients", access = JsonProperty.Access.WRITE_ONLY) + private String maxclients; + + /* + * Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, + * default value is SAS + */ + @JsonProperty(value = "preferred-data-archive-auth-method", access = JsonProperty.Access.WRITE_ONLY) + private String preferredDataArchiveAuthMethod; + + /* + * Preferred auth method to communicate to storage account used for data persistence, specify SAS or + * ManagedIdentity, default value is SAS + */ + @JsonProperty(value = "preferred-data-persistence-auth-method") + private String preferredDataPersistenceAuthMethod; + + /* + * Zonal Configuration + */ + @JsonProperty(value = "zonal-configuration", access = JsonProperty.Access.WRITE_ONLY) + private String zonalConfiguration; + + /* + * Specifies whether the authentication is disabled. Setting this property is highly discouraged from security + * point of view. + */ + @JsonProperty(value = "authnotrequired") + private String authnotrequired; + + /* + * All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + */ + @JsonIgnore private Map additionalProperties; + + /** Creates an instance of RedisCommonPropertiesRedisConfiguration class. */ + public RedisCommonPropertiesRedisConfiguration() { + } + + /** + * Get the rdbBackupEnabled property: Specifies whether the rdb backup is enabled. + * + * @return the rdbBackupEnabled value. + */ + public String rdbBackupEnabled() { + return this.rdbBackupEnabled; + } + + /** + * Set the rdbBackupEnabled property: Specifies whether the rdb backup is enabled. + * + * @param rdbBackupEnabled the rdbBackupEnabled value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withRdbBackupEnabled(String rdbBackupEnabled) { + this.rdbBackupEnabled = rdbBackupEnabled; + return this; + } + + /** + * Get the rdbBackupFrequency property: Specifies the frequency for creating rdb backup in minutes. Valid values: + * (15, 30, 60, 360, 720, 1440). + * + * @return the rdbBackupFrequency value. + */ + public String rdbBackupFrequency() { + return this.rdbBackupFrequency; + } + + /** + * Set the rdbBackupFrequency property: Specifies the frequency for creating rdb backup in minutes. Valid values: + * (15, 30, 60, 360, 720, 1440). + * + * @param rdbBackupFrequency the rdbBackupFrequency value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withRdbBackupFrequency(String rdbBackupFrequency) { + this.rdbBackupFrequency = rdbBackupFrequency; + return this; + } + + /** + * Get the rdbBackupMaxSnapshotCount property: Specifies the maximum number of snapshots for rdb backup. + * + * @return the rdbBackupMaxSnapshotCount value. + */ + public String rdbBackupMaxSnapshotCount() { + return this.rdbBackupMaxSnapshotCount; + } + + /** + * Set the rdbBackupMaxSnapshotCount property: Specifies the maximum number of snapshots for rdb backup. + * + * @param rdbBackupMaxSnapshotCount the rdbBackupMaxSnapshotCount value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withRdbBackupMaxSnapshotCount(String rdbBackupMaxSnapshotCount) { + this.rdbBackupMaxSnapshotCount = rdbBackupMaxSnapshotCount; + return this; + } + + /** + * Get the rdbStorageConnectionString property: The storage account connection string for storing rdb file. + * + * @return the rdbStorageConnectionString value. + */ + public String rdbStorageConnectionString() { + return this.rdbStorageConnectionString; + } + + /** + * Set the rdbStorageConnectionString property: The storage account connection string for storing rdb file. + * + * @param rdbStorageConnectionString the rdbStorageConnectionString value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withRdbStorageConnectionString(String rdbStorageConnectionString) { + this.rdbStorageConnectionString = rdbStorageConnectionString; + return this; + } + + /** + * Get the aofBackupEnabled property: Specifies whether the aof backup is enabled. + * + * @return the aofBackupEnabled value. + */ + public String aofBackupEnabled() { + return this.aofBackupEnabled; + } + + /** + * Set the aofBackupEnabled property: Specifies whether the aof backup is enabled. + * + * @param aofBackupEnabled the aofBackupEnabled value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withAofBackupEnabled(String aofBackupEnabled) { + this.aofBackupEnabled = aofBackupEnabled; + return this; + } + + /** + * Get the aofStorageConnectionString0 property: First storage account connection string. + * + * @return the aofStorageConnectionString0 value. + */ + public String aofStorageConnectionString0() { + return this.aofStorageConnectionString0; + } + + /** + * Set the aofStorageConnectionString0 property: First storage account connection string. + * + * @param aofStorageConnectionString0 the aofStorageConnectionString0 value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withAofStorageConnectionString0(String aofStorageConnectionString0) { + this.aofStorageConnectionString0 = aofStorageConnectionString0; + return this; + } + + /** + * Get the aofStorageConnectionString1 property: Second storage account connection string. + * + * @return the aofStorageConnectionString1 value. + */ + public String aofStorageConnectionString1() { + return this.aofStorageConnectionString1; + } + + /** + * Set the aofStorageConnectionString1 property: Second storage account connection string. + * + * @param aofStorageConnectionString1 the aofStorageConnectionString1 value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withAofStorageConnectionString1(String aofStorageConnectionString1) { + this.aofStorageConnectionString1 = aofStorageConnectionString1; + return this; + } + + /** + * Get the maxfragmentationmemoryReserved property: Value in megabytes reserved for fragmentation per shard. + * + * @return the maxfragmentationmemoryReserved value. + */ + public String maxfragmentationmemoryReserved() { + return this.maxfragmentationmemoryReserved; + } + + /** + * Set the maxfragmentationmemoryReserved property: Value in megabytes reserved for fragmentation per shard. + * + * @param maxfragmentationmemoryReserved the maxfragmentationmemoryReserved value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withMaxfragmentationmemoryReserved( + String maxfragmentationmemoryReserved) { + this.maxfragmentationmemoryReserved = maxfragmentationmemoryReserved; + return this; + } + + /** + * Get the maxmemoryPolicy property: The eviction strategy used when your data won't fit within its memory limit. + * + * @return the maxmemoryPolicy value. + */ + public String maxmemoryPolicy() { + return this.maxmemoryPolicy; + } + + /** + * Set the maxmemoryPolicy property: The eviction strategy used when your data won't fit within its memory limit. + * + * @param maxmemoryPolicy the maxmemoryPolicy value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withMaxmemoryPolicy(String maxmemoryPolicy) { + this.maxmemoryPolicy = maxmemoryPolicy; + return this; + } + + /** + * Get the maxmemoryReserved property: Value in megabytes reserved for non-cache usage per shard e.g. failover. + * + * @return the maxmemoryReserved value. + */ + public String maxmemoryReserved() { + return this.maxmemoryReserved; + } + + /** + * Set the maxmemoryReserved property: Value in megabytes reserved for non-cache usage per shard e.g. failover. + * + * @param maxmemoryReserved the maxmemoryReserved value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withMaxmemoryReserved(String maxmemoryReserved) { + this.maxmemoryReserved = maxmemoryReserved; + return this; + } + + /** + * Get the maxmemoryDelta property: Value in megabytes reserved for non-cache usage per shard e.g. failover. + * + * @return the maxmemoryDelta value. + */ + public String maxmemoryDelta() { + return this.maxmemoryDelta; + } + + /** + * Set the maxmemoryDelta property: Value in megabytes reserved for non-cache usage per shard e.g. failover. + * + * @param maxmemoryDelta the maxmemoryDelta value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withMaxmemoryDelta(String maxmemoryDelta) { + this.maxmemoryDelta = maxmemoryDelta; + return this; + } + + /** + * Get the maxclients property: The max clients config. + * + * @return the maxclients value. + */ + public String maxclients() { + return this.maxclients; + } + + /** + * Get the preferredDataArchiveAuthMethod property: Preferred auth method to communicate to storage account used for + * data archive, specify SAS or ManagedIdentity, default value is SAS. + * + * @return the preferredDataArchiveAuthMethod value. + */ + public String preferredDataArchiveAuthMethod() { + return this.preferredDataArchiveAuthMethod; + } + + /** + * Get the preferredDataPersistenceAuthMethod property: Preferred auth method to communicate to storage account used + * for data persistence, specify SAS or ManagedIdentity, default value is SAS. + * + * @return the preferredDataPersistenceAuthMethod value. + */ + public String preferredDataPersistenceAuthMethod() { + return this.preferredDataPersistenceAuthMethod; + } + + /** + * Set the preferredDataPersistenceAuthMethod property: Preferred auth method to communicate to storage account used + * for data persistence, specify SAS or ManagedIdentity, default value is SAS. + * + * @param preferredDataPersistenceAuthMethod the preferredDataPersistenceAuthMethod value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withPreferredDataPersistenceAuthMethod( + String preferredDataPersistenceAuthMethod) { + this.preferredDataPersistenceAuthMethod = preferredDataPersistenceAuthMethod; + return this; + } + + /** + * Get the zonalConfiguration property: Zonal Configuration. + * + * @return the zonalConfiguration value. + */ + public String zonalConfiguration() { + return this.zonalConfiguration; + } + + /** + * Get the authnotrequired property: Specifies whether the authentication is disabled. Setting this property is + * highly discouraged from security point of view. + * + * @return the authnotrequired value. + */ + public String authnotrequired() { + return this.authnotrequired; + } + + /** + * Set the authnotrequired property: Specifies whether the authentication is disabled. Setting this property is + * highly discouraged from security point of view. + * + * @param authnotrequired the authnotrequired value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withAuthnotrequired(String authnotrequired) { + this.authnotrequired = authnotrequired; + return this; + } + + /** + * Get the additionalProperties property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param additionalProperties the additionalProperties value to set. + * @return the RedisCommonPropertiesRedisConfiguration object itself. + */ + public RedisCommonPropertiesRedisConfiguration withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, String value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCreateParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCreateParameters.java new file mode 100644 index 0000000000000..1e6086fcee6f2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisCreateParameters.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisCreateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Parameters supplied to the Create Redis operation. */ +@Fluent +public final class RedisCreateParameters { + /* + * Redis cache properties. + */ + @JsonProperty(value = "properties", required = true) + private RedisCreateProperties innerProperties = new RedisCreateProperties(); + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /** Creates an instance of RedisCreateParameters class. */ + public RedisCreateParameters() { + } + + /** + * Get the innerProperties property: Redis cache properties. + * + * @return the innerProperties value. + */ + private RedisCreateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + public Sku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the Redis cache to deploy. + * + * @param sku the sku value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withSku(Sku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + + /** + * Set the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @param subnetId the subnetId value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withSubnetId(String subnetId) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withSubnetId(subnetId); + return this; + } + + /** + * Get the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.innerProperties() == null ? null : this.innerProperties().staticIp(); + } + + /** + * Set the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * + * @param staticIp the staticIp value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withStaticIp(String staticIp) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withStaticIp(staticIp); + return this; + } + + /** + * Get the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().redisConfiguration(); + } + + /** + * Set the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param redisConfiguration the redisConfiguration value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withRedisConfiguration(redisConfiguration); + return this; + } + + /** + * Get the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); + } + + /** + * Set the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @param redisVersion the redisVersion value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withRedisVersion(String redisVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withRedisVersion(redisVersion); + return this; + } + + /** + * Get the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + public Boolean enableNonSslPort() { + return this.innerProperties() == null ? null : this.innerProperties().enableNonSslPort(); + } + + /** + * Set the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @param enableNonSslPort the enableNonSslPort value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withEnableNonSslPort(Boolean enableNonSslPort) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** + * Get the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + public Integer replicasPerMaster() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerMaster(); + } + + /** + * Set the replicasPerMaster property: The number of replicas to be created per primary. + * + * @param replicasPerMaster the replicasPerMaster value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withReplicasPerMaster(Integer replicasPerMaster) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** + * Get the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + public Integer replicasPerPrimary() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerPrimary(); + } + + /** + * Set the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @param replicasPerPrimary the replicasPerPrimary value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withReplicasPerPrimary(Integer replicasPerPrimary) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** + * Get the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + public Map tenantSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tenantSettings(); + } + + /** + * Set the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings the tenantSettings value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withTenantSettings(Map tenantSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withTenantSettings(tenantSettings); + return this; + } + + /** + * Get the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + public Integer shardCount() { + return this.innerProperties() == null ? null : this.innerProperties().shardCount(); + } + + /** + * Set the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @param shardCount the shardCount value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withShardCount(Integer shardCount) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withShardCount(shardCount); + return this; + } + + /** + * Get the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * 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'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().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'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RedisCreateParameters object itself. + */ + public RedisCreateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisCreateProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RedisCreateParameters")); + } else { + innerProperties().validate(); + } + if (location() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model RedisCreateParameters")); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisCreateParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRule.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRule.java new file mode 100644 index 0000000000000..9a57f713f5068 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRule.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** An immutable client-side representation of RedisFirewallRule. */ +public interface RedisFirewallRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the startIp property: lowest IP address included in the range. + * + * @return the startIp value. + */ + String startIp(); + + /** + * Gets the endIp property: highest IP address included in the range. + * + * @return the endIp value. + */ + String endIp(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner object. + * + * @return the inner object. + */ + RedisFirewallRuleInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleCreateParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleCreateParameters.java new file mode 100644 index 0000000000000..3025ce32b8a6a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleCreateParameters.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** + * Parameters required for creating a firewall rule on redis cache. (Note, you can just use the FirewallRule type + * instead now.). + */ +@Fluent +public final class RedisFirewallRuleCreateParameters extends RedisFirewallRuleInner { + /** Creates an instance of RedisFirewallRuleCreateParameters class. */ + public RedisFirewallRuleCreateParameters() { + } + + /** {@inheritDoc} */ + @Override + public RedisFirewallRuleCreateParameters withStartIp(String startIp) { + super.withStartIp(startIp); + return this; + } + + /** {@inheritDoc} */ + @Override + public RedisFirewallRuleCreateParameters withEndIp(String endIp) { + super.withEndIp(endIp); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleListResult.java new file mode 100644 index 0000000000000..0f2e285499b86 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisFirewallRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of list firewall rules Redis operation. */ +@Fluent +public final class RedisFirewallRuleListResult { + /* + * Results of the list firewall rules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RedisFirewallRuleListResult class. */ + public RedisFirewallRuleListResult() { + } + + /** + * Get the value property: Results of the list firewall rules operation. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisForceRebootResponse.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisForceRebootResponse.java new file mode 100644 index 0000000000000..0f3d609623bfc --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisForceRebootResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner; + +/** An immutable client-side representation of RedisForceRebootResponse. */ +public interface RedisForceRebootResponse { + /** + * Gets the message property: Status message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisForceRebootResponseInner object. + * + * @return the inner object. + */ + RedisForceRebootResponseInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisInstanceDetails.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisInstanceDetails.java new file mode 100644 index 0000000000000..c261a6f1fc608 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisInstanceDetails.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of single instance of redis. */ +@Immutable +public final class RedisInstanceDetails { + /* + * Redis instance SSL port. + */ + @JsonProperty(value = "sslPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer sslPort; + + /* + * If enableNonSslPort is true, provides Redis instance Non-SSL port. + */ + @JsonProperty(value = "nonSslPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer nonSslPort; + + /* + * If the Cache uses availability zones, specifies availability zone where this instance is located. + */ + @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) + private String zone; + + /* + * If clustering is enabled, the Shard ID of Redis Instance + */ + @JsonProperty(value = "shardId", access = JsonProperty.Access.WRITE_ONLY) + private Integer shardId; + + /* + * Specifies whether the instance is a primary node. + */ + @JsonProperty(value = "isMaster", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMaster; + + /* + * Specifies whether the instance is a primary node. + */ + @JsonProperty(value = "isPrimary", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isPrimary; + + /** Creates an instance of RedisInstanceDetails class. */ + public RedisInstanceDetails() { + } + + /** + * Get the sslPort property: Redis instance SSL port. + * + * @return the sslPort value. + */ + public Integer sslPort() { + return this.sslPort; + } + + /** + * Get the nonSslPort property: If enableNonSslPort is true, provides Redis instance Non-SSL port. + * + * @return the nonSslPort value. + */ + public Integer nonSslPort() { + return this.nonSslPort; + } + + /** + * Get the zone property: If the Cache uses availability zones, specifies availability zone where this instance is + * located. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Get the shardId property: If clustering is enabled, the Shard ID of Redis Instance. + * + * @return the shardId value. + */ + public Integer shardId() { + return this.shardId; + } + + /** + * Get the isMaster property: Specifies whether the instance is a primary node. + * + * @return the isMaster value. + */ + public Boolean isMaster() { + return this.isMaster; + } + + /** + * Get the isPrimary property: Specifies whether the instance is a primary node. + * + * @return the isPrimary value. + */ + public Boolean isPrimary() { + return this.isPrimary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisKeyType.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisKeyType.java new file mode 100644 index 0000000000000..5614dafa23e5c --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisKeyType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The Redis access key to regenerate. */ +public enum RedisKeyType { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a RedisKeyType instance. */ + private final String value; + + RedisKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RedisKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed RedisKeyType object, or null if unable to parse. + */ + @JsonCreator + public static RedisKeyType fromString(String value) { + if (value == null) { + return null; + } + RedisKeyType[] items = RedisKeyType.values(); + for (RedisKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServer.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServer.java new file mode 100644 index 0000000000000..46fd10475696f --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServer.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Linked server Id. */ +@Immutable +public final class RedisLinkedServer { + /* + * Linked server Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of RedisLinkedServer class. */ + public RedisLinkedServer() { + } + + /** + * Get the id property: Linked server Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerCreateParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerCreateParameters.java new file mode 100644 index 0000000000000..229e322c36b42 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerCreateParameters.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerCreateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameter required for creating a linked server to redis cache. */ +@Fluent +public final class RedisLinkedServerCreateParameters { + /* + * Properties required to create a linked server. + */ + @JsonProperty(value = "properties", required = true) + private RedisLinkedServerCreateProperties innerProperties = new RedisLinkedServerCreateProperties(); + + /** Creates an instance of RedisLinkedServerCreateParameters class. */ + public RedisLinkedServerCreateParameters() { + } + + /** + * Get the innerProperties property: Properties required to create a linked server. + * + * @return the innerProperties value. + */ + private RedisLinkedServerCreateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @return the linkedRedisCacheId value. + */ + public String linkedRedisCacheId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRedisCacheId(); + } + + /** + * Set the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @param linkedRedisCacheId the linkedRedisCacheId value to set. + * @return the RedisLinkedServerCreateParameters object itself. + */ + public RedisLinkedServerCreateParameters withLinkedRedisCacheId(String linkedRedisCacheId) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerCreateProperties(); + } + this.innerProperties().withLinkedRedisCacheId(linkedRedisCacheId); + return this; + } + + /** + * Get the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @return the linkedRedisCacheLocation value. + */ + public String linkedRedisCacheLocation() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRedisCacheLocation(); + } + + /** + * Set the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @param linkedRedisCacheLocation the linkedRedisCacheLocation value to set. + * @return the RedisLinkedServerCreateParameters object itself. + */ + public RedisLinkedServerCreateParameters withLinkedRedisCacheLocation(String linkedRedisCacheLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerCreateProperties(); + } + this.innerProperties().withLinkedRedisCacheLocation(linkedRedisCacheLocation); + return this; + } + + /** + * Get the serverRole property: Role of the linked server. + * + * @return the serverRole value. + */ + public ReplicationRole serverRole() { + return this.innerProperties() == null ? null : this.innerProperties().serverRole(); + } + + /** + * Set the serverRole property: Role of the linked server. + * + * @param serverRole the serverRole value to set. + * @return the RedisLinkedServerCreateParameters object itself. + */ + public RedisLinkedServerCreateParameters withServerRole(ReplicationRole serverRole) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisLinkedServerCreateProperties(); + } + this.innerProperties().withServerRole(serverRole); + return this; + } + + /** + * Get the geoReplicatedPrimaryHostname property: The unchanging DNS name which will always point to current + * geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * + * @return the geoReplicatedPrimaryHostname value. + */ + public String geoReplicatedPrimaryHostname() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplicatedPrimaryHostname(); + } + + /** + * Get the primaryHostname property: The changing DNS name that resolves to the current geo-primary cache among the + * linked redis caches before or after the Geo Failover. + * + * @return the primaryHostname value. + */ + public String primaryHostname() { + return this.innerProperties() == null ? null : this.innerProperties().primaryHostname(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RedisLinkedServerCreateParameters")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisLinkedServerCreateParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithProperties.java new file mode 100644 index 0000000000000..6e3ce303223aa --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; + +/** An immutable client-side representation of RedisLinkedServerWithProperties. */ +public interface RedisLinkedServerWithProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: Terminal state of the link between primary and secondary redis cache. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache. + * + * @return the linkedRedisCacheId value. + */ + String linkedRedisCacheId(); + + /** + * Gets the linkedRedisCacheLocation property: Location of the linked redis cache. + * + * @return the linkedRedisCacheLocation value. + */ + String linkedRedisCacheLocation(); + + /** + * Gets the serverRole property: Role of the linked server. + * + * @return the serverRole value. + */ + ReplicationRole serverRole(); + + /** + * Gets the geoReplicatedPrimaryHostname property: The unchanging DNS name which will always point to current + * geo-primary cache among the linked redis caches for seamless Geo Failover experience. + * + * @return the geoReplicatedPrimaryHostname value. + */ + String geoReplicatedPrimaryHostname(); + + /** + * Gets the primaryHostname property: The changing DNS name that resolves to the current geo-primary cache among the + * linked redis caches before or after the Geo Failover. + * + * @return the primaryHostname value. + */ + String primaryHostname(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner + * object. + * + * @return the inner object. + */ + RedisLinkedServerWithPropertiesInner innerModel(); + + /** The entirety of the RedisLinkedServerWithProperties definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithLinkedRedisCacheId, + DefinitionStages.WithLinkedRedisCacheLocation, + DefinitionStages.WithServerRole, + DefinitionStages.WithCreate { + } + /** The RedisLinkedServerWithProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the RedisLinkedServerWithProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RedisLinkedServerWithProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, name. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @return the next definition stage. + */ + WithLinkedRedisCacheId withExistingRedi(String resourceGroupName, String name); + } + /** The stage of the RedisLinkedServerWithProperties definition allowing to specify linkedRedisCacheId. */ + interface WithLinkedRedisCacheId { + /** + * Specifies the linkedRedisCacheId property: Fully qualified resourceId of the linked redis cache.. + * + * @param linkedRedisCacheId Fully qualified resourceId of the linked redis cache. + * @return the next definition stage. + */ + WithLinkedRedisCacheLocation withLinkedRedisCacheId(String linkedRedisCacheId); + } + /** The stage of the RedisLinkedServerWithProperties definition allowing to specify linkedRedisCacheLocation. */ + interface WithLinkedRedisCacheLocation { + /** + * Specifies the linkedRedisCacheLocation property: Location of the linked redis cache.. + * + * @param linkedRedisCacheLocation Location of the linked redis cache. + * @return the next definition stage. + */ + WithServerRole withLinkedRedisCacheLocation(String linkedRedisCacheLocation); + } + /** The stage of the RedisLinkedServerWithProperties definition allowing to specify serverRole. */ + interface WithServerRole { + /** + * Specifies the serverRole property: Role of the linked server.. + * + * @param serverRole Role of the linked server. + * @return the next definition stage. + */ + WithCreate withServerRole(ReplicationRole serverRole); + } + /** + * The stage of the RedisLinkedServerWithProperties definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + RedisLinkedServerWithProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RedisLinkedServerWithProperties create(Context context); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RedisLinkedServerWithProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RedisLinkedServerWithProperties refresh(Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithPropertiesList.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithPropertiesList.java new file mode 100644 index 0000000000000..66d54f851b009 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisLinkedServerWithPropertiesList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisLinkedServerWithPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of linked servers (with properties) of a Redis cache. */ +@Fluent +public final class RedisLinkedServerWithPropertiesList { + /* + * List of linked servers (with properties) of a Redis cache. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for next set. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RedisLinkedServerWithPropertiesList class. */ + public RedisLinkedServerWithPropertiesList() { + } + + /** + * Get the value property: List of linked servers (with properties) of a Redis cache. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisListResult.java new file mode 100644 index 0000000000000..de4df2d7d7590 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of list Redis operation. */ +@Fluent +public final class RedisListResult { + /* + * List of Redis cache instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RedisListResult class. */ + public RedisListResult() { + } + + /** + * Get the value property: List of Redis cache instances. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchSchedule.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchSchedule.java new file mode 100644 index 0000000000000..83762a57f67bb --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchSchedule.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import java.util.List; + +/** An immutable client-side representation of RedisPatchSchedule. */ +public interface RedisPatchSchedule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the scheduleEntries property: List of patch schedules for a Redis cache. + * + * @return the scheduleEntries value. + */ + List scheduleEntries(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner object. + * + * @return the inner object. + */ + RedisPatchScheduleInner innerModel(); + + /** The entirety of the RedisPatchSchedule definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithScheduleEntries, + DefinitionStages.WithCreate { + } + /** The RedisPatchSchedule definition stages. */ + interface DefinitionStages { + /** The first stage of the RedisPatchSchedule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RedisPatchSchedule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, name. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the Redis cache. + * @return the next definition stage. + */ + WithScheduleEntries withExistingRedi(String resourceGroupName, String name); + } + /** The stage of the RedisPatchSchedule definition allowing to specify scheduleEntries. */ + interface WithScheduleEntries { + /** + * Specifies the scheduleEntries property: List of patch schedules for a Redis cache.. + * + * @param scheduleEntries List of patch schedules for a Redis cache. + * @return the next definition stage. + */ + WithCreate withScheduleEntries(List scheduleEntries); + } + /** + * The stage of the RedisPatchSchedule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + RedisPatchSchedule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RedisPatchSchedule create(Context context); + } + } + /** + * Begins update for the RedisPatchSchedule resource. + * + * @return the stage of resource update. + */ + RedisPatchSchedule.Update update(); + + /** The template for RedisPatchSchedule update. */ + interface Update extends UpdateStages.WithScheduleEntries { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RedisPatchSchedule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RedisPatchSchedule apply(Context context); + } + /** The RedisPatchSchedule update stages. */ + interface UpdateStages { + /** The stage of the RedisPatchSchedule update allowing to specify scheduleEntries. */ + interface WithScheduleEntries { + /** + * Specifies the scheduleEntries property: List of patch schedules for a Redis cache.. + * + * @param scheduleEntries List of patch schedules for a Redis cache. + * @return the next definition stage. + */ + Update withScheduleEntries(List scheduleEntries); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RedisPatchSchedule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RedisPatchSchedule refresh(Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchScheduleListResult.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchScheduleListResult.java new file mode 100644 index 0000000000000..a68d36da966cd --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisPatchScheduleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPatchScheduleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of list patch schedules Redis operation. */ +@Fluent +public final class RedisPatchScheduleListResult { + /* + * Results of the list patch schedules operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link for next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RedisPatchScheduleListResult class. */ + public RedisPatchScheduleListResult() { + } + + /** + * Get the value property: Results of the list patch schedules operation. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisProperties.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisProperties.java new file mode 100644 index 0000000000000..3cf5d291bf5be --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisProperties.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.RedisPropertiesInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RedisProperties. */ +public interface RedisProperties { + /** + * Gets the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + RedisCommonPropertiesRedisConfiguration redisConfiguration(); + + /** + * Gets the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + String redisVersion(); + + /** + * Gets the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + Boolean enableNonSslPort(); + + /** + * Gets the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + Integer replicasPerMaster(); + + /** + * Gets the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + Integer replicasPerPrimary(); + + /** + * Gets the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + Map tenantSettings(); + + /** + * Gets the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + Integer shardCount(); + + /** + * Gets the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + TlsVersion minimumTlsVersion(); + + /** + * Gets 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'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside + * an existing Azure Virtual Network; auto assigned by default. + * + * @return the staticIp value. + */ + String staticIp(); + + /** + * Gets the provisioningState property: Redis instance provisioning status. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the hostname property: Redis host name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the port property: Redis non-SSL port. + * + * @return the port value. + */ + Integer port(); + + /** + * Gets the sslPort property: Redis SSL port. + * + * @return the sslPort value. + */ + Integer sslPort(); + + /** + * Gets the accessKeys property: The keys of the Redis cache - not set if this object is not the response to Create + * or Update redis cache. + * + * @return the accessKeys value. + */ + RedisAccessKeys accessKeys(); + + /** + * Gets the linkedServers property: List of the linked servers associated with the cache. + * + * @return the linkedServers value. + */ + List linkedServers(); + + /** + * Gets the instances property: List of the Redis instances associated with the cache. + * + * @return the instances value. + */ + List instances(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * redis cache. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisPropertiesInner object. + * + * @return the inner object. + */ + RedisPropertiesInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRebootParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRebootParameters.java new file mode 100644 index 0000000000000..6d0de84a572ed --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRebootParameters.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies which Redis node(s) to reboot. */ +@Fluent +public final class RedisRebootParameters { + /* + * Which Redis node(s) to reboot. Depending on this value data loss is possible. + */ + @JsonProperty(value = "rebootType") + private RebootType rebootType; + + /* + * If clustering is enabled, the ID of the shard to be rebooted. + */ + @JsonProperty(value = "shardId") + private Integer shardId; + + /* + * A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL ports. + */ + @JsonProperty(value = "ports") + private List ports; + + /** Creates an instance of RedisRebootParameters class. */ + public RedisRebootParameters() { + } + + /** + * Get the rebootType property: Which Redis node(s) to reboot. Depending on this value data loss is possible. + * + * @return the rebootType value. + */ + public RebootType rebootType() { + return this.rebootType; + } + + /** + * Set the rebootType property: Which Redis node(s) to reboot. Depending on this value data loss is possible. + * + * @param rebootType the rebootType value to set. + * @return the RedisRebootParameters object itself. + */ + public RedisRebootParameters withRebootType(RebootType rebootType) { + this.rebootType = rebootType; + return this; + } + + /** + * Get the shardId property: If clustering is enabled, the ID of the shard to be rebooted. + * + * @return the shardId value. + */ + public Integer shardId() { + return this.shardId; + } + + /** + * Set the shardId property: If clustering is enabled, the ID of the shard to be rebooted. + * + * @param shardId the shardId value to set. + * @return the RedisRebootParameters object itself. + */ + public RedisRebootParameters withShardId(Integer shardId) { + this.shardId = shardId; + return this; + } + + /** + * Get the ports property: A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL + * ports. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL + * ports. + * + * @param ports the ports value to set. + * @return the RedisRebootParameters object itself. + */ + public RedisRebootParameters withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRegenerateKeyParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRegenerateKeyParameters.java new file mode 100644 index 0000000000000..e360efc2c6f49 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisRegenerateKeyParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies which Redis access keys to reset. */ +@Fluent +public final class RedisRegenerateKeyParameters { + /* + * The Redis access key to regenerate. + */ + @JsonProperty(value = "keyType", required = true) + private RedisKeyType keyType; + + /** Creates an instance of RedisRegenerateKeyParameters class. */ + public RedisRegenerateKeyParameters() { + } + + /** + * Get the keyType property: The Redis access key to regenerate. + * + * @return the keyType value. + */ + public RedisKeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The Redis access key to regenerate. + * + * @param keyType the keyType value to set. + * @return the RedisRegenerateKeyParameters object itself. + */ + public RedisRegenerateKeyParameters withKeyType(RedisKeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RedisRegenerateKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedisRegenerateKeyParameters.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisResource.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisResource.java new file mode 100644 index 0000000000000..41701c6292a87 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisResource.java @@ -0,0 +1,791 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RedisResource. */ +public interface RedisResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the provisioningState property: Redis instance provisioning status. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the hostname property: Redis host name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the port property: Redis non-SSL port. + * + * @return the port value. + */ + Integer port(); + + /** + * Gets the sslPort property: Redis SSL port. + * + * @return the sslPort value. + */ + Integer sslPort(); + + /** + * Gets the accessKeys property: The keys of the Redis cache - not set if this object is not the response to Create + * or Update redis cache. + * + * @return the accessKeys value. + */ + RedisAccessKeys accessKeys(); + + /** + * Gets the linkedServers property: List of the linked servers associated with the cache. + * + * @return the linkedServers value. + */ + List linkedServers(); + + /** + * Gets the instances property: List of the Redis instances associated with the cache. + * + * @return the instances value. + */ + List instances(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * redis cache. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the subnetId property: The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis cache inside + * an existing Azure Virtual Network; auto assigned by default. + * + * @return the staticIp value. + */ + String staticIp(); + + /** + * Gets the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + RedisCommonPropertiesRedisConfiguration redisConfiguration(); + + /** + * Gets the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + String redisVersion(); + + /** + * Gets the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + Boolean enableNonSslPort(); + + /** + * Gets the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + Integer replicasPerMaster(); + + /** + * Gets the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + Integer replicasPerPrimary(); + + /** + * Gets the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + Map tenantSettings(); + + /** + * Gets the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + Integer shardCount(); + + /** + * Gets the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + TlsVersion minimumTlsVersion(); + + /** + * Gets 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'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.RedisResourceInner object. + * + * @return the inner object. + */ + RedisResourceInner innerModel(); + + /** The entirety of the RedisResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The RedisResource definition stages. */ + interface DefinitionStages { + /** The first stage of the RedisResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RedisResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the RedisResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the RedisResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the Redis cache to deploy.. + * + * @param sku The SKU of the Redis cache to deploy. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the RedisResource definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithSubnetId, + DefinitionStages.WithStaticIp, + DefinitionStages.WithRedisConfiguration, + DefinitionStages.WithRedisVersion, + DefinitionStages.WithEnableNonSslPort, + DefinitionStages.WithReplicasPerMaster, + DefinitionStages.WithReplicasPerPrimary, + DefinitionStages.WithTenantSettings, + DefinitionStages.WithShardCount, + DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithPublicNetworkAccess { + /** + * Executes the create request. + * + * @return the created resource. + */ + RedisResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RedisResource create(Context context); + } + /** The stage of the RedisResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the RedisResource definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the RedisResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the RedisResource definition allowing to specify subnetId. */ + interface WithSubnetId { + /** + * Specifies the subnetId property: The full resource ID of a subnet in a virtual network to deploy the + * Redis cache in. Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * + * @param subnetId The full resource ID of a subnet in a virtual network to deploy the Redis cache in. + * Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + * @return the next definition stage. + */ + WithCreate withSubnetId(String subnetId); + } + /** The stage of the RedisResource definition allowing to specify staticIp. */ + interface WithStaticIp { + /** + * Specifies the staticIp property: Static IP address. Optionally, may be specified when deploying a Redis + * cache inside an existing Azure Virtual Network; auto assigned by default.. + * + * @param staticIp Static IP address. Optionally, may be specified when deploying a Redis cache inside an + * existing Azure Virtual Network; auto assigned by default. + * @return the next definition stage. + */ + WithCreate withStaticIp(String staticIp); + } + /** The stage of the RedisResource definition allowing to specify redisConfiguration. */ + interface WithRedisConfiguration { + /** + * Specifies the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc.. + * + * @param redisConfiguration All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * @return the next definition stage. + */ + WithCreate withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration); + } + /** The stage of the RedisResource definition allowing to specify redisVersion. */ + interface WithRedisVersion { + /** + * Specifies the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only + * 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is + * available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.. + * + * @param redisVersion Redis version. This should be in the form 'major[.minor]' (only 'major' is required) + * or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * @return the next definition stage. + */ + WithCreate withRedisVersion(String redisVersion); + } + /** The stage of the RedisResource definition allowing to specify enableNonSslPort. */ + interface WithEnableNonSslPort { + /** + * Specifies the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is + * enabled.. + * + * @param enableNonSslPort Specifies whether the non-ssl Redis server port (6379) is enabled. + * @return the next definition stage. + */ + WithCreate withEnableNonSslPort(Boolean enableNonSslPort); + } + /** The stage of the RedisResource definition allowing to specify replicasPerMaster. */ + interface WithReplicasPerMaster { + /** + * Specifies the replicasPerMaster property: The number of replicas to be created per primary.. + * + * @param replicasPerMaster The number of replicas to be created per primary. + * @return the next definition stage. + */ + WithCreate withReplicasPerMaster(Integer replicasPerMaster); + } + /** The stage of the RedisResource definition allowing to specify replicasPerPrimary. */ + interface WithReplicasPerPrimary { + /** + * Specifies the replicasPerPrimary property: The number of replicas to be created per primary.. + * + * @param replicasPerPrimary The number of replicas to be created per primary. + * @return the next definition stage. + */ + WithCreate withReplicasPerPrimary(Integer replicasPerPrimary); + } + /** The stage of the RedisResource definition allowing to specify tenantSettings. */ + interface WithTenantSettings { + /** + * Specifies the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings A dictionary of tenant settings. + * @return the next definition stage. + */ + WithCreate withTenantSettings(Map tenantSettings); + } + /** The stage of the RedisResource definition allowing to specify shardCount. */ + interface WithShardCount { + /** + * Specifies the shardCount property: The number of shards to be created on a Premium Cluster Cache.. + * + * @param shardCount The number of shards to be created on a Premium Cluster Cache. + * @return the next definition stage. + */ + WithCreate withShardCount(Integer shardCount); + } + /** The stage of the RedisResource definition allowing to specify minimumTlsVersion. */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or + * higher) to connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion Optional: requires clients to use a specified TLS version (or higher) to connect + * (e,g, '1.0', '1.1', '1.2'). + * @return the next definition stage. + */ + WithCreate withMinimumTlsVersion(TlsVersion minimumTlsVersion); + } + /** The stage of the RedisResource definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies 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'. + * + * @param publicNetworkAccess 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'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + } + /** + * Begins update for the RedisResource resource. + * + * @return the stage of resource update. + */ + RedisResource.Update update(); + + /** The template for RedisResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithRedisConfiguration, + UpdateStages.WithRedisVersion, + UpdateStages.WithEnableNonSslPort, + UpdateStages.WithReplicasPerMaster, + UpdateStages.WithReplicasPerPrimary, + UpdateStages.WithTenantSettings, + UpdateStages.WithShardCount, + UpdateStages.WithMinimumTlsVersion, + UpdateStages.WithPublicNetworkAccess { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RedisResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RedisResource apply(Context context); + } + /** The RedisResource update stages. */ + interface UpdateStages { + /** The stage of the RedisResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the RedisResource update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the RedisResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the Redis cache to deploy.. + * + * @param sku The SKU of the Redis cache to deploy. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the RedisResource update allowing to specify redisConfiguration. */ + interface WithRedisConfiguration { + /** + * Specifies the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc.. + * + * @param redisConfiguration All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * @return the next definition stage. + */ + Update withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration); + } + /** The stage of the RedisResource update allowing to specify redisVersion. */ + interface WithRedisVersion { + /** + * Specifies the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only + * 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is + * available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.. + * + * @param redisVersion Redis version. This should be in the form 'major[.minor]' (only 'major' is required) + * or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * @return the next definition stage. + */ + Update withRedisVersion(String redisVersion); + } + /** The stage of the RedisResource update allowing to specify enableNonSslPort. */ + interface WithEnableNonSslPort { + /** + * Specifies the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is + * enabled.. + * + * @param enableNonSslPort Specifies whether the non-ssl Redis server port (6379) is enabled. + * @return the next definition stage. + */ + Update withEnableNonSslPort(Boolean enableNonSslPort); + } + /** The stage of the RedisResource update allowing to specify replicasPerMaster. */ + interface WithReplicasPerMaster { + /** + * Specifies the replicasPerMaster property: The number of replicas to be created per primary.. + * + * @param replicasPerMaster The number of replicas to be created per primary. + * @return the next definition stage. + */ + Update withReplicasPerMaster(Integer replicasPerMaster); + } + /** The stage of the RedisResource update allowing to specify replicasPerPrimary. */ + interface WithReplicasPerPrimary { + /** + * Specifies the replicasPerPrimary property: The number of replicas to be created per primary.. + * + * @param replicasPerPrimary The number of replicas to be created per primary. + * @return the next definition stage. + */ + Update withReplicasPerPrimary(Integer replicasPerPrimary); + } + /** The stage of the RedisResource update allowing to specify tenantSettings. */ + interface WithTenantSettings { + /** + * Specifies the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings A dictionary of tenant settings. + * @return the next definition stage. + */ + Update withTenantSettings(Map tenantSettings); + } + /** The stage of the RedisResource update allowing to specify shardCount. */ + interface WithShardCount { + /** + * Specifies the shardCount property: The number of shards to be created on a Premium Cluster Cache.. + * + * @param shardCount The number of shards to be created on a Premium Cluster Cache. + * @return the next definition stage. + */ + Update withShardCount(Integer shardCount); + } + /** The stage of the RedisResource update allowing to specify minimumTlsVersion. */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or + * higher) to connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion Optional: requires clients to use a specified TLS version (or higher) to connect + * (e,g, '1.0', '1.1', '1.2'). + * @return the next definition stage. + */ + Update withMinimumTlsVersion(TlsVersion minimumTlsVersion); + } + /** The stage of the RedisResource update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies 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'. + * + * @param publicNetworkAccess 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'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RedisResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RedisResource refresh(Context context); + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys along with {@link Response}. + */ + Response listKeysWithResponse(Context context); + + /** + * Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @throws com.azure.core.management.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 redis cache access keys. + */ + RedisAccessKeys listKeys(); + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param parameters Specifies which key to regenerate. + * @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 redis cache access keys along with {@link Response}. + */ + Response regenerateKeyWithResponse(RedisRegenerateKeyParameters parameters, Context context); + + /** + * Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return redis cache access keys. + */ + RedisAccessKeys regenerateKey(RedisRegenerateKeyParameters parameters); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache along with {@link Response}. + */ + Response forceRebootWithResponse(RedisRebootParameters parameters, Context context); + + /** + * Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be + * potential data loss. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response to force reboot for Redis cache. + */ + RedisForceRebootResponse forceReboot(RedisRebootParameters parameters); + + /** + * Import data into Redis cache. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importData(ImportRdbParameters parameters); + + /** + * Import data into Redis cache. + * + * @param parameters Parameters for Redis import operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importData(ImportRdbParameters parameters, Context context); + + /** + * Export data from the redis cache to blobs in a container. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void exportData(ExportRdbParameters parameters); + + /** + * Export data from the redis cache to blobs in a container. + * + * @param parameters Parameters for Redis export operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void exportData(ExportRdbParameters parameters, Context context); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisUpdateParameters.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisUpdateParameters.java new file mode 100644 index 0000000000000..1fe07e3ab82ca --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/RedisUpdateParameters.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters supplied to the Update Redis operation. */ +@Fluent +public final class RedisUpdateParameters { + /* + * Redis cache properties. + */ + @JsonProperty(value = "properties") + private RedisUpdateProperties innerProperties; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /** Creates an instance of RedisUpdateParameters class. */ + public RedisUpdateParameters() { + } + + /** + * Get the innerProperties property: Redis cache properties. + * + * @return the innerProperties value. + */ + private RedisUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: The SKU of the Redis cache to deploy. + * + * @return the sku value. + */ + public Sku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the Redis cache to deploy. + * + * @param sku the sku value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withSku(Sku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @return the redisConfiguration value. + */ + public RedisCommonPropertiesRedisConfiguration redisConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().redisConfiguration(); + } + + /** + * Set the redisConfiguration property: All Redis Settings. Few possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param redisConfiguration the redisConfiguration value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withRedisConfiguration(RedisCommonPropertiesRedisConfiguration redisConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withRedisConfiguration(redisConfiguration); + return this; + } + + /** + * Get the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); + } + + /** + * Set the redisVersion property: Redis version. This should be in the form 'major[.minor]' (only 'major' is + * required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported + * versions: 4.0, 6.0 (latest). Default value is 'latest'. + * + * @param redisVersion the redisVersion value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withRedisVersion(String redisVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withRedisVersion(redisVersion); + return this; + } + + /** + * Get the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @return the enableNonSslPort value. + */ + public Boolean enableNonSslPort() { + return this.innerProperties() == null ? null : this.innerProperties().enableNonSslPort(); + } + + /** + * Set the enableNonSslPort property: Specifies whether the non-ssl Redis server port (6379) is enabled. + * + * @param enableNonSslPort the enableNonSslPort value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withEnableNonSslPort(Boolean enableNonSslPort) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withEnableNonSslPort(enableNonSslPort); + return this; + } + + /** + * Get the replicasPerMaster property: The number of replicas to be created per primary. + * + * @return the replicasPerMaster value. + */ + public Integer replicasPerMaster() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerMaster(); + } + + /** + * Set the replicasPerMaster property: The number of replicas to be created per primary. + * + * @param replicasPerMaster the replicasPerMaster value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withReplicasPerMaster(Integer replicasPerMaster) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withReplicasPerMaster(replicasPerMaster); + return this; + } + + /** + * Get the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @return the replicasPerPrimary value. + */ + public Integer replicasPerPrimary() { + return this.innerProperties() == null ? null : this.innerProperties().replicasPerPrimary(); + } + + /** + * Set the replicasPerPrimary property: The number of replicas to be created per primary. + * + * @param replicasPerPrimary the replicasPerPrimary value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withReplicasPerPrimary(Integer replicasPerPrimary) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withReplicasPerPrimary(replicasPerPrimary); + return this; + } + + /** + * Get the tenantSettings property: A dictionary of tenant settings. + * + * @return the tenantSettings value. + */ + public Map tenantSettings() { + return this.innerProperties() == null ? null : this.innerProperties().tenantSettings(); + } + + /** + * Set the tenantSettings property: A dictionary of tenant settings. + * + * @param tenantSettings the tenantSettings value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withTenantSettings(Map tenantSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withTenantSettings(tenantSettings); + return this; + } + + /** + * Get the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @return the shardCount value. + */ + public Integer shardCount() { + return this.innerProperties() == null ? null : this.innerProperties().shardCount(); + } + + /** + * Set the shardCount property: The number of shards to be created on a Premium Cluster Cache. + * + * @param shardCount the shardCount value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withShardCount(Integer shardCount) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withShardCount(shardCount); + return this; + } + + /** + * Get the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Optional: requires clients to use a specified TLS version (or higher) to + * connect (e,g, '1.0', '1.1', '1.2'). + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * 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'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().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'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RedisUpdateParameters object itself. + */ + public RedisUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RedisUpdateProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ReplicationRole.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ReplicationRole.java new file mode 100644 index 0000000000000..ec171bdc3906b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ReplicationRole.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Role of the linked server. */ +public enum ReplicationRole { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a ReplicationRole instance. */ + private final String value; + + ReplicationRole(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReplicationRole instance. + * + * @param value the serialized value to parse. + * @return the parsed ReplicationRole object, or null if unable to parse. + */ + @JsonCreator + public static ReplicationRole fromString(String value) { + if (value == null) { + return null; + } + ReplicationRole[] items = ReplicationRole.values(); + for (ReplicationRole item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ScheduleEntry.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ScheduleEntry.java new file mode 100644 index 0000000000000..c27033b116f19 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/ScheduleEntry.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Patch schedule entry for a Premium Redis Cache. */ +@Fluent +public final class ScheduleEntry { + /* + * Day of the week when a cache can be patched. + */ + @JsonProperty(value = "dayOfWeek", required = true) + private DayOfWeek dayOfWeek; + + /* + * Start hour after which cache patching can start. + */ + @JsonProperty(value = "startHourUtc", required = true) + private int startHourUtc; + + /* + * ISO8601 timespan specifying how much time cache patching can take. + */ + @JsonProperty(value = "maintenanceWindow") + private Duration maintenanceWindow; + + /** Creates an instance of ScheduleEntry class. */ + public ScheduleEntry() { + } + + /** + * Get the dayOfWeek property: Day of the week when a cache can be patched. + * + * @return the dayOfWeek value. + */ + public DayOfWeek dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: Day of the week when a cache can be patched. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the ScheduleEntry object itself. + */ + public ScheduleEntry withDayOfWeek(DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Get the startHourUtc property: Start hour after which cache patching can start. + * + * @return the startHourUtc value. + */ + public int startHourUtc() { + return this.startHourUtc; + } + + /** + * Set the startHourUtc property: Start hour after which cache patching can start. + * + * @param startHourUtc the startHourUtc value to set. + * @return the ScheduleEntry object itself. + */ + public ScheduleEntry withStartHourUtc(int startHourUtc) { + this.startHourUtc = startHourUtc; + return this; + } + + /** + * Get the maintenanceWindow property: ISO8601 timespan specifying how much time cache patching can take. + * + * @return the maintenanceWindow value. + */ + public Duration maintenanceWindow() { + return this.maintenanceWindow; + } + + /** + * Set the maintenanceWindow property: ISO8601 timespan specifying how much time cache patching can take. + * + * @param maintenanceWindow the maintenanceWindow value to set. + * @return the ScheduleEntry object itself. + */ + public ScheduleEntry withMaintenanceWindow(Duration maintenanceWindow) { + this.maintenanceWindow = maintenanceWindow; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dayOfWeek() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property dayOfWeek in model ScheduleEntry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduleEntry.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Sku.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Sku.java new file mode 100644 index 0000000000000..5fff26182cdf6 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/Sku.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU parameters supplied to the create Redis operation. */ +@Fluent +public final class Sku { + /* + * The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium) + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). + */ + @JsonProperty(value = "family", required = true) + private SkuFamily family; + + /* + * The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). + */ + @JsonProperty(value = "capacity", required = true) + private int capacity; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the family property: The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). + * + * @return the family value. + */ + public SkuFamily family() { + return this.family; + } + + /** + * Set the family property: The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(SkuFamily family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, + * 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). + * + * @return the capacity value. + */ + public int capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, + * 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(int capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + if (family() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuFamily.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuFamily.java new file mode 100644 index 0000000000000..7ee2904fec23b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuFamily.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). */ +public final class SkuFamily extends ExpandableStringEnum { + /** Static value C for SkuFamily. */ + public static final SkuFamily C = fromString("C"); + + /** Static value P for SkuFamily. */ + public static final SkuFamily P = fromString("P"); + + /** + * Creates or finds a SkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuFamily. + */ + @JsonCreator + public static SkuFamily fromString(String name) { + return fromString(name, SkuFamily.class); + } + + /** + * Gets known SkuFamily values. + * + * @return known SkuFamily values. + */ + public static Collection values() { + return values(SkuFamily.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuName.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuName.java new file mode 100644 index 0000000000000..9272d422d9860 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/SkuName.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/TlsVersion.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/TlsVersion.java new file mode 100644 index 0000000000000..5bf332bc55e91 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/TlsVersion.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). */ +public final class TlsVersion extends ExpandableStringEnum { + /** Static value 1.0 for TlsVersion. */ + public static final TlsVersion ONE_ZERO = fromString("1.0"); + + /** Static value 1.1 for TlsVersion. */ + public static final TlsVersion ONE_ONE = fromString("1.1"); + + /** Static value 1.2 for TlsVersion. */ + public static final TlsVersion ONE_TWO = fromString("1.2"); + + /** + * Creates or finds a TlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsVersion. + */ + @JsonCreator + public static TlsVersion fromString(String name) { + return fromString(name, TlsVersion.class); + } + + /** + * Gets known TlsVersion values. + * + * @return known TlsVersion values. + */ + public static Collection values() { + return values(TlsVersion.class); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UpgradeNotification.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UpgradeNotification.java new file mode 100644 index 0000000000000..71f256e0d2aab --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UpgradeNotification.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of UpgradeNotification. */ +public interface UpgradeNotification { + /** + * Gets the name property: Name of upgrade notification. + * + * @return the name value. + */ + String name(); + + /** + * Gets the timestamp property: Timestamp when upgrade notification occurred. + * + * @return the timestamp value. + */ + OffsetDateTime timestamp(); + + /** + * Gets the upsellNotification property: Details about this upgrade notification. + * + * @return the upsellNotification value. + */ + Map upsellNotification(); + + /** + * Gets the inner com.azure.resourcemanager.redis.generated.fluent.models.UpgradeNotificationInner object. + * + * @return the inner object. + */ + UpgradeNotificationInner innerModel(); +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UserAssignedIdentity.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..35ee9d3f886ed --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/package-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/package-info.java new file mode 100644 index 0000000000000..7201289cc110e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for RedisManagementClient. REST API for Azure Redis Cache Service. */ +package com.azure.resourcemanager.redis.generated.models; diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/package-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/package-info.java new file mode 100644 index 0000000000000..6172bde75d267 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/com/azure/resourcemanager/redis/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for RedisManagementClient. REST API for Azure Redis Cache Service. */ +package com.azure.resourcemanager.redis.generated; diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/module-info.java b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..7318ce37ef1f6 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.redis.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.redis.generated; + exports com.azure.resourcemanager.redis.generated.fluent; + exports com.azure.resourcemanager.redis.generated.fluent.models; + exports com.azure.resourcemanager.redis.generated.models; + + opens com.azure.resourcemanager.redis.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.redis.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/AsyncOperationStatusGetSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/AsyncOperationStatusGetSamples.java new file mode 100644 index 0000000000000..d9f40f42a23c2 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/AsyncOperationStatusGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AsyncOperationStatus Get. */ +public final class AsyncOperationStatusGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheAsyncOperationStatus.json + */ + /** + * Sample code: RedisCacheAsyncOperationStatus. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheAsyncOperationStatus(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.asyncOperationStatus().getWithResponse("East US", "c7ba2bf5-5939-4d79-b037-2964ccf097da", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..548dc6e040f85 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.fluent.models.RedisFirewallRuleInner; + +/** Samples for FirewallRules CreateOrUpdate. */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleCreate.json + */ + /** + * Sample code: RedisCacheFirewallRuleCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .firewallRules() + .createOrUpdateWithResponse( + "rg1", + "cache1", + "rule1", + new RedisFirewallRuleInner().withStartIp("192.168.1.1").withEndIp("192.168.1.4"), + Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesDeleteSamples.java new file mode 100644 index 0000000000000..5c840e8f568aa --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FirewallRules Delete. */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleDelete.json + */ + /** + * Sample code: RedisCacheFirewallRuleDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().deleteWithResponse("rg1", "cache1", "rule1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesGetSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesGetSamples.java new file mode 100644 index 0000000000000..b6be28d51187e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FirewallRules Get. */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRuleGet.json + */ + /** + * Sample code: RedisCacheFirewallRuleGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRuleGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().getWithResponse("rg1", "cache1", "rule1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesListSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesListSamples.java new file mode 100644 index 0000000000000..8048836244234 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/FirewallRulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FirewallRules List. */ +public final class FirewallRulesListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheFirewallRulesList.json + */ + /** + * Sample code: RedisCacheFirewallRulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheFirewallRulesList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.firewallRules().list("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerCreateSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerCreateSamples.java new file mode 100644 index 0000000000000..49cffade0a21e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.resourcemanager.redis.generated.models.ReplicationRole; + +/** Samples for LinkedServer Create. */ +public final class LinkedServerCreateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Create.json + */ + /** + * Sample code: LinkedServer_Create. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .linkedServers() + .define("cache2") + .withExistingRedi("rg1", "cache1") + .withLinkedRedisCacheId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2") + .withLinkedRedisCacheLocation("West US") + .withServerRole(ReplicationRole.SECONDARY) + .create(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerDeleteSamples.java new file mode 100644 index 0000000000000..c7ea2a7b65789 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServer Delete. */ +public final class LinkedServerDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Delete.json + */ + /** + * Sample code: LinkedServerDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().delete("rg1", "cache1", "cache2", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerGetSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerGetSamples.java new file mode 100644 index 0000000000000..35a11aa327a57 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServer Get. */ +public final class LinkedServerGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_Get.json + */ + /** + * Sample code: LinkedServer_Get. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().getWithResponse("rg1", "cache1", "cache2", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerListSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerListSamples.java new file mode 100644 index 0000000000000..b8cc2dbb2422e --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/LinkedServerListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LinkedServer List. */ +public final class LinkedServerListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheLinkedServer_List.json + */ + /** + * Sample code: LinkedServer_List. + * + * @param manager Entry point to RedisManager. + */ + public static void linkedServerList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.linkedServers().list("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/OperationsListSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..d1c7786ce386d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheOperations.json + */ + /** + * Sample code: RedisCacheOperations. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheOperations(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesCreateOrUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a393c86ad4d8a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.resourcemanager.redis.generated.models.DayOfWeek; +import com.azure.resourcemanager.redis.generated.models.DefaultName; +import com.azure.resourcemanager.redis.generated.models.ScheduleEntry; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for PatchSchedules CreateOrUpdate. */ +public final class PatchSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json + */ + /** + * Sample code: RedisCachePatchSchedulesCreateOrUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesCreateOrUpdate( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .patchSchedules() + .define(DefaultName.DEFAULT) + .withExistingRedi("rg1", "cache1") + .withScheduleEntries( + Arrays + .asList( + new ScheduleEntry() + .withDayOfWeek(DayOfWeek.MONDAY) + .withStartHourUtc(12) + .withMaintenanceWindow(Duration.parse("PT5H")), + new ScheduleEntry().withDayOfWeek(DayOfWeek.TUESDAY).withStartHourUtc(12))) + .create(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesDeleteSamples.java new file mode 100644 index 0000000000000..e73ecd6ce4f92 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.DefaultName; + +/** Samples for PatchSchedules Delete. */ +public final class PatchSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesDelete.json + */ + /** + * Sample code: RedisCachePatchSchedulesDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().deleteWithResponse("rg1", "cache1", DefaultName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesGetSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesGetSamples.java new file mode 100644 index 0000000000000..e2d76c2c4b4f5 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.DefaultName; + +/** Samples for PatchSchedules Get. */ +public final class PatchSchedulesGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesGet.json + */ + /** + * Sample code: RedisCachePatchSchedulesGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().getWithResponse("rg1", "cache1", DefaultName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesListByRedisResourceSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesListByRedisResourceSamples.java new file mode 100644 index 0000000000000..adcd6954ede2d --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PatchSchedulesListByRedisResourceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PatchSchedules ListByRedisResource. */ +public final class PatchSchedulesListByRedisResourceSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePatchSchedulesList.json + */ + /** + * Sample code: RedisCachePatchSchedulesList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePatchSchedulesList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.patchSchedules().listByRedisResource("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..48073935e5976 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDeletePrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rgtest01", "cachetest01", "pectest01", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a3dfa506775b4 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCacheGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGetPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().getWithResponse("rgtest01", "cachetest01", "pectest01", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..05630a4c556b6 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisCacheListPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateEndpointConnections().list("rgtest01", "cachetest01", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..2c0eafe0273cf --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.resourcemanager.redis.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redis.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCachePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisCachePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCachePutPrivateEndpointConnection( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .privateEndpointConnections() + .define("pectest01") + .withExistingRedi("rgtest01", "cachetest01") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateLinkResourcesListByRedisCacheSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateLinkResourcesListByRedisCacheSamples.java new file mode 100644 index 0000000000000..ce62a698449f8 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/PrivateLinkResourcesListByRedisCacheSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByRedisCache. */ +public final class PrivateLinkResourcesListByRedisCacheSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to RedisManager. + */ + public static void storageAccountListPrivateLinkResources( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.privateLinkResources().listByRedisCache("rgtest01", "cacheTest01", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCheckNameAvailabilitySamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..5949b2079ac19 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCheckNameAvailabilitySamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.CheckNameAvailabilityParameters; + +/** Samples for Redis CheckNameAvailability. */ +public final class RedisCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCheckNameAvailability.json + */ + /** + * Sample code: RedisCacheCheckNameAvailability. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCheckNameAvailability(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityParameters().withName("cacheName").withType("Microsoft.Cache/Redis"), + Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCreateSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCreateSamples.java new file mode 100644 index 0000000000000..5ddaadfcd6d3a --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisCreateSamples.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.resourcemanager.redis.generated.models.RedisCommonPropertiesRedisConfiguration; +import com.azure.resourcemanager.redis.generated.models.Sku; +import com.azure.resourcemanager.redis.generated.models.SkuFamily; +import com.azure.resourcemanager.redis.generated.models.SkuName; +import com.azure.resourcemanager.redis.generated.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Redis Create. */ +public final class RedisCreateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreate.json + */ + /** + * Sample code: RedisCacheCreate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withRedisVersion("4") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreateDefaultVersion.json + */ + /** + * Sample code: RedisCacheCreateDefaultVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateDefaultVersion(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheCreateLatestVersion.json + */ + /** + * Sample code: RedisCacheCreateLatestVersion. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheCreateLatestVersion(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .define("cache1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.PREMIUM).withFamily(SkuFamily.P).withCapacity(1)) + .withZones(Arrays.asList("1")) + .withSubnetId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1") + .withStaticIp("192.168.0.5") + .withRedisConfiguration( + new RedisCommonPropertiesRedisConfiguration() + .withMaxmemoryPolicy("allkeys-lru") + .withAdditionalProperties(mapOf())) + .withRedisVersion("Latest") + .withEnableNonSslPort(true) + .withReplicasPerPrimary(2) + .withShardCount(2) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisDeleteSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisDeleteSamples.java new file mode 100644 index 0000000000000..26143a6c3fa97 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis Delete. */ +public final class RedisDeleteSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheDelete.json + */ + /** + * Sample code: RedisCacheDelete. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheDelete(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().delete("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisExportDataSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisExportDataSamples.java new file mode 100644 index 0000000000000..4ab05a0b1a718 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisExportDataSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.ExportRdbParameters; + +/** Samples for Redis ExportData. */ +public final class RedisExportDataSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheExport.json + */ + /** + * Sample code: RedisCacheExport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheExport(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .exportData( + "rg1", + "cache1", + new ExportRdbParameters() + .withFormat("RDB") + .withPrefix("datadump1") + .withContainer("https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters"), + Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisForceRebootSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisForceRebootSamples.java new file mode 100644 index 0000000000000..8ba4ebe465288 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisForceRebootSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RebootType; +import com.azure.resourcemanager.redis.generated.models.RedisRebootParameters; +import java.util.Arrays; + +/** Samples for Redis ForceReboot. */ +public final class RedisForceRebootSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheForceReboot.json + */ + /** + * Sample code: RedisCacheForceReboot. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheForceReboot(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .forceRebootWithResponse( + "rg1", + "cache1", + new RedisRebootParameters() + .withRebootType(RebootType.ALL_NODES) + .withShardId(0) + .withPorts(Arrays.asList(13000, 15001)), + Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisGetByResourceGroupSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..50bb53e6892f1 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis GetByResourceGroup. */ +public final class RedisGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheGet.json + */ + /** + * Sample code: RedisCacheGet. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheGet(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisImportDataSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisImportDataSamples.java new file mode 100644 index 0000000000000..a86b5c3775d31 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisImportDataSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.ImportRdbParameters; +import java.util.Arrays; + +/** Samples for Redis ImportData. */ +public final class RedisImportDataSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheImport.json + */ + /** + * Sample code: RedisCacheImport. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheImport(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .importData( + "rg1", + "cache1", + new ImportRdbParameters() + .withFormat("RDB") + .withFiles(Arrays.asList("http://fileuris.contoso.com/pathtofile1")), + Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListByResourceGroupSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListByResourceGroupSamples.java new file mode 100644 index 0000000000000..f567321a36fc6 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis ListByResourceGroup. */ +public final class RedisListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListByResourceGroup.json + */ + /** + * Sample code: RedisCacheListByResourceGroup. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListByResourceGroup(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListKeysSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListKeysSamples.java new file mode 100644 index 0000000000000..9080b80e5c117 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis ListKeys. */ +public final class RedisListKeysSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListKeys.json + */ + /** + * Sample code: RedisCacheListKeys. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListKeys(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listKeysWithResponse("rg1", "cache1", Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListSamples.java new file mode 100644 index 0000000000000..760b78f404cfc --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis List. */ +public final class RedisListSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheList.json + */ + /** + * Sample code: RedisCacheList. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheList(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().list(Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListUpgradeNotificationsSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListUpgradeNotificationsSamples.java new file mode 100644 index 0000000000000..62b26bde170ca --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisListUpgradeNotificationsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Redis ListUpgradeNotifications. */ +public final class RedisListUpgradeNotificationsSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheListUpgradeNotifications.json + */ + /** + * Sample code: RedisCacheListUpgradeNotifications. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheListUpgradeNotifications( + com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager.redis().listUpgradeNotifications("rg1", "cache1", 5000.0, Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisRegenerateKeySamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisRegenerateKeySamples.java new file mode 100644 index 0000000000000..e21b4692ed2f0 --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisRegenerateKeySamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RedisKeyType; +import com.azure.resourcemanager.redis.generated.models.RedisRegenerateKeyParameters; + +/** Samples for Redis RegenerateKey. */ +public final class RedisRegenerateKeySamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheRegenerateKey.json + */ + /** + * Sample code: RedisCacheRegenerateKey. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheRegenerateKey(com.azure.resourcemanager.redis.generated.RedisManager manager) { + manager + .redis() + .regenerateKeyWithResponse( + "rg1", "cache1", new RedisRegenerateKeyParameters().withKeyType(RedisKeyType.PRIMARY), Context.NONE); + } +} diff --git a/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisUpdateSamples.java b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisUpdateSamples.java new file mode 100644 index 0000000000000..9919ac7fd063b --- /dev/null +++ b/sdk/redis/azure-resourcemanager-redis-generated/src/samples/java/com/azure/resourcemanager/redis/generated/generated/RedisUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redis.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redis.generated.models.RedisResource; + +/** Samples for Redis Update. */ +public final class RedisUpdateSamples { + /* + * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2022-06-01/examples/RedisCacheUpdate.json + */ + /** + * Sample code: RedisCacheUpdate. + * + * @param manager Entry point to RedisManager. + */ + public static void redisCacheUpdate(com.azure.resourcemanager.redis.generated.RedisManager manager) { + RedisResource resource = + manager.redis().getByResourceGroupWithResponse("rg1", "cache1", Context.NONE).getValue(); + resource.update().withEnableNonSslPort(true).withReplicasPerPrimary(2).apply(); + } +} diff --git a/sdk/redis/ci.yml b/sdk/redis/ci.yml new file mode 100644 index 0000000000000..1fb12ae903df8 --- /dev/null +++ b/sdk/redis/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.yml + - sdk/redis/azure-resourcemanager-redis-generated/ + exclude: + - sdk/redis/pom.xml + - sdk/redis/azure-resourcemanager-redis-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.yml + - sdk/redis/azure-resourcemanager-redis-generated/ + exclude: + - sdk/redis/pom.xml + - sdk/redis/azure-resourcemanager-redis-generated/pom.xml + +parameters: + - name: release_azureresourcemanagerredisgenerated + displayName: azure-resourcemanager-redis-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: redis + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-redis-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerredisgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerredisgenerated }} diff --git a/sdk/redis/pom.xml b/sdk/redis/pom.xml new file mode 100644 index 0000000000000..42cb196679685 --- /dev/null +++ b/sdk/redis/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-redis-service + pom + 1.0.0 + + + azure-resourcemanager-redis-generated + +