diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index bb19e5b0c9e84..caf69f98c3f4f 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -70,6 +70,7 @@ com.azure.resourcemanager:azure-resourcemanager-containerregistry;2.0.0-beta.3;2
com.azure.resourcemanager:azure-resourcemanager-containerservice;2.0.0-beta.3;2.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-cosmos;2.0.0-beta.3;2.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-dns;2.0.0-beta.3;2.0.0-beta.4
+com.azure.resourcemanager:azure-resourcemanager-eventhubs;2.0.0-beta.4;2.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-keyvault;2.0.0-beta.3;2.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-monitor;2.0.0-beta.3;2.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-msi;2.0.0-beta.3;2.0.0-beta.4
diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json
index 6ead679f99b17..21ecac279c1d1 100644
--- a/sdk/resourcemanager/api-specs.json
+++ b/sdk/resourcemanager/api-specs.json
@@ -154,10 +154,10 @@
"package": "com.azure.resourcemanager.dns",
"args": "--payload-flattening-threshold=1 --tag=package-2018-03-preview"
},
- "eventhub": {
- "dir": "azure-resourcemanager-eventhub",
+ "eventhubs": {
+ "dir": "azure-resourcemanager-eventhubs",
"source": "specification/eventhub/resource-manager/readme.md",
- "package": "com.microsoft.azure.resourcemanager.eventhub",
+ "package": "com.azure.resourcemanager.eventhubs",
"args": "--payload-flattening-threshold=1 --tag=package-2017-04"
},
"features": {
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-eventhubs/CHANGELOG.md
new file mode 100644
index 0000000000000..003c434ede62c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 2.0.0-beta.4 (Unreleased)
+
+- TODO
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/README.md b/sdk/resourcemanager/azure-resourcemanager-eventhubs/README.md
new file mode 100644
index 0000000000000..1e41c42c56388
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/README.md
@@ -0,0 +1,42 @@
+# Azure Resource Manager EventHubs client library for Java
+
+Azure Resource Manager EventHubs client library for Java
+
+For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azure-sdk-java-mgmt).
+
+## Getting started
+
+### Prerequisites
+
+- Java Development Kit (JDK) with version 8 or above
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-eventhubs;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-eventhubs
+ 2.0.0-beta.4
+
+```
+[//]: # ({x-version-update-end})
+
+## Key concepts
+
+## Examples
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft
+Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html).
+
+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
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml b/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml
new file mode 100644
index 0000000000000..2a1ce1af63f82
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml
@@ -0,0 +1,135 @@
+
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-eventhubs
+ 2.0.0-beta.4
+ jar
+
+ Microsoft Azure SDK for EventHubs Management
+ This package contains Microsoft Azure EventHubs Management SDK. For documentation on how to use this package, please see https://aka.ms/azure-sdk-java-mgmt
+ 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
+ HEAD
+
+
+
+
+ 0.10
+ 0.10
+
+
+
+
+ microsoft
+ Microsoft
+
+
+
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-resources
+ 2.0.0-beta.4
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-storage
+ 2.0.0-beta.4
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.6.2
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.6.2
+ test
+
+
+ com.azure
+ azure-core-http-netty
+ 1.5.4
+ test
+
+
+ com.azure
+ azure-identity
+ 1.1.0
+ test
+
+
+
+
+ azure-mgmt-sdk-test-jar
+
+
+ !maven.test.skip
+
+
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-resources
+ 2.0.0-beta.4
+ test-jar
+ test
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.1.2
+
+
+
+ true
+ true
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.5
+
+
+ com/azure/resourcemanager/**/fluent/**/*
+ com/azure/resourcemanager/**/models/**/*
+
+
+
+
+
+
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClient.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClient.java
new file mode 100644
index 0000000000000..8c5484367cf92
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClient.java
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.resourcemanager.eventhubs.fluent.ConsumerGroupsClient;
+import com.azure.resourcemanager.eventhubs.fluent.DisasterRecoveryConfigsClient;
+import com.azure.resourcemanager.eventhubs.fluent.EventHubsClient;
+import com.azure.resourcemanager.eventhubs.fluent.NamespacesClient;
+import com.azure.resourcemanager.eventhubs.fluent.OperationsClient;
+import com.azure.resourcemanager.eventhubs.fluent.RegionsClient;
+import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient;
+import java.time.Duration;
+
+/** Initializes a new instance of the EventHubManagementClient type. */
+@ServiceClient(builder = EventHubManagementClientBuilder.class)
+public final class EventHubManagementClient extends AzureServiceClient {
+ private final ClientLogger logger = new ClientLogger(EventHubManagementClient.class);
+
+ /**
+ * Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of
+ * the URI for every service call.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets Subscription credentials that uniquely identify a 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.
+ */
+ public 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 NamespacesClient object to access its operations. */
+ private final NamespacesClient namespaces;
+
+ /**
+ * Gets the NamespacesClient object to access its operations.
+ *
+ * @return the NamespacesClient object.
+ */
+ public NamespacesClient getNamespaces() {
+ return this.namespaces;
+ }
+
+ /** The DisasterRecoveryConfigsClient object to access its operations. */
+ private final DisasterRecoveryConfigsClient disasterRecoveryConfigs;
+
+ /**
+ * Gets the DisasterRecoveryConfigsClient object to access its operations.
+ *
+ * @return the DisasterRecoveryConfigsClient object.
+ */
+ public DisasterRecoveryConfigsClient getDisasterRecoveryConfigs() {
+ return this.disasterRecoveryConfigs;
+ }
+
+ /** The EventHubsClient object to access its operations. */
+ private final EventHubsClient eventHubs;
+
+ /**
+ * Gets the EventHubsClient object to access its operations.
+ *
+ * @return the EventHubsClient object.
+ */
+ public EventHubsClient getEventHubs() {
+ return this.eventHubs;
+ }
+
+ /** The ConsumerGroupsClient object to access its operations. */
+ private final ConsumerGroupsClient consumerGroups;
+
+ /**
+ * Gets the ConsumerGroupsClient object to access its operations.
+ *
+ * @return the ConsumerGroupsClient object.
+ */
+ public ConsumerGroupsClient getConsumerGroups() {
+ return this.consumerGroups;
+ }
+
+ /** 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 RegionsClient object to access its operations. */
+ private final RegionsClient regions;
+
+ /**
+ * Gets the RegionsClient object to access its operations.
+ *
+ * @return the RegionsClient object.
+ */
+ public RegionsClient getRegions() {
+ return this.regions;
+ }
+
+ /**
+ * Initializes an instance of EventHubManagementClient 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.
+ */
+ EventHubManagementClient(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ super(httpPipeline, serializerAdapter, environment);
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2017-04-01";
+ this.namespaces = new NamespacesClient(this);
+ this.disasterRecoveryConfigs = new DisasterRecoveryConfigsClient(this);
+ this.eventHubs = new EventHubsClient(this);
+ this.consumerGroups = new ConsumerGroupsClient(this);
+ this.operations = new OperationsClient(this);
+ this.regions = new RegionsClient(this);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClientBuilder.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClientBuilder.java
new file mode 100644
index 0000000000000..541ca6cde51af
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubManagementClientBuilder.java
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.CookiePolicy;
+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.AzureJacksonAdapter;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the EventHubManagementClient type. */
+@ServiceClientBuilder(serviceClients = {EventHubManagementClient.class})
+public final class EventHubManagementClientBuilder {
+ /*
+ * Subscription credentials that uniquely identify a Microsoft Azure
+ * subscription. The subscription ID forms part of the URI for every
+ * service call.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms
+ * part of the URI for every service call.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder 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 EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ 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 EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ 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 EventHubManagementClientBuilder.
+ */
+ public EventHubManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /**
+ * Builds an instance of EventHubManagementClient with the provided parameters.
+ *
+ * @return an instance of EventHubManagementClient.
+ */
+ public EventHubManagementClient buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (pipeline == null) {
+ this.pipeline =
+ new HttpPipelineBuilder()
+ .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
+ .build();
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = new AzureJacksonAdapter();
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ EventHubManagementClient client =
+ new EventHubManagementClient(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java
new file mode 100644
index 0000000000000..6941b51a29272
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/EventHubsManager.java
@@ -0,0 +1,192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.resourcemanager.eventhubs;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpPipeline;
+import com.azure.resourcemanager.eventhubs.implementation.DisasterRecoveryPairingAuthorizationRulesImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubAuthorizationRulesImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubConsumerGroupsImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubDisasterRecoveryPairingsImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubNamespaceAuthorizationRulesImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubNamespacesImpl;
+import com.azure.resourcemanager.eventhubs.implementation.EventHubsImpl;
+import com.azure.resourcemanager.eventhubs.models.DisasterRecoveryPairingAuthorizationRules;
+import com.azure.resourcemanager.eventhubs.models.EventHubAuthorizationRules;
+import com.azure.resourcemanager.eventhubs.models.EventHubConsumerGroups;
+import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings;
+import com.azure.resourcemanager.eventhubs.models.EventHubNamespaceAuthorizationRules;
+import com.azure.resourcemanager.eventhubs.models.EventHubNamespaces;
+import com.azure.resourcemanager.eventhubs.models.EventHubs;
+import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable;
+import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
+import com.azure.resourcemanager.resources.fluentcore.arm.implementation.Manager;
+import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile;
+import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider;
+import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext;
+import com.azure.resourcemanager.storage.StorageManager;
+
+/**
+ * Entry point to Azure EventHub resource management.
+ */
+public final class EventHubsManager extends Manager {
+ private EventHubNamespaces namespaces;
+ private EventHubs eventHubs;
+ private EventHubConsumerGroups consumerGroups;
+ private EventHubAuthorizationRules eventHubAuthorizationRules;
+ private EventHubNamespaceAuthorizationRules namespaceAuthorizationRules;
+ private EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings;
+ private DisasterRecoveryPairingAuthorizationRules disasterRecoveryPairingAuthorizationRules;
+
+ private final StorageManager storageManager;
+
+ /**
+ * Get a Configurable instance that can be used to create EventHubsManager with optional configuration.
+ *
+ * @return the instance allowing configurations
+ */
+ public static Configurable configure() {
+ return new EventHubsManager.ConfigurableImpl();
+ }
+
+ /**
+ * Creates an instance of EventHubsManager that exposes EventHub resource management API entry points.
+ *
+ * @param credential the credential to use
+ * @param profile the profile to use
+ * @return the EventHubsManager
+ */
+ public static EventHubsManager authenticate(TokenCredential credential, AzureProfile profile) {
+ return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile);
+ }
+
+ /**
+ * Creates an instance of EventHubsManager that exposes EventHub resource management API entry points.
+ *
+ * @param httpPipeline the HttpPipeline to be used for API calls.
+ * @param profile the profile to use
+ * @return the EventHubsManager
+ */
+ public static EventHubsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
+ return authenticate(httpPipeline, profile, new SdkContext());
+ }
+
+ /**
+ * Creates an instance of EventHubsManager that exposes EventHub resource management API entry points.
+ *
+ * @param httpPipeline the HttpPipeline to be used for API calls.
+ * @param profile the profile to use
+ * @param sdkContext the sdk context
+ * @return the EventHubsManager
+ */
+ public static EventHubsManager authenticate(
+ HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) {
+ return new EventHubsManager(httpPipeline, profile, sdkContext);
+ }
+
+ /**
+ * The interface allowing configurations to be set.
+ */
+ public interface Configurable extends AzureConfigurable {
+ /**
+ * Creates an instance of EventHubsManager that exposes EventHub management API entry points.
+ *
+ * @param credential the credential to use
+ * @param profile the profile to use
+ * @return the interface exposing EventHub management API entry points that work across subscriptions
+ */
+ EventHubsManager authenticate(TokenCredential credential, AzureProfile profile);
+ }
+ /**
+ * The implementation for Configurable interface.
+ */
+ private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable {
+ public EventHubsManager authenticate(TokenCredential credential, AzureProfile profile) {
+ return EventHubsManager.authenticate(buildHttpPipeline(credential, profile), profile);
+ }
+ }
+ private EventHubsManager(HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) {
+ super(
+ httpPipeline,
+ profile,
+ new EventHubManagementClientBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.environment().getResourceManagerEndpoint())
+ .subscriptionId(profile.subscriptionId())
+ .buildClient(),
+ sdkContext
+ );
+ storageManager = StorageManager.authenticate(httpPipeline, profile, sdkContext);
+ }
+
+ /**
+ * @return entry point to manage EventHub namespaces
+ */
+ public EventHubNamespaces namespaces() {
+ if (this.namespaces == null) {
+ this.namespaces = new EventHubNamespacesImpl(this);
+ }
+ return this.namespaces;
+ }
+
+ /**
+ * @return entry point to manage event hubs
+ */
+ public EventHubs eventHubs() {
+ if (this.eventHubs == null) {
+ this.eventHubs = new EventHubsImpl(this, this.storageManager);
+ }
+ return this.eventHubs;
+ }
+
+ /**
+ * @return entry point to manage event hub consumer groups
+ */
+ public EventHubConsumerGroups consumerGroups() {
+ if (this.consumerGroups == null) {
+ this.consumerGroups = new EventHubConsumerGroupsImpl(this);
+ }
+ return this.consumerGroups;
+ }
+
+ /**
+ * @return entry point to manage disaster recovery pairing of event hub namespaces.
+ */
+ public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings() {
+ if (this.eventHubDisasterRecoveryPairings == null) {
+ this.eventHubDisasterRecoveryPairings = new EventHubDisasterRecoveryPairingsImpl(this);
+ }
+ return this.eventHubDisasterRecoveryPairings;
+ }
+
+ /**
+ * @return entry point to manage event hub authorization rules.
+ */
+ public EventHubAuthorizationRules eventHubAuthorizationRules() {
+ if (this.eventHubAuthorizationRules == null) {
+ this.eventHubAuthorizationRules = new EventHubAuthorizationRulesImpl(this);
+ }
+ return this.eventHubAuthorizationRules;
+ }
+
+ /**
+ * @return entry point to manage event hub namespace authorization rules.
+ */
+ public EventHubNamespaceAuthorizationRules namespaceAuthorizationRules() {
+ if (this.namespaceAuthorizationRules == null) {
+ this.namespaceAuthorizationRules = new EventHubNamespaceAuthorizationRulesImpl(this);
+ }
+ return this.namespaceAuthorizationRules;
+ }
+
+ /**
+ * @return entry point to manage disaster recovery pairing authorization rules.
+ */
+ public DisasterRecoveryPairingAuthorizationRules disasterRecoveryPairingAuthorizationRules() {
+ if (this.disasterRecoveryPairingAuthorizationRules == null) {
+ this.disasterRecoveryPairingAuthorizationRules = new DisasterRecoveryPairingAuthorizationRulesImpl(this);
+ }
+ return this.disasterRecoveryPairingAuthorizationRules;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java
new file mode 100644
index 0000000000000..07ed795016fba
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/ConsumerGroupsClient.java
@@ -0,0 +1,1149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.fluent;
+
+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.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.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.eventhubs.EventHubManagementClient;
+import com.azure.resourcemanager.eventhubs.fluent.inner.ConsumerGroupInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.ConsumerGroupListResultInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ConsumerGroups. */
+public final class ConsumerGroupsClient {
+ private final ClientLogger logger = new ClientLogger(ConsumerGroupsClient.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final ConsumerGroupsService service;
+
+ /** The service client containing this operation class. */
+ private final EventHubManagementClient client;
+
+ /**
+ * Initializes an instance of ConsumerGroupsClient.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ public ConsumerGroupsClient(EventHubManagementClient client) {
+ this.service =
+ RestProxy.create(ConsumerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for EventHubManagementClientConsumerGroups to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "EventHubManagementCl")
+ private interface ConsumerGroupsService {
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("consumerGroupName") String consumerGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") ConsumerGroupInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("consumerGroupName") String consumerGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("consumerGroupName") String consumerGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/consumergroups")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByEventHub(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("$skip") Integer skip,
+ @QueryParam("$top") Integer top,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByEventHubNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ ConsumerGroupInner parameters = new ConsumerGroupInner();
+ parameters.withUserMetadata(userMetadata);
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @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 single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ ConsumerGroupInner parameters = new ConsumerGroupInner();
+ parameters.withUserMetadata(userMetadata);
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata) {
+ return createOrUpdateWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @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 single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata,
+ Context context) {
+ return createOrUpdateWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConsumerGroupInner createOrUpdate(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata) {
+ return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata)
+ .block();
+ }
+
+ /**
+ * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @param userMetadata User Metadata is a placeholder to store user-defined string data with maximum length 1024.
+ * e.g. it can be used to store descriptive data, such as list of teams and their contact information also
+ * user-defined configuration settings can be stored.
+ * @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 single item in List or Get Consumer group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConsumerGroupInner createOrUpdate(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ String userMetadata,
+ Context context) {
+ return createOrUpdateAsync(
+ resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata, context)
+ .block();
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ Context context) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 namespaceName, String eventHubName, String consumerGroupName) {
+ deleteAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block();
+ }
+
+ /**
+ * Deletes a consumer group from the specified Event Hub and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ Context context) {
+ deleteAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context).block();
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (consumerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter consumerGroupName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ consumerGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ Context context) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConsumerGroupInner get(
+ String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
+ return getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName).block();
+ }
+
+ /**
+ * Gets a description for the specified consumer group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param consumerGroupName The consumer group name.
+ * @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 description for the specified consumer group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConsumerGroupInner get(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String consumerGroupName,
+ Context context) {
+ return getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, context).block();
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByEventHubSinglePageAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByEventHub(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ skip,
+ top,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByEventHubSinglePageAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ Integer skip,
+ Integer top,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listByEventHub(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ skip,
+ top,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByEventHubAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) {
+ return new PagedFlux<>(
+ () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top),
+ nextLink -> listByEventHubNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByEventHubAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ Integer skip,
+ Integer top,
+ Context context) {
+ return new PagedFlux<>(
+ () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top, context),
+ nextLink -> listByEventHubNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByEventHubAsync(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ final Integer skip = null;
+ final Integer top = null;
+ final Context context = null;
+ return new PagedFlux<>(
+ () -> listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top),
+ nextLink -> listByEventHubNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByEventHub(
+ String resourceGroupName, String namespaceName, String eventHubName, Integer skip, Integer top) {
+ return new PagedIterable<>(listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByEventHub(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ Integer skip,
+ Integer top,
+ Context context) {
+ return new PagedIterable<>(
+ listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top, context));
+ }
+
+ /**
+ * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the
+ * Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the consumer groups in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByEventHub(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ final Integer skip = null;
+ final Integer top = null;
+ final Context context = null;
+ return new PagedIterable<>(listByEventHubAsync(resourceGroupName, namespaceName, eventHubName, skip, top));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 result to the List Consumer Group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByEventHubNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(context -> service.listByEventHubNext(nextLink, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 result to the List Consumer Group operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByEventHubNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listByEventHubNext(nextLink, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java
new file mode 100644
index 0000000000000..9a6f7bbce26f9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/DisasterRecoveryConfigsClient.java
@@ -0,0 +1,2212 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.fluent;
+
+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.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.eventhubs.EventHubManagementClient;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AccessKeysInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.ArmDisasterRecoveryInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.ArmDisasterRecoveryListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DisasterRecoveryConfigs. */
+public final class DisasterRecoveryConfigsClient {
+ private final ClientLogger logger = new ClientLogger(DisasterRecoveryConfigsClient.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final DisasterRecoveryConfigsService service;
+
+ /** The service client containing this operation class. */
+ private final EventHubManagementClient client;
+
+ /**
+ * Initializes an instance of DisasterRecoveryConfigsClient.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ public DisasterRecoveryConfigsClient(EventHubManagementClient client) {
+ this.service =
+ RestProxy
+ .create(DisasterRecoveryConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for EventHubManagementClientDisasterRecoveryConfigs to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "EventHubManagementCl")
+ private interface DisasterRecoveryConfigsService {
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRules(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}"
+ + "/listKeys")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listKeys(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkNameAvailability(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @BodyParam("application/json") CheckNameAvailabilityParameter parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") ArmDisasterRecoveryInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> breakPairing(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/disasterRecoveryConfigs/{alias}/failover")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> failOver(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("alias") String alias,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRulesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName, String alias) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName, String alias, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName, String alias) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName, String alias, Context context) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias, context),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName, String alias) {
+ return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName, String alias, Context context) {
+ return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, alias, context));
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .getAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) {
+ return getAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, alias, authorizationRuleName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner getAuthorizationRule(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block();
+ }
+
+ /**
+ * Gets an AuthorizationRule for a Namespace by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for a Namespace by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner getAuthorizationRule(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) {
+ return getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context)
+ .block();
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listKeysWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listKeysWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listKeysAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listKeysAsync(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) {
+ return listKeysWithResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner listKeys(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).block();
+ }
+
+ /**
+ * Gets the primary and secondary connection strings for the Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 primary and secondary connection strings for the Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner listKeys(
+ String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, Context context) {
+ return listKeysAsync(resourceGroupName, namespaceName, alias, authorizationRuleName, context).block();
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> checkNameAvailabilityWithResponseAsync(
+ String resourceGroupName, String namespaceName, String name) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (name == null) {
+ return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));
+ }
+ CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter();
+ parameters.withName(name);
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .checkNameAvailability(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ namespaceName,
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @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 Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> checkNameAvailabilityWithResponseAsync(
+ String resourceGroupName, String namespaceName, String name, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (name == null) {
+ return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));
+ }
+ CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter();
+ parameters.withName(name);
+ context = this.client.mergeContext(context);
+ return service
+ .checkNameAvailability(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ namespaceName,
+ parameters,
+ context);
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono checkNameAvailabilityAsync(
+ String resourceGroupName, String namespaceName, String name) {
+ return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, name)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @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 Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono checkNameAvailabilityAsync(
+ String resourceGroupName, String namespaceName, String name, Context context) {
+ return checkNameAvailabilityWithResponseAsync(resourceGroupName, namespaceName, name, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CheckNameAvailabilityResultInner checkNameAvailability(
+ String resourceGroupName, String namespaceName, String name) {
+ return checkNameAvailabilityAsync(resourceGroupName, namespaceName, name).block();
+ }
+
+ /**
+ * Check the give Namespace name availability.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param name Name to check the namespace name availability.
+ * @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 Result of the CheckNameAvailability operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CheckNameAvailabilityResultInner checkNameAvailability(
+ String resourceGroupName, String namespaceName, String name, Context context) {
+ return checkNameAvailabilityAsync(resourceGroupName, namespaceName, name, context).block();
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listSinglePageAsync(
+ String resourceGroupName, String namespaceName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listSinglePageAsync(
+ String resourceGroupName, String namespaceName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(String resourceGroupName, String namespaceName) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, namespaceName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(
+ String resourceGroupName, String namespaceName, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, namespaceName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String namespaceName) {
+ return new PagedIterable<>(listAsync(resourceGroupName, namespaceName));
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 Alias(Disaster Recovery configurations).
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName, String namespaceName, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, namespaceName, context));
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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();
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String alias,
+ ArmDisasterRecoveryInner 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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();
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String alias,
+ ArmDisasterRecoveryInner parameters,
+ Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, alias, parameters, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ArmDisasterRecoveryInner createOrUpdate(
+ String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
+ return createOrUpdateAsync(resourceGroupName, namespaceName, alias, parameters).block();
+ }
+
+ /**
+ * Creates or updates a new Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @param parameters Single item in List or Get Alias(Disaster Recovery configuration) 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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ArmDisasterRecoveryInner createOrUpdate(
+ String resourceGroupName,
+ String namespaceName,
+ String alias,
+ ArmDisasterRecoveryInner parameters,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, namespaceName, alias, parameters, context).block();
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String alias) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String resourceGroupName, String namespaceName, String alias) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, alias)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String resourceGroupName, String namespaceName, String alias, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, alias, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 namespaceName, String alias) {
+ deleteAsync(resourceGroupName, namespaceName, alias).block();
+ }
+
+ /**
+ * Deletes an Alias(Disaster Recovery configuration).
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 namespaceName, String alias, Context context) {
+ deleteAsync(resourceGroupName, namespaceName, alias, context).block();
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String resourceGroupName, String namespaceName, String alias) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, alias)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName, String namespaceName, String alias, Context context) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, alias, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) {
+ return getAsync(resourceGroupName, namespaceName, alias).block();
+ }
+
+ /**
+ * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 single item in List or Get Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias, Context context) {
+ return getAsync(resourceGroupName, namespaceName, alias, context).block();
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> breakPairingWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .breakPairing(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> breakPairingWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .breakPairing(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono breakPairingAsync(String resourceGroupName, String namespaceName, String alias) {
+ return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono breakPairingAsync(String resourceGroupName, String namespaceName, String alias, Context context) {
+ return breakPairingWithResponseAsync(resourceGroupName, namespaceName, alias, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 breakPairing(String resourceGroupName, String namespaceName, String alias) {
+ breakPairingAsync(resourceGroupName, namespaceName, alias).block();
+ }
+
+ /**
+ * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 breakPairing(String resourceGroupName, String namespaceName, String alias, Context context) {
+ breakPairingAsync(resourceGroupName, namespaceName, alias, context).block();
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> failOverWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .failOver(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> failOverWithResponseAsync(
+ String resourceGroupName, String namespaceName, String alias, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (alias == null) {
+ return Mono.error(new IllegalArgumentException("Parameter alias 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .failOver(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ alias,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono failOverAsync(String resourceGroupName, String namespaceName, String alias) {
+ return failOverWithResponseAsync(resourceGroupName, namespaceName, alias)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono failOverAsync(String resourceGroupName, String namespaceName, String alias, Context context) {
+ return failOverWithResponseAsync(resourceGroupName, namespaceName, alias, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 failOver(String resourceGroupName, String namespaceName, String alias) {
+ failOverAsync(resourceGroupName, namespaceName, alias).block();
+ }
+
+ /**
+ * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param alias The Disaster Recovery configuration name.
+ * @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 failOver(String resourceGroupName, String namespaceName, String alias, Context context) {
+ failOverAsync(resourceGroupName, namespaceName, alias, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 from the List namespace operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(context -> service.listAuthorizationRulesNext(nextLink, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 from the List namespace operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listAuthorizationRulesNext(nextLink, 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 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 result of the List Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 result of the List Alias(Disaster Recovery configuration) operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java
new file mode 100644
index 0000000000000..cacb2687bedf3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/EventHubsClient.java
@@ -0,0 +1,2505 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.fluent;
+
+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.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.eventhubs.EventHubManagementClient;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AccessKeysInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.EventHubListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.EventhubInner;
+import com.azure.resourcemanager.eventhubs.models.AccessRights;
+import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters;
+import java.util.List;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in EventHubs. */
+public final class EventHubsClient {
+ private final ClientLogger logger = new ClientLogger(EventHubsClient.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final EventHubsService service;
+
+ /** The service client containing this operation class. */
+ private final EventHubManagementClient client;
+
+ /**
+ * Initializes an instance of EventHubsClient.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ public EventHubsClient(EventHubManagementClient client) {
+ this.service =
+ RestProxy.create(EventHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for EventHubManagementClientEventHubs to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "EventHubManagementCl")
+ private interface EventHubsService {
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRules(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdateAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") AuthorizationRuleInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> deleteAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listKeys(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> regenerateKeys(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") RegenerateAccessKeyParameters parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByNamespace(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("$skip") Integer skip,
+ @QueryParam("$top") Integer top,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") EventhubInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/eventhubs/{eventHubName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("eventHubName") String eventHubName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRulesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByNamespaceNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, Context context) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName, context),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName));
+ }
+
+ /**
+ * Gets the authorization rules for an Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 authorization rules for an Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName, String eventHubName, Context context) {
+ return new PagedIterable<>(
+ listAuthorizationRulesAsync(resourceGroupName, namespaceName, eventHubName, context));
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateAuthorizationRuleWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ AuthorizationRuleInner parameters = new AuthorizationRuleInner();
+ parameters.withRights(rights);
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdateAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateAuthorizationRuleWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ AuthorizationRuleInner parameters = new AuthorizationRuleInner();
+ parameters.withRights(rights);
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdateAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAuthorizationRuleAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights) {
+ return createOrUpdateAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAuthorizationRuleAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights,
+ Context context) {
+ return createOrUpdateAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner createOrUpdateAuthorizationRule(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights) {
+ return createOrUpdateAuthorizationRuleAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights)
+ .block();
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule
+ * will take a few seconds to take effect.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner createOrUpdateAuthorizationRule(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ List rights,
+ Context context) {
+ return createOrUpdateAuthorizationRuleAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights, context)
+ .block();
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAuthorizationRuleWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .getAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ return getAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAuthorizationRuleAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ return getAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner getAuthorizationRule(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ return getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block();
+ }
+
+ /**
+ * Gets an AuthorizationRule for an Event Hub by rule name.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 an AuthorizationRule for an Event Hub by rule name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner getAuthorizationRule(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ return getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context)
+ .block();
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .deleteAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAuthorizationRuleWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .deleteAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ return deleteAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAuthorizationRuleAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ return deleteAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 deleteAuthorizationRule(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block();
+ }
+
+ /**
+ * Deletes an Event Hub AuthorizationRule.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 deleteAuthorizationRule(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context)
+ .block();
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listKeysWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listKeysWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listKeysAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono listKeysAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ return listKeysWithResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner listKeys(
+ String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) {
+ return listKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).block();
+ }
+
+ /**
+ * Gets the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 ACS and SAS connection strings for the Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner listKeys(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ Context context) {
+ return listKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, context).block();
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> regenerateKeysWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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();
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .regenerateKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @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 namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> regenerateKeysWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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();
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .regenerateKeys(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono regenerateKeysAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters parameters) {
+ return regenerateKeysWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @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 namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono regenerateKeysAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters parameters,
+ Context context) {
+ return regenerateKeysWithResponseAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner regenerateKeys(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters parameters) {
+ return regenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters)
+ .block();
+ }
+
+ /**
+ * Regenerates the ACS and SAS connection strings for the Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param parameters Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs
+ * to be reset.
+ * @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 namespace/EventHub Connection String.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessKeysInner regenerateKeys(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ String authorizationRuleName,
+ RegenerateAccessKeyParameters parameters,
+ Context context) {
+ return regenerateKeysAsync(
+ resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, context)
+ .block();
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByNamespaceSinglePageAsync(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByNamespace(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ skip,
+ top,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByNamespaceSinglePageAsync(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listByNamespace(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ skip,
+ top,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByNamespaceAsync(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top) {
+ return new PagedFlux<>(
+ () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top),
+ nextLink -> listByNamespaceNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByNamespaceAsync(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) {
+ return new PagedFlux<>(
+ () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top, context),
+ nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) {
+ final Integer skip = null;
+ final Integer top = null;
+ final Context context = null;
+ return new PagedFlux<>(
+ () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top),
+ nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByNamespace(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top) {
+ return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains
+ * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting
+ * point to use for subsequent calls.
+ * @param top May be used to limit the number of results to the most recent N usageDetails.
+ * @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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByNamespace(
+ String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) {
+ return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context));
+ }
+
+ /**
+ * Gets all the Event Hubs in a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 the Event Hubs in a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) {
+ final Integer skip = null;
+ final Integer top = null;
+ final Context context = null;
+ return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top));
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, EventhubInner 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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();
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ EventhubInner 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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();
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ EventhubInner parameters,
+ Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EventhubInner createOrUpdate(
+ String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) {
+ return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters).block();
+ }
+
+ /**
+ * Creates or updates a new Event Hub as a nested resource within a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @param parameters Single item in List or Get Event Hub 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 single item in List or Get Event Hub operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EventhubInner createOrUpdate(
+ String resourceGroupName,
+ String namespaceName,
+ String eventHubName,
+ EventhubInner parameters,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters, context).block();
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 namespaceName, String eventHubName) {
+ deleteAsync(resourceGroupName, namespaceName, eventHubName).block();
+ }
+
+ /**
+ * Deletes an Event Hub from the specified Namespace and resource group.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 namespaceName, String eventHubName, Context context) {
+ deleteAsync(resourceGroupName, namespaceName, eventHubName, context).block();
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (eventHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter eventHubName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ eventHubName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(String resourceGroupName, String namespaceName, String eventHubName) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName, String namespaceName, String eventHubName, Context context) {
+ return getWithResponseAsync(resourceGroupName, namespaceName, eventHubName, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) {
+ return getAsync(resourceGroupName, namespaceName, eventHubName).block();
+ }
+
+ /**
+ * Gets an Event Hubs description for the specified Event Hub.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param eventHubName The Event Hub name.
+ * @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 an Event Hubs description for the specified Event Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName, Context context) {
+ return getAsync(resourceGroupName, namespaceName, eventHubName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 from the List namespace operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(context -> service.listAuthorizationRulesNext(nextLink, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 from the List namespace operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listAuthorizationRulesNext(nextLink, 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 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 result of the List EventHubs operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByNamespaceNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(context -> service.listByNamespaceNext(nextLink, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 result of the List EventHubs operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listByNamespaceNext(nextLink, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java
new file mode 100644
index 0000000000000..f313de4adc9c3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/fluent/NamespacesClient.java
@@ -0,0 +1,3767 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.fluent;
+
+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.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.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.eventhubs.EventHubManagementClient;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AccessKeysInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.AuthorizationRuleListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.EHNamespaceInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.EHNamespaceListResultInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.MessagingPlanInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.NetworkRuleSetInner;
+import com.azure.resourcemanager.eventhubs.fluent.inner.NetworkRuleSetListResultInner;
+import com.azure.resourcemanager.eventhubs.models.AccessRights;
+import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter;
+import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters;
+import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
+import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
+import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
+import java.nio.ByteBuffer;
+import java.util.List;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in Namespaces. */
+public final class NamespacesClient
+ implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete {
+ private final ClientLogger logger = new ClientLogger(NamespacesClient.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final NamespacesService service;
+
+ /** The service client containing this operation class. */
+ private final EventHubManagementClient client;
+
+ /**
+ * Initializes an instance of NamespacesClient.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ public NamespacesClient(EventHubManagementClient client) {
+ this.service =
+ RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for EventHubManagementClientNamespaces to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "EventHubManagementCl")
+ private interface NamespacesService {
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRules(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdateAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") AuthorizationRuleInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> deleteAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules/{authorizationRuleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getAuthorizationRule(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listKeys(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> regenerateKeys(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @PathParam("authorizationRuleName") String authorizationRuleName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") RegenerateAccessKeyParameters parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkNameAvailability(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") CheckNameAvailabilityParameter parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub"
+ + "/namespaces")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}")
+ @ExpectedResponses({200, 201, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") EHNamespaceInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}")
+ @ExpectedResponses({200, 201, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") EHNamespaceInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/messagingplan")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getMessagingPlan(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/networkRuleSets/default")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdateNetworkRuleSet(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") NetworkRuleSetInner parameters,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/networkRuleSets/default")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getNetworkRuleSet(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces"
+ + "/{namespaceName}/networkRuleSets")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNetworkRuleSets(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("namespaceName") String namespaceName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAuthorizationRulesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+
+ @Headers({"Accept: application/json", "Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNetworkRuleSetsNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> listAuthorizationRulesSinglePageAsync(
+ String resourceGroupName, String namespaceName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .listAuthorizationRules(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAuthorizationRulesAsync(
+ String resourceGroupName, String namespaceName, Context context) {
+ return new PagedFlux<>(
+ () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context),
+ nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName) {
+ return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName));
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @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 list of authorization rules for a Namespace.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAuthorizationRules(
+ String resourceGroupName, String namespaceName, Context context) {
+ return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context));
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ AuthorizationRuleInner parameters = new AuthorizationRuleInner();
+ parameters.withRights(rights);
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdateAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createOrUpdateAuthorizationRuleWithResponseAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String authorizationRuleName,
+ List rights,
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ AuthorizationRuleInner parameters = new AuthorizationRuleInner();
+ parameters.withRights(rights);
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdateAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ context);
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) {
+ return createOrUpdateAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, authorizationRuleName, rights)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createOrUpdateAuthorizationRuleAsync(
+ String resourceGroupName,
+ String namespaceName,
+ String authorizationRuleName,
+ List rights,
+ Context context) {
+ return createOrUpdateAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, authorizationRuleName, rights, context)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner createOrUpdateAuthorizationRule(
+ String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) {
+ return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, rights)
+ .block();
+ }
+
+ /**
+ * Creates or updates an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @param rights The rights associated with the 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 single item in a List or Get AuthorizationRule operation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AuthorizationRuleInner createOrUpdateAuthorizationRule(
+ String resourceGroupName,
+ String namespaceName,
+ String authorizationRuleName,
+ List rights,
+ Context context) {
+ return createOrUpdateAuthorizationRuleAsync(
+ resourceGroupName, namespaceName, authorizationRuleName, rights, context)
+ .block();
+ }
+
+ /**
+ * Deletes an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName) {
+ 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .deleteAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAuthorizationRuleWithResponseAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName, 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 (namespaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));
+ }
+ if (authorizationRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter authorizationRuleName 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."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .deleteAuthorizationRule(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ namespaceName,
+ authorizationRuleName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ context);
+ }
+
+ /**
+ * Deletes an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName) {
+ return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes an AuthorizationRule for a Namespace.
+ *
+ * @param resourceGroupName Name of the resource group within the azure subscription.
+ * @param namespaceName The Namespace name.
+ * @param authorizationRuleName The authorization rule name.
+ * @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 completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAuthorizationRuleAsync(
+ String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) {
+ return deleteAuthorizationRuleWithResponseAsync(
+ resourceGroupName, namespaceName, authorizationRuleName, context)
+ .flatMap((Response