diff --git a/sdk/eventhubs/mgmt-v2017_04_01/pom.xml b/sdk/eventhubs/mgmt-v2017_04_01/pom.xml
index 4cb97ac55ad12..6fbfcfc5c8c3a 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/pom.xml
+++ b/sdk/eventhubs/mgmt-v2017_04_01/pom.xml
@@ -11,7 +11,7 @@
com.microsoft.azure
azure-arm-parent
- 1.2.0
+ 1.1.0
../../../pom.management.xml
azure-mgmt-eventhubs
@@ -71,6 +71,8 @@
azure-arm-client-runtime
test-jar
test
+
+ 1.6.5
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/ErrorResponse.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/ErrorResponse.java
index c6c19887714bf..33e6d37f506dc 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/ErrorResponse.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/ErrorResponse.java
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * Error response indicates EventHub service is not able to process the
+ * Error response indicates Event Hub service is not able to process the
* incoming request. The reason is provided in the error message.
*/
public class ErrorResponse {
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/MessagingRegionsProperties.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/MessagingRegionsProperties.java
index 56ec254834ba6..865b4a212c0c3 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/MessagingRegionsProperties.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/MessagingRegionsProperties.java
@@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * The MessagingRegionsProperties model.
+ * Properties of Messaging Region.
*/
public class MessagingRegionsProperties {
/**
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/Namespaces.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/Namespaces.java
index 95de862b638fb..0f88ea90c5b00 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/Namespaces.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/Namespaces.java
@@ -19,6 +19,7 @@
import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.eventhubs.v2017_04_01.NamespaceAuthorizationRule;
import rx.Completable;
+import com.microsoft.azure.management.eventhubs.v2017_04_01.NetworkRuleSet;
import com.microsoft.azure.management.eventhubs.v2017_04_01.implementation.NetworkRuleSetInner;
/**
@@ -106,6 +107,16 @@ public interface Namespaces extends SupportsCreating regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters);
+ /**
+ * Gets list of NetworkRuleSet 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
+ * @return the observable for the request
+ */
+ Observable listNetworkRuleSetsAsync(final String resourceGroupName, final String namespaceName);
+
/**
* Create or update NetworkRuleSet for a Namespace.
*
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/NetworkRuleSet.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/NetworkRuleSet.java
index 5c369bab42b5f..9a54d323ccab6 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/NetworkRuleSet.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/NetworkRuleSet.java
@@ -9,9 +9,9 @@
package com.microsoft.azure.management.eventhubs.v2017_04_01;
import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.eventhubs.v2017_04_01.implementation.NetworkRuleSetInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.eventhubs.v2017_04_01.implementation.EventHubsManager;
-import com.microsoft.azure.management.eventhubs.v2017_04_01.implementation.NetworkRuleSetInner;
import java.util.List;
/**
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/ConsumerGroupsImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/ConsumerGroupsImpl.java
index dd9e9c5849d7d..47375a1be0882 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/ConsumerGroupsImpl.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/ConsumerGroupsImpl.java
@@ -64,10 +64,14 @@ public ConsumerGroup call(ConsumerGroupInner inner) {
public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName, String consumerGroupName) {
ConsumerGroupsInner client = this.inner();
return client.getAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName)
- .map(new Func1() {
+ .flatMap(new Func1>() {
@Override
- public ConsumerGroup call(ConsumerGroupInner inner) {
- return wrapModel(inner);
+ public Observable call(ConsumerGroupInner inner) {
+ if (inner == null) {
+ return Observable.empty();
+ } else {
+ return Observable.just((ConsumerGroup)wrapModel(inner));
+ }
}
});
}
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java
index 8ec9bc4c77453..f55bd08ca1b07 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigNamespaceAuthorizationRuleImpl.java
@@ -28,7 +28,7 @@ class DisasterRecoveryConfigNamespaceAuthorizationRuleImpl extends IndexableRefr
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.namespaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "namespaces");
this.alias = IdParsingUtils.getValueFromIdByName(inner.id(), "disasterRecoveryConfigs");
- this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "AuthorizationRules");
+ this.authorizationRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizationRules");
}
@Override
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java
index ade19f09c14ab..939bc96cc2963 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java
@@ -91,10 +91,14 @@ public ArmDisasterRecovery call(ArmDisasterRecoveryInner inner) {
public Observable getAsync(String resourceGroupName, String namespaceName, String alias) {
DisasterRecoveryConfigsInner client = this.inner();
return client.getAsync(resourceGroupName, namespaceName, alias)
- .map(new Func1() {
+ .flatMap(new Func1>() {
@Override
- public ArmDisasterRecovery call(ArmDisasterRecoveryInner inner) {
- return wrapModel(inner);
+ public Observable call(ArmDisasterRecoveryInner inner) {
+ if (inner == null) {
+ return Observable.empty();
+ } else {
+ return Observable.just((ArmDisasterRecovery)wrapModel(inner));
+ }
}
});
}
@@ -113,7 +117,7 @@ private Observable getAuthorizationRuleInnerUsingDisaste
String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups");
String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces");
String alias = IdParsingUtils.getValueFromIdByName(id, "disasterRecoveryConfigs");
- String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules");
+ String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules");
DisasterRecoveryConfigsInner client = this.inner();
return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName);
}
@@ -122,10 +126,14 @@ private Observable getAuthorizationRuleInnerUsingDisaste
public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
DisasterRecoveryConfigsInner client = this.inner();
return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, alias, authorizationRuleName)
- .map(new Func1() {
+ .flatMap(new Func1>() {
@Override
- public DisasterRecoveryConfigNamespaceAuthorizationRule call(AuthorizationRuleInner inner) {
- return wrapDisasterRecoveryConfigNamespaceAuthorizationRuleModel(inner);
+ public Observable call(AuthorizationRuleInner inner) {
+ if (inner == null) {
+ return Observable.empty();
+ } else {
+ return Observable.just((DisasterRecoveryConfigNamespaceAuthorizationRule)wrapDisasterRecoveryConfigNamespaceAuthorizationRuleModel(inner));
+ }
}
});
}
diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsInner.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsInner.java
index 088949ea5fdf6..550dcf4bc0e16 100644
--- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsInner.java
+++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/DisasterRecoveryConfigsInner.java
@@ -63,8 +63,20 @@ public DisasterRecoveryConfigsInner(Retrofit retrofit, EventHubManagementClientI
* used by Retrofit to perform actually REST calls.
*/
interface DisasterRecoveryConfigsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listAuthorizationRules" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules")
+ Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs getAuthorizationRule" })
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}")
+ Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listKeys" })
+ @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys")
+ Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs checkNameAvailability" })
- @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability")
+ @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability")
Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameter parameters, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs list" })
@@ -91,109 +103,133 @@ interface DisasterRecoveryConfigsService {
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover")
Observable> failOver(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
- @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listAuthorizationRules" })
- @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules")
- Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
-
- @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs getAuthorizationRule" })
- @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}")
- Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
-
- @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listKeys" })
- @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys")
- Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("alias") String alias, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listAuthorizationRulesNext" })
+ @GET
+ Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listNext" })
@GET
Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
- @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs listAuthorizationRulesNext" })
- @GET
- Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
-
}
/**
- * Check the give Namespace name availability.
+ * 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 name Name to check the namespace name availability
+ * @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the CheckNameAvailabilityResultInner object if successful.
+ * @return the PagedList<AuthorizationRuleInner> object if successful.
*/
- public CheckNameAvailabilityResultInner checkNameAvailability(String resourceGroupName, String namespaceName, String name) {
- return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).toBlocking().single().body();
+ public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String alias) {
+ ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
}
/**
- * Check the give Namespace name availability.
+ * 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 name Name to check the namespace name availability
+ * @param alias The Disaster Recovery configuration name
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name), serviceCallback);
+ public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listAuthorizationRulesNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
}
/**
- * Check the give Namespace name availability.
+ * 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 name Name to check the namespace name availability
+ * @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the CheckNameAvailabilityResultInner object
+ * @return the observable to the PagedList<AuthorizationRuleInner> object
*/
- public Observable checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name) {
- return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).map(new Func1, CheckNameAvailabilityResultInner>() {
- @Override
- public CheckNameAvailabilityResultInner call(ServiceResponse response) {
- return response.body();
- }
- });
+ public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String alias) {
+ return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, alias)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
}
/**
- * Check the give Namespace name availability.
+ * 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 name Name to check the namespace name availability
+ * @param alias The Disaster Recovery configuration name
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the CheckNameAvailabilityResultInner object
+ * @return the observable to the PagedList<AuthorizationRuleInner> object
*/
- public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, String name) {
- if (this.client.subscriptionId() == null) {
- throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
- }
+ public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String alias) {
+ return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, alias)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Gets a list of authorization rules for a Namespace.
+ *
+ ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription.
+ ServiceResponse> * @param namespaceName The Namespace name
+ ServiceResponse> * @param alias The Disaster Recovery configuration name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String alias) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
+ if (alias == null) {
+ throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
+ }
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- if (name == null) {
- throw new IllegalArgumentException("Parameter name is required and cannot be null.");
- }
- CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter();
- parameters.withName(name);
- return service.checkNameAvailability(this.client.subscriptionId(), resourceGroupName, namespaceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ return service.listAuthorizationRules(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
@Override
- public Observable> call(Response response) {
+ public Observable>> call(Response response) {
try {
- ServiceResponse clientResponse = checkNameAvailabilityDelegate(response);
- return Observable.just(clientResponse);
+ ServiceResponse> result = listAuthorizationRulesDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
@@ -201,122 +237,99 @@ public Observable> call(Respon
});
}
- private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken() { }.getType())
+ private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
/**
- * Gets all Alias(Disaster Recovery configurations).
+ * 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 ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the PagedList<ArmDisasterRecoveryInner> object if successful.
+ * @return the AuthorizationRuleInner object if successful.
*/
- public PagedList list(final String resourceGroupName, final String namespaceName) {
- ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single();
- return new PagedList(response.body()) {
- @Override
- public Page nextPage(String nextPageLink) {
- return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
- }
- };
+ public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body();
}
/**
- * Gets all Alias(Disaster Recovery configurations).
+ * 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 serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) {
- return AzureServiceFuture.fromPageResponse(
- listSinglePageAsync(resourceGroupName, namespaceName),
- new Func1>>>() {
- @Override
- public Observable>> call(String nextPageLink) {
- return listNextSinglePageAsync(nextPageLink);
- }
- },
- serviceCallback);
+ public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback);
}
/**
- * Gets all Alias(Disaster Recovery configurations).
+ * 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
- * @return the observable to the PagedList<ArmDisasterRecoveryInner> object
+ * @return the observable to the AuthorizationRuleInner object
*/
- public Observable> listAsync(final String resourceGroupName, final String namespaceName) {
- return listWithServiceResponseAsync(resourceGroupName, namespaceName)
- .map(new Func1>, Page>() {
- @Override
- public Page call(ServiceResponse> response) {
- return response.body();
- }
- });
+ public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() {
+ @Override
+ public AuthorizationRuleInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
}
/**
- * Gets all Alias(Disaster Recovery configurations).
+ * 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
- * @return the observable to the PagedList<ArmDisasterRecoveryInner> object
- */
- public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) {
- return listSinglePageAsync(resourceGroupName, namespaceName)
- .concatMap(new Func1>, Observable>>>() {
- @Override
- public Observable>> call(ServiceResponse> page) {
- String nextPageLink = page.body().nextPageLink();
- if (nextPageLink == null) {
- return Observable.just(page);
- }
- return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
- }
- });
- }
-
- /**
- * Gets all Alias(Disaster Recovery configurations).
- *
- ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription.
- ServiceResponse> * @param namespaceName The Namespace name
- * @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful.
+ * @return the observable to the AuthorizationRuleInner object
*/
- public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) {
+ public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
+ if (alias == null) {
+ throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
+ }
+ if (authorizationRuleName == null) {
+ throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.");
+ }
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
- .flatMap(new Func1, Observable>>>() {
+ return service.getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
@Override
- public Observable>> call(Response response) {
+ public Observable> call(Response response) {
try {
- ServiceResponse> result = listDelegate(response);
- return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ ServiceResponse clientResponse = getAuthorizationRuleDelegate(response);
+ return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
@@ -324,74 +337,74 @@ public Observable>> call(Response
});
}
- private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken>() { }.getType())
+ private ServiceResponse getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
/**
- * Creates or updates a new Alias(Disaster Recovery configuration).
+ * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration)
+ * @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the ArmDisasterRecoveryInner object if successful.
+ * @return the AccessKeysInner object if successful.
*/
- public ArmDisasterRecoveryInner createOrUpdate(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
- return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).toBlocking().single().body();
+ public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body();
}
/**
- * Creates or updates a new Alias(Disaster Recovery configuration).
+ * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration)
+ * @param authorizationRuleName The authorization rule name.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters), serviceCallback);
+ public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback);
}
/**
- * Creates or updates a new Alias(Disaster Recovery configuration).
+ * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration)
+ * @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the ArmDisasterRecoveryInner object
+ * @return the observable to the AccessKeysInner object
*/
- public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
- return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).map(new Func1, ArmDisasterRecoveryInner>() {
+ public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
+ return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AccessKeysInner>() {
@Override
- public ArmDisasterRecoveryInner call(ServiceResponse response) {
+ public AccessKeysInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
- * Creates or updates a new Alias(Disaster Recovery configuration).
+ * 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 parameters Parameters required to create an Alias(Disaster Recovery configuration)
+ * @param authorizationRuleName The authorization rule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the ArmDisasterRecoveryInner object
+ * @return the observable to the AccessKeysInner object
*/
- public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
+ public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
@@ -401,22 +414,21 @@ public Observable> createOrUpdateWithS
if (alias == null) {
throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
}
+ if (authorizationRuleName == null) {
+ throw new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.");
+ }
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
- if (parameters == null) {
- throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
- }
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- Validator.validate(parameters);
- return service.createOrUpdate(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ return service.listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
@Override
- public Observable> call(Response response) {
+ public Observable> call(Response response) {
try {
- ServiceResponse clientResponse = createOrUpdateDelegate(response);
+ ServiceResponse clientResponse = listKeysDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
@@ -425,91 +437,93 @@ public Observable> call(Response createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken() { }.getType())
- .register(201, new TypeToken() { }.getType())
+ private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
/**
- * Deletes an Alias(Disaster Recovery configuration).
+ * Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
- * @param alias The Disaster Recovery configuration name
+ * @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the CheckNameAvailabilityResultInner object if successful.
*/
- public void delete(String resourceGroupName, String namespaceName, String alias) {
- deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
+ public CheckNameAvailabilityResultInner checkNameAvailability(String resourceGroupName, String namespaceName, String name) {
+ return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).toBlocking().single().body();
}
/**
- * Deletes an Alias(Disaster Recovery configuration).
+ * Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
- * @param alias The Disaster Recovery configuration name
+ * @param name Name to check the namespace name availability
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
+ public ServiceFuture checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name), serviceCallback);
}
/**
- * Deletes an Alias(Disaster Recovery configuration).
+ * Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
- * @param alias The Disaster Recovery configuration name
+ * @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the {@link ServiceResponse} object if successful.
+ * @return the observable to the CheckNameAvailabilityResultInner object
*/
- public Observable deleteAsync(String resourceGroupName, String namespaceName, String alias) {
- return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() {
+ public Observable checkNameAvailabilityAsync(String resourceGroupName, String namespaceName, String name) {
+ return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, name).map(new Func1, CheckNameAvailabilityResultInner>() {
@Override
- public Void call(ServiceResponse response) {
+ public CheckNameAvailabilityResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
- * Deletes an Alias(Disaster Recovery configuration).
+ * Check the give Namespace name availability.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
- * @param alias The Disaster Recovery configuration name
+ * @param name Name to check the namespace name availability
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the {@link ServiceResponse} object if successful.
+ * @return the observable to the CheckNameAvailabilityResultInner object
*/
- public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
+ public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String namespaceName, String name) {
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
- if (alias == null) {
- throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
- }
- if (this.client.subscriptionId() == null) {
- throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
- }
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- return service.delete(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ if (name == null) {
+ throw new IllegalArgumentException("Parameter name is required and cannot be null.");
+ }
+ CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter();
+ parameters.withName(name);
+ return service.checkNameAvailability(this.client.subscriptionId(), resourceGroupName, namespaceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
@Override
- public Observable> call(Response response) {
+ public Observable> call(Response response) {
try {
- ServiceResponse clientResponse = deleteDelegate(response);
+ ServiceResponse clientResponse = checkNameAvailabilityDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
@@ -518,92 +532,122 @@ public Observable> call(Response response) {
});
}
- private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken() { }.getType())
+ private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
/**
- * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ * Gets all Alias(Disaster Recovery configurations).
*
* @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 ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the ArmDisasterRecoveryInner object if successful.
+ * @return the PagedList<ArmDisasterRecoveryInner> object if successful.
*/
- public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) {
- return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
+ public PagedList list(final String resourceGroupName, final String namespaceName) {
+ ServiceResponse> response = listSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
}
/**
- * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ * Gets all Alias(Disaster Recovery configurations).
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
- * @param alias The Disaster Recovery configuration name
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
+ public ServiceFuture> listAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listSinglePageAsync(resourceGroupName, namespaceName),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
}
/**
- * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ * Gets all Alias(Disaster Recovery configurations).
*
* @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
- * @return the observable to the ArmDisasterRecoveryInner object
+ * @return the observable to the PagedList<ArmDisasterRecoveryInner> object
*/
- public Observable getAsync(String resourceGroupName, String namespaceName, String alias) {
- return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, ArmDisasterRecoveryInner>() {
- @Override
- public ArmDisasterRecoveryInner call(ServiceResponse response) {
- return response.body();
- }
- });
+ public Observable> listAsync(final String resourceGroupName, final String namespaceName) {
+ return listWithServiceResponseAsync(resourceGroupName, namespaceName)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
}
/**
- * Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace.
+ * Gets all Alias(Disaster Recovery configurations).
*
* @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
- * @return the observable to the ArmDisasterRecoveryInner object
+ * @return the observable to the PagedList<ArmDisasterRecoveryInner> object
*/
- public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
+ public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) {
+ return listSinglePageAsync(resourceGroupName, namespaceName)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Gets all Alias(Disaster Recovery configurations).
+ *
+ ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription.
+ ServiceResponse> * @param namespaceName The Namespace name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listSinglePageAsync(final String resourceGroupName, final String namespaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
- if (alias == null) {
- throw new IllegalArgumentException("Parameter alias is required and cannot be null.");
- }
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- return service.get(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ return service.list(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
@Override
- public Observable> call(Response response) {
+ public Observable>> call(Response response) {
try {
- ServiceResponse clientResponse = getDelegate(response);
- return Observable.just(clientResponse);
+ ServiceResponse> result = listDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
@@ -611,69 +655,74 @@ public Observable> call(Response getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken() { }.getType())
+ private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
/**
- * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ * 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 Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ArmDisasterRecoveryInner object if successful.
*/
- public void breakPairing(String resourceGroupName, String namespaceName, String alias) {
- breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body();
+ public ArmDisasterRecoveryInner createOrUpdate(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).toBlocking().single().body();
}
/**
- * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ * 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 Parameters required to create an Alias(Disaster Recovery configuration)
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture breakPairingAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback);
+ public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters), serviceCallback);
}
/**
- * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ * 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 Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the {@link ServiceResponse} object if successful.
+ * @return the observable to the ArmDisasterRecoveryInner object
*/
- public Observable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) {
- return breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() {
+ public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, alias, parameters).map(new Func1, ArmDisasterRecoveryInner>() {
@Override
- public Void call(ServiceResponse response) {
+ public ArmDisasterRecoveryInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
- * This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces.
+ * 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 Parameters required to create an Alias(Disaster Recovery configuration)
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the {@link ServiceResponse} object if successful.
+ * @return the observable to the ArmDisasterRecoveryInner object
*/
- public Observable> breakPairingWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) {
+ public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, ArmDisasterRecoveryInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
@@ -686,15 +735,19 @@ public Observable> breakPairingWithServiceResponseAsync(St
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
+ if (parameters == null) {
+ throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
+ }
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
- return service.breakPairing(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ Validator.validate(parameters);
+ return service.createOrUpdate(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
@Override
- public Observable> call(Response response) {
+ public Observable