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> call(Response response) { try { - ServiceResponse clientResponse = breakPairingDelegate(response); + ServiceResponse clientResponse = createOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -703,15 +756,16 @@ public Observable> call(Response response) { }); } - private ServiceResponse breakPairingDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse 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()) .registerError(ErrorResponseException.class) .build(response); } /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * Deletes an Alias(Disaster Recovery configuration). * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name @@ -720,12 +774,12 @@ private ServiceResponse breakPairingDelegate(Response respon * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void failOver(String resourceGroupName, String namespaceName, String alias) { - failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName, String alias) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); } /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * Deletes an Alias(Disaster Recovery configuration). * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name @@ -734,12 +788,12 @@ public void failOver(String resourceGroupName, String namespaceName, String alia * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture failOverAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); } /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * Deletes an Alias(Disaster Recovery configuration). * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name @@ -747,8 +801,8 @@ public ServiceFuture failOverAsync(String resourceGroupName, String namesp * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable failOverAsync(String resourceGroupName, String namespaceName, String alias) { - return failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName, String alias) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -757,7 +811,7 @@ public Void call(ServiceResponse response) { } /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + * Deletes an Alias(Disaster Recovery configuration). * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name @@ -765,7 +819,7 @@ public Void call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> failOverWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -781,12 +835,12 @@ public Observable> failOverWithServiceResponseAsync(String if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.failOver(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.delete(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) { try { - ServiceResponse clientResponse = failOverDelegate(response); + ServiceResponse clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -795,7 +849,7 @@ public Observable> call(Response response) { }); } - private ServiceResponse failOverDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) @@ -803,7 +857,7 @@ private ServiceResponse failOverDelegate(Response response) } /** - * Gets a list of authorization rules for a Namespace. + * 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 @@ -811,20 +865,14 @@ private ServiceResponse failOverDelegate(Response response) * @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<AuthorizationRuleInner> object if successful. + * @return the ArmDisasterRecoveryInner object if successful. */ - 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(); - } - }; + public ArmDisasterRecoveryInner get(String resourceGroupName, String namespaceName, String alias) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); } /** - * Gets a list of authorization rules for a Namespace. + * 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 @@ -833,70 +881,38 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - 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); + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); } /** - * Gets a list of authorization rules for a Namespace. + * 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 - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the ArmDisasterRecoveryInner object */ - 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(); - } - }); + 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(); + } + }); } /** - * Gets a list of authorization rules for a Namespace. + * 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 - * @return the observable to the PagedList<AuthorizationRuleInner> object - */ - 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. + * @return the observable to the ArmDisasterRecoveryInner object */ - public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String alias) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -912,88 +928,83 @@ public Observable>> listAuthorizati if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listAuthorizationRules(resourceGroupName, namespaceName, alias, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.get(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> result = listAuthorizationRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } - - private ServiceResponse> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + + private ServiceResponse getDelegate(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); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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 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 AuthorizationRuleInner object if successful. */ - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + public void breakPairing(String resourceGroupName, String namespaceName, String alias) { + breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + public ServiceFuture breakPairingAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AuthorizationRuleInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { + public Observable breakPairingAsync(String resourceGroupName, String namespaceName, String alias) { + return breakPairingWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { @Override - public AuthorizationRuleInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AuthorizationRuleInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + public Observable> breakPairingWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1003,21 +1014,18 @@ public Observable> getAuthorizationRuleW 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.getAuthorizationRule(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.breakPairing(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 = getAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = breakPairingDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1026,74 +1034,69 @@ public Observable> call(Response getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse breakPairingDelegate(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); } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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 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 AccessKeysInner object if successful. */ - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).toBlocking().single().body(); + public void failOver(String resourceGroupName, String namespaceName, String alias) { + failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).toBlocking().single().body(); } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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 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 listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName), serviceCallback); + public ServiceFuture failOverAsync(String resourceGroupName, String namespaceName, String alias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias), serviceCallback); } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable listKeysAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, alias, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable failOverAsync(String resourceGroupName, String namespaceName, String alias) { + return failOverWithServiceResponseAsync(resourceGroupName, namespaceName, alias).map(new Func1, Void>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias, String authorizationRuleName) { + public Observable> failOverWithServiceResponseAsync(String resourceGroupName, String namespaceName, String alias) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1103,21 +1106,18 @@ public Observable> listKeysWithServiceResponseA 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.listKeys(resourceGroupName, namespaceName, alias, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.failOver(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 = listKeysDelegate(response); + ServiceResponse clientResponse = failOverDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1126,34 +1126,34 @@ public Observable> call(Response }); } - private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse failOverDelegate(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); } /** - * Gets all Alias(Disaster Recovery configurations). + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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 PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets all Alias(Disaster Recovery configurations). + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1161,75 +1161,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets all Alias(Disaster Recovery configurations). + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets all Alias(Disaster Recovery configurations). + * Gets a list of authorization rules for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ArmDisasterRecoveryInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets all Alias(Disaster Recovery configurations). + * Gets a list of authorization rules for a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1237,34 +1237,34 @@ public Observable>> call(Response }); } - private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listAuthorizationRulesNextDelegate(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 a list of authorization rules for a Namespace. + * Gets all Alias(Disaster Recovery configurations). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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<AuthorizationRuleInner> object if successful. + * @return the PagedList<ArmDisasterRecoveryInner> object if successful. */ - public PagedList listAuthorizationRulesNext(final String nextPageLink) { - ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of authorization rules for a Namespace. + * Gets all Alias(Disaster Recovery configurations). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1272,75 +1272,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of authorization rules for a Namespace. + * Gets all Alias(Disaster Recovery configurations). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object */ - public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { - return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of authorization rules for a Namespace. + * Gets all Alias(Disaster Recovery configurations). * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<ArmDisasterRecoveryInner> object */ - public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of authorization rules for a Namespace. + * Gets all Alias(Disaster Recovery configurations). * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ArmDisasterRecoveryInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listAuthorizationRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1348,9 +1348,9 @@ public Observable>> call(Response> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(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); } diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubManagementClientImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubManagementClientImpl.java index 0c1a2d7f72c02..2c7ce9f80f066 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubManagementClientImpl.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubManagementClientImpl.java @@ -132,19 +132,6 @@ public EventHubManagementClientImpl withGenerateClientRequestId(boolean generate return this; } - /** - * The OperationsInner object to access its operations. - */ - private OperationsInner operations; - - /** - * Gets the OperationsInner object to access its operations. - * @return the OperationsInner object. - */ - public OperationsInner operations() { - return this.operations; - } - /** * The NamespacesInner object to access its operations. */ @@ -197,6 +184,19 @@ public ConsumerGroupsInner consumerGroups() { return this.consumerGroups; } + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + /** * The RegionsInner object to access its operations. */ @@ -245,11 +245,11 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; - this.operations = new OperationsInner(restClient().retrofit(), this); this.namespaces = new NamespacesInner(restClient().retrofit(), this); this.disasterRecoveryConfigs = new DisasterRecoveryConfigsInner(restClient().retrofit(), this); this.eventHubs = new EventHubsInner(restClient().retrofit(), this); this.consumerGroups = new ConsumerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); this.regions = new RegionsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsImpl.java index 0e04e4e867428..2399469cd90d9 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsImpl.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsImpl.java @@ -67,10 +67,14 @@ public Eventhub call(EventhubInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName) { EventHubsInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName, eventHubName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Eventhub call(EventhubInner inner) { - return wrapModel(inner); + public Observable call(EventhubInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Eventhub)wrapModel(inner)); + } } }); } @@ -107,10 +111,14 @@ private Observable getAuthorizationRuleInnerUsingEventHu public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { EventHubsInner client = this.inner(); return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public EventhubNamespaceAuthorizationRule call(AuthorizationRuleInner inner) { - return wrapEventhubNamespaceAuthorizationRuleModel(inner); + public Observable call(AuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((EventhubNamespaceAuthorizationRule)wrapEventhubNamespaceAuthorizationRuleModel(inner)); + } } }); } diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsInner.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsInner.java index 0ab251bb33f32..dd2de2f5ca405 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsInner.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsInner.java @@ -64,22 +64,6 @@ public EventHubsInner(Retrofit retrofit, EventHubManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface EventHubsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.EventHubs listByNamespace" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs") - Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @Query("$top") Integer top, @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.EventHubs createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Body EventhubInner parameters, @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.EventHubs delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") - Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs listAuthorizationRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules") Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -97,134 +81,156 @@ interface EventHubsService { Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs listKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/ListKeys") + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys") Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs regenerateKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @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.EventHubs listByNamespaceNext" }) - @GET - Observable> listByNamespaceNext(@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.EventHubs listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs") + Observable> listByNamespace(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @Query("$top") Integer top, @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.EventHubs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Body EventhubInner parameters, @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.EventHubs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @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.EventHubs 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.EventHubs listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Gets all the Event Hubs in a Namespace. + * 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 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<EventhubInner> object if successful. + * @return the PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String eventHubName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets all the Event Hubs in a Namespace. + * 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 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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets all the Event Hubs in a Namespace. + * 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 - * @return the observable to the PagedList<EventhubInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { - return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets all the Event Hubs in a Namespace. + * 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 - * @return the observable to the PagedList<EventhubInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @param eventHubName The Event Hub name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { 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 (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName 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."); } - final Integer skip = null; - final Integer top = null; - return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRules(resourceGroupName, namespaceName, eventHubName, 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 = listByNamespaceDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -232,125 +238,109 @@ public Observable>> call(Response> 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 the Event Hubs in a Namespace. + * 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 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 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 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<EventhubInner> object if successful. + * @return the AuthorizationRuleInner object if successful. */ - public PagedList listByNamespace(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { - ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Gets all the Event Hubs in a Namespace. + * 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 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 eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param rights The rights associated with the rule. * @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> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights), serviceCallback); } /** - * Gets all the Event Hubs in a Namespace. + * 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 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 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 - * @return the observable to the PagedList<EventhubInner> object + * @return the observable to the AuthorizationRuleInner object */ - public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { - return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName, skip, top) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { + @Override + public AuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all the Event Hubs in a Namespace. + * 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 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 - * @return the observable to the PagedList<EventhubInner> object - */ - public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { - return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top) - .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets all the Event Hubs in a Namespace. - * - ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. - ServiceResponse> * @param namespaceName The Namespace name - ServiceResponse> * @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. - ServiceResponse> * @param top May be used to limit the number of results to the most recent N usageDetails. + * @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 - * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the AuthorizationRuleInner object */ - public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { 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 (eventHubName == null) { + throw new IllegalArgumentException("Parameter eventHubName 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.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); + } + Validator.validate(rights); + AuthorizationRuleInner parameters = new AuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), 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> result = listByNamespaceDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -358,74 +348,74 @@ public Observable>> call(Response> listByNamespaceDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(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 Event Hub as a nested resource within a Namespace. + * 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 parameters Parameters supplied to create an Event Hub resource. + * @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 EventhubInner object if successful. + * @return the AuthorizationRuleInner object if successful. */ - public EventhubInner createOrUpdate(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).toBlocking().single().body(); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. + * 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 parameters Parameters supplied to create an Event Hub resource. + * @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 eventHubName, EventhubInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); } /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. + * 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 parameters Parameters supplied to create an Event Hub resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EventhubInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).map(new Func1, EventhubInner>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { @Override - public EventhubInner call(ServiceResponse response) { + public AuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a new Event Hub as a nested resource within a Namespace. + * 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 parameters Parameters supplied to create an Event Hub resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EventhubInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -435,22 +425,21 @@ public Observable> createOrUpdateWithServiceRespo if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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, eventHubName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getAuthorizationRule(resourceGroupName, namespaceName, eventHubName, 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 = getAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -459,52 +448,55 @@ public Observable> call(Response re }); } - private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().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); } /** - * Deletes an Event Hub from the specified Namespace and resource group. + * 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 ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void delete(String resourceGroupName, String namespaceName, String eventHubName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); } /** - * Deletes an Event Hub from the specified Namespace and resource group. + * 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 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 eventHubName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); } /** - * Deletes an Event Hub from the specified Namespace and resource group. + * 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 * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, Void>() { + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -513,15 +505,16 @@ public Void call(ServiceResponse response) { } /** - * Deletes an Event Hub from the specified Namespace and resource group. + * 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 * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -531,18 +524,21 @@ public Observable> deleteWithServiceResponseAsync(String r if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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.delete(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteDelegate(response); + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -551,7 +547,7 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) @@ -560,62 +556,66 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * Gets an Event Hubs description for the specified Event Hub. + * 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 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 EventhubInner object if successful. + * @return the AccessKeysInner object if successful. */ - public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); } /** - * Gets an Event Hubs description for the specified Event Hub. + * 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 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 eventHubName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); } /** - * Gets an Event Hubs description for the specified Event Hub. + * 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 - * @return the observable to the EventhubInner object + * @return the observable to the AccessKeysInner object */ - public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, EventhubInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public EventhubInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an Event Hubs description for the specified Event Hub. + * 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 - * @return the observable to the EventhubInner object + * @return the observable to the AccessKeysInner object */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -625,18 +625,21 @@ public Observable> getWithServiceResponseAsync(St if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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.get(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listKeys(resourceGroupName, namespaceName, eventHubName, 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 = getDelegate(response); + ServiceResponse clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -645,108 +648,78 @@ public Observable> call(Response re }); } - private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, 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); } /** - * Gets the authorization rules for an Event Hub. + * 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 regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @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<AuthorizationRuleInner> object if successful. + * @return the AccessKeysInner object if successful. */ - public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String eventHubName) { - ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Gets the authorization rules for an Event Hub. + * 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 regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters), serviceCallback); } /** - * Gets the authorization rules for an Event Hub. + * 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 regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the AccessKeysInner object */ - public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { - return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets the authorization rules for an Event Hub. + * 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 regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object - */ - public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { - return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, eventHubName) - .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 the authorization rules for an Event Hub. - * - ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. - ServiceResponse> * @param namespaceName The Namespace name - ServiceResponse> * @param eventHubName The Event Hub name - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the AccessKeysInner object */ - public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -756,19 +729,26 @@ public Observable>> listAuthorizati if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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."); } - return service.listAuthorizationRules(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + return service.regenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, 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> call(Response response) { try { - ServiceResponse> result = listAuthorizationRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -776,109 +756,124 @@ public Observable>> call(Response> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse regenerateKeysDelegate(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 an AuthorizationRule for the specified Event Hub. + * 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 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 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 AuthorizationRuleInner object if successful. + * @return the PagedList<EventhubInner> object if successful. */ - public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).toBlocking().single().body(); + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Creates or updates an AuthorizationRule for the specified Event Hub. + * 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 eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param rights The rights associated with the rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EventhubInner> object */ - public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights), serviceCallback); + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Creates or updates an AuthorizationRule for the specified Event Hub. + * 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 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable to the PagedList<EventhubInner> object */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { - @Override - public AuthorizationRuleInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listByNamespaceSinglePageAsync(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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); } /** - * Creates or updates an AuthorizationRule for the specified Event Hub. + * 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 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 - * @return the observable to the AuthorizationRuleInner object + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, List rights) { + public Observable>> listByNamespaceSinglePageAsync(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 (eventHubName == null) { - throw new IllegalArgumentException("Parameter eventHubName 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."); } - if (rights == null) { - throw new IllegalArgumentException("Parameter rights is required and cannot be null."); - } - Validator.validate(rights); - AuthorizationRuleInner parameters = new AuthorizationRuleInner(); - parameters.withRights(rights); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final Integer skip = null; + final Integer top = null; + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -886,99 +881,125 @@ public Observable> call(Response createOrUpdateAuthorizationRuleDelegate(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); - } - /** - * Gets an AuthorizationRule for an Event Hub by rule name. + * 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 eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule 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 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 AuthorizationRuleInner object if successful. + * @return the PagedList<EventhubInner> object if successful. */ - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + public PagedList listByNamespace(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + ServiceResponse> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Gets an AuthorizationRule for an Event Hub by rule name. + * 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 eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule 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 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + public ServiceFuture> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Gets an AuthorizationRule for an Event Hub by rule name. + * 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 eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable to the PagedList<EventhubInner> object */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { - @Override - public AuthorizationRuleInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName, skip, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Gets an AuthorizationRule for an Event Hub by rule name. + * 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 eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable to the PagedList<EventhubInner> object */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + public Observable>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, skip, top) + .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(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the Event Hubs in a Namespace. + * + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. + ServiceResponse> * @param namespaceName The Namespace name + ServiceResponse> * @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. + ServiceResponse> * @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 + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { 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 (eventHubName == null) { - throw new IllegalArgumentException("Parameter eventHubName 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.getAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listByNamespace(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByNamespaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -986,73 +1007,74 @@ public Observable> call(Response getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listByNamespaceDelegate(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); } /** - * Deletes an Event Hub AuthorizationRule. + * 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 authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create an Event Hub resource. * @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 EventhubInner object if successful. */ - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + public EventhubInner createOrUpdate(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).toBlocking().single().body(); } /** - * Deletes an Event Hub AuthorizationRule. + * 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 authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create an Event Hub resource. * @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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters), serviceCallback); } /** - * Deletes an Event Hub AuthorizationRule. + * 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 authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create an Event Hub resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the EventhubInner object */ - public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, Void>() { + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, parameters).map(new Func1, EventhubInner>() { @Override - public Void call(ServiceResponse response) { + public EventhubInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an Event Hub AuthorizationRule. + * 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 authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create an Event Hub resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the EventhubInner object */ - public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, EventhubInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1062,21 +1084,22 @@ public Observable> deleteAuthorizationRuleWithServiceRespo if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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."); } - return service.deleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, namespaceName, eventHubName, 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> call(Response response) { try { - ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = createOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1085,75 +1108,69 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse createOrUpdateDelegate(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); } /** - * Gets the ACS and SAS connection strings for the Event Hub. + * 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 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 AccessKeysInner object if successful. */ - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName, String eventHubName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); } /** - * Gets the ACS and SAS connection strings for the Event Hub. + * 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 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 listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String eventHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); } /** - * Gets the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable listKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName, String eventHubName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, Void>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1163,21 +1180,18 @@ public Observable> listKeysWithServiceResponseA if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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.listKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.delete(resourceGroupName, namespaceName, eventHubName, 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 = listKeysDelegate(response); + ServiceResponse clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1186,78 +1200,71 @@ public Observable> call(Response }); } - private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Regenerates the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @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 AccessKeysInner object if successful. + * @return the EventhubInner object if successful. */ - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).toBlocking().single().body(); + public EventhubInner get(String resourceGroupName, String namespaceName, String eventHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).toBlocking().single().body(); } /** - * Regenerates the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String eventHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName), serviceCallback); } /** - * Regenerates the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the EventhubInner object */ - public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + public Observable getAsync(String resourceGroupName, String namespaceName, String eventHubName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName).map(new Func1, EventhubInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public EventhubInner call(ServiceResponse response) { return response.body(); } }); } /** - * Regenerates the ACS and SAS connection strings for the Event Hub. + * 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 authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the EventhubInner object */ - public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String eventHubName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1267,25 +1274,18 @@ public Observable> regenerateKeysWithServiceRes if (eventHubName == null) { throw new IllegalArgumentException("Parameter eventHubName 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.regenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.get(resourceGroupName, namespaceName, eventHubName, 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 = regenerateKeysDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1294,34 +1294,34 @@ public Observable> call(Response }); } - private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getDelegate(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); } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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<EventhubInner> object if successful. + * @return the PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList listByNamespaceNext(final String nextPageLink) { - ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1329,75 +1329,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByNamespaceNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<EventhubInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listByNamespaceNextAsync(final String nextPageLink) { - return listByNamespaceNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<EventhubInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets all the Event Hubs in a Namespace. + * Gets the authorization rules for an Event Hub. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByNamespaceNextSinglePageAsync(final String nextPageLink) { + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByNamespaceNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1405,34 +1405,34 @@ public Observable>> call(Response> listByNamespaceNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listAuthorizationRulesNextDelegate(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 the authorization rules for an Event Hub. + * Gets all the Event Hubs in a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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<AuthorizationRuleInner> object if successful. + * @return the PagedList<EventhubInner> object if successful. */ - public PagedList listAuthorizationRulesNext(final String nextPageLink) { - ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByNamespaceNext(final String nextPageLink) { + ServiceResponse> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets the authorization rules for an Event Hub. + * Gets all the Event Hubs in a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -1440,75 +1440,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listByNamespaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets the authorization rules for an Event Hub. + * Gets all the Event Hubs in a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<EventhubInner> object */ - public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { - return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listByNamespaceNextAsync(final String nextPageLink) { + return listByNamespaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets the authorization rules for an Event Hub. + * Gets all the Event Hubs in a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<EventhubInner> object */ - public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByNamespaceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listByNamespaceNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets the authorization rules for an Event Hub. + * Gets all the Event Hubs in a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<EventhubInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listByNamespaceNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listAuthorizationRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listByNamespaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1516,9 +1516,9 @@ public Observable>> call(Response> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByNamespaceNextDelegate(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); } diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsManager.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsManager.java index 8b088c64359d2..51cf1871f0474 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsManager.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/EventHubsManager.java @@ -16,11 +16,11 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.eventhubs.v2017_04_01.Operations; import com.microsoft.azure.management.eventhubs.v2017_04_01.Namespaces; import com.microsoft.azure.management.eventhubs.v2017_04_01.DisasterRecoveryConfigs; import com.microsoft.azure.management.eventhubs.v2017_04_01.EventHubs; import com.microsoft.azure.management.eventhubs.v2017_04_01.ConsumerGroups; +import com.microsoft.azure.management.eventhubs.v2017_04_01.Operations; import com.microsoft.azure.management.eventhubs.v2017_04_01.Regions; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -29,11 +29,11 @@ * Entry point to Azure EventHubs resource management. */ public final class EventHubsManager extends ManagerCore { - private Operations operations; private Namespaces namespaces; private DisasterRecoveryConfigs disasterRecoveryConfigs; private EventHubs eventHubs; private ConsumerGroups consumerGroups; + private Operations operations; private Regions regions; /** * Get a Configurable instance that can be used to create EventHubsManager with optional configuration. @@ -82,16 +82,6 @@ public interface Configurable extends AzureConfigurable { EventHubsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } - /** - * @return Entry point to manage Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(this); - } - return this.operations; - } - /** * @return Entry point to manage Namespaces. */ @@ -132,6 +122,16 @@ public ConsumerGroups consumerGroups() { return this.consumerGroups; } + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + /** * @return Entry point to manage Regions. */ diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/MessagingRegionsInner.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/MessagingRegionsInner.java index 7c7596c8bf3b8..aea9303553dc8 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/MessagingRegionsInner.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/MessagingRegionsInner.java @@ -19,13 +19,13 @@ @SkipParentValidation public class MessagingRegionsInner extends Resource { /** - * The properties property. + * Properties of Messaging Region. */ @JsonProperty(value = "properties") private MessagingRegionsProperties properties; /** - * Get the properties value. + * Get properties of Messaging Region. * * @return the properties value */ @@ -34,7 +34,7 @@ public MessagingRegionsProperties properties() { } /** - * Set the properties value. + * Set properties of Messaging Region. * * @param properties the properties value to set * @return the MessagingRegionsInner object itself. diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespaceAuthorizationRuleImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespaceAuthorizationRuleImpl.java index 857112c23ab70..379c3d3c4fcb6 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespaceAuthorizationRuleImpl.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespaceAuthorizationRuleImpl.java @@ -38,7 +38,7 @@ class NamespaceAuthorizationRuleImpl extends CreatableUpdatableImpl getAuthorizationRuleInnerUsingNamespacesInnerAsync(String id) { String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); - String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "AuthorizationRules"); + String authorizationRuleName = IdParsingUtils.getValueFromIdByName(id, "authorizationRules"); NamespacesInner client = this.inner(); return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName); } @@ -190,10 +194,14 @@ private Observable getAuthorizationRuleInnerUsingNamespa public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { NamespacesInner client = this.inner(); return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public NamespaceAuthorizationRule call(AuthorizationRuleInner inner) { - return wrapNamespaceAuthorizationRuleModel(inner); + public Observable call(AuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NamespaceAuthorizationRule)wrapNamespaceAuthorizationRuleModel(inner)); + } } }); } @@ -246,6 +254,24 @@ public AccessKeys call(AccessKeysInner inner) { }); } + @Override + public Observable listNetworkRuleSetsAsync(final String resourceGroupName, final String namespaceName) { + NamespacesInner client = this.inner(); + return client.listNetworkRuleSetsAsync(resourceGroupName, namespaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public NetworkRuleSet call(NetworkRuleSetInner inner) { + return wrapNetworkRuleSetModel(inner); + } + }); + } + @Override public Observable createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { NamespacesInner client = this.inner(); diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespacesInner.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespacesInner.java index 2a656ffb6b3e9..7739cc9a10907 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespacesInner.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NamespacesInner.java @@ -69,8 +69,32 @@ public NamespacesInner(Retrofit retrofit, EventHubManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface NamespacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules") + Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizationRuleInner 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.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) + Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @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.Namespaces checkNameAvailability" }) - @POST("subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNameAvailability") + @POST("subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability") Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @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.Namespaces list" }) @@ -109,30 +133,6 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan") Observable> getMessagingPlan(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces listAuthorizationRules" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules") - Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces createOrUpdateAuthorizationRule" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - Observable> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizationRuleInner 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.Namespaces deleteAuthorizationRule" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true) - Observable> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces getAuthorizationRule" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") - Observable> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces listKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") - Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces regenerateKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") - Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Body RegenerateAccessKeyParameters parameters, @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.Namespaces createOrUpdateNetworkRuleSet" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default") Observable> createOrUpdateNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NetworkRuleSetInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -141,6 +141,14 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default") Observable> getNetworkRuleSet(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces listNetworkRuleSets" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets") + Observable> listNetworkRuleSets(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @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.Namespaces 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.Namespaces listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -149,186 +157,121 @@ interface NamespacesService { @GET Observable> listByResourceGroupNext(@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.Namespaces listAuthorizationRulesNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhubs.v2017_04_01.Namespaces listNetworkRuleSetsNext" }) @GET - Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * Check the give Namespace name availability. - * - * @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 CheckNameAvailabilityResultInner checkNameAvailability(String name) { - return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); - } - - /** - * Check the give Namespace name availability. - * - * @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 checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); - } - - /** - * Check the give Namespace name availability. - * - * @param name Name to check the namespace name availability - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CheckNameAvailabilityResultInner object - */ - public Observable checkNameAvailabilityAsync(String name) { - return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { - @Override - public CheckNameAvailabilityResultInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Check the give Namespace name availability. - * - * @param name Name to check the namespace name availability - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the CheckNameAvailabilityResultInner object - */ - public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { - 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(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } + Observable> listNetworkRuleSetsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - 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); } /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * 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 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<EHNamespaceInner> object if successful. + * @return the PagedList<AuthorizationRuleInner> object if successful. */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * 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 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 ListOperationCallback serviceCallback) { + public ServiceFuture> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * 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 - * @return the observable to the PagedList<EHNamespaceInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { + public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * 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 - * @return the observable to the PagedList<EHNamespaceInner> object + * @return the observable to the PagedList<AuthorizationRuleInner> object */ - public Observable>> listWithServiceResponseAsync() { - return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { + public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * 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 * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync() { + public Observable>> listAuthorizationRulesSinglePageAsync(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 (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(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listAuthorizationRules(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> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listAuthorizationRulesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -336,114 +279,102 @@ public Observable>> call(Response> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>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); } /** - * Lists the available Namespaces within a resource group. + * 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 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<EHNamespaceInner> object if successful. + * @return the AuthorizationRuleInner object if successful. */ - public PagedList listByResourceGroup(final String resourceGroupName) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Lists the available Namespaces within a resource group. + * 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 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByResourceGroupSinglePageAsync(resourceGroupName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByResourceGroupNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); } /** - * Lists the available Namespaces within a resource group. + * 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 - * @return the observable to the PagedList<EHNamespaceInner> object + * @return the observable to the AuthorizationRuleInner object */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { - return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { + @Override + public AuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Lists the available Namespaces within a resource group. + * 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 - * @return the observable to the PagedList<EHNamespaceInner> object - */ - public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { - return listByResourceGroupSinglePageAsync(resourceGroupName) - .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Lists the available Namespaces within a resource group. - * - ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the AuthorizationRuleInner object */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { 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 (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.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + if (rights == null) { + throw new IllegalArgumentException("Parameter rights is required and cannot be null."); + } + Validator.validate(rights); + AuthorizationRuleInner parameters = new AuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), 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> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -451,169 +382,184 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse createOrUpdateAuthorizationRuleDelegate(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 namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Deletes an AuthorizationRule for a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. + * @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 EHNamespaceInner object if successful. */ - public EHNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Deletes an AuthorizationRule for a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. + * @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, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Deletes an AuthorizationRule for a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the {@link ServiceResponse} object if successful. */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { @Override - public EHNamespaceInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Deletes an AuthorizationRule for a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the {@link ServiceResponse} object if successful. */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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 (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); - Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters for creating a namespace resource. + * @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 EHNamespaceInner object if successful. + * @return the AuthorizationRuleInner object if successful. */ - public EHNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters for creating a namespace resource. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters for creating a namespace resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { @Override - public EHNamespaceInner call(ServiceResponse response) { + public AuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters for creating a namespace resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the AuthorizationRuleInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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 (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.beginCreateOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getAuthorizationRule(resourceGroupName, namespaceName, 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 = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -622,153 +568,192 @@ public Observable> call(Response }); } - private ServiceResponse beginCreateOrUpdateDelegate(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()) - .register(202, 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); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 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 AccessKeysInner object if successful. */ - public void delete(String resourceGroupName, String namespaceName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 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 deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the AccessKeysInner object */ - public Observable deleteAsync(String resourceGroupName, String namespaceName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public Void call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the AccessKeysInner object */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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 (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."); } - Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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 existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings for the specified Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @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 AccessKeysInner object if successful. */ - public void beginDelete(String resourceGroupName, String namespaceName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings for the specified Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @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 beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings for the specified Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AccessKeysInner object */ - public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { @Override - public Void call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings for the specified Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the AccessKeysInner object */ - public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { 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 (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."); } - return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, 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> call(Response response) { try { - ServiceResponse clientResponse = beginDeleteDelegate(response); + ServiceResponse clientResponse = regenerateKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -777,87 +762,187 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) + private ServiceResponse regenerateKeysDelegate(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); } /** - * Gets the description of the specified namespace. + * 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 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 EHNamespaceInner object if successful. + * @return the CheckNameAvailabilityResultInner object if successful. */ - public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public CheckNameAvailabilityResultInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); } /** - * Gets the description of the specified namespace. + * 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 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 getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); } /** - * Gets the description of the specified namespace. + * 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 - * @return the observable to the EHNamespaceInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, EHNamespaceInner>() { + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { @Override - public EHNamespaceInner call(ServiceResponse response) { + public CheckNameAvailabilityResultInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the description of the specified namespace. + * 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 - * @return the observable to the EHNamespaceInner object + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (namespaceName == null) { - throw new IllegalArgumentException("Parameter namespaceName 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(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * + * @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<EHNamespaceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EHNamespaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EHNamespaceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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)); + } + }); + } + + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { 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.getByResourceGroup(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.list(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 = getByResourceGroupDelegate(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); } @@ -865,94 +950,114 @@ public Observable> call(Response }); } - private ServiceResponse getByResourceGroupDelegate(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> 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); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Lists the available Namespaces within a resource group. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @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<EHNamespaceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the available Namespaces within a resource group. * * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @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 EHNamespaceInner object if successful. + * @return the {@link ServiceFuture} object */ - public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Lists the available Namespaces within a resource group. * * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object + * @return the observable to the PagedList<EHNamespaceInner> object */ - public ServiceFuture updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Lists the available Namespaces within a resource group. * * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the observable to the PagedList<EHNamespaceInner> object */ - public Observable updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { - @Override - public EHNamespaceInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Lists the available Namespaces within a resource group. * - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. + ServiceResponse> * @param resourceGroupName Name of the resource group within the azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the EHNamespaceInner object + * @return the PagedList<EHNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { 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 (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.update(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listByResourceGroup(resourceGroupName, 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 = updateDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -960,68 +1065,70 @@ public Observable> call(Response }); } - private ServiceResponse updateDelegate(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()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse> listByResourceGroupDelegate(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 messaging plan for specified namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @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 MessagingPlanInner object if successful. + * @return the EHNamespaceInner object if successful. */ - public MessagingPlanInner getMessagingPlan(String resourceGroupName, String namespaceName) { - return getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public EHNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); } /** - * Gets messaging plan for specified namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @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 getMessagingPlanAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Gets messaging plan for specified namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MessagingPlanInner object + * @return the observable for the request */ - public Observable getMessagingPlanAsync(String resourceGroupName, String namespaceName) { - return getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, MessagingPlanInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { @Override - public MessagingPlanInner call(ServiceResponse response) { + public EHNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets messaging plan for specified namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MessagingPlanInner object + * @return the observable for the request */ - public Observable> getMessagingPlanWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1031,120 +1138,74 @@ public Observable> getMessagingPlanWithServi 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.getMessagingPlan(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getMessagingPlanDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getMessagingPlanDelegate(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); + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, namespaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets a list of authorization rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @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<AuthorizationRuleInner> object if successful. + * @return the EHNamespaceInner object if successful. */ - public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public EHNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Gets a list of authorization rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Gets a list of authorization rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the EHNamespaceInner object */ - public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { - return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { + @Override + public EHNamespaceInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets a list of authorization rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object - */ - public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listAuthorizationRulesSinglePageAsync(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(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 - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the EHNamespaceInner object */ - public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1154,16 +1215,20 @@ public Observable>> listAuthorizati 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.listAuthorizationRules(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, namespaceName, 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> call(Response response) { try { - ServiceResponse> result = listAuthorizationRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -1171,155 +1236,119 @@ public Observable>> call(Response> listAuthorizationRulesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse beginCreateOrUpdateDelegate(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()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Creates or updates an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 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 AuthorizationRuleInner object if successful. */ - public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); } /** - * Creates or updates an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Creates or updates an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable for the request */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).map(new Func1, AuthorizationRuleInner>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { @Override - public AuthorizationRuleInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable for the request */ - public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, 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 (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."); } - if (rights == null) { - throw new IllegalArgumentException("Parameter rights is required and cannot be null."); - } - Validator.validate(rights); - AuthorizationRuleInner parameters = new AuthorizationRuleInner(); - parameters.withRights(rights); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateAuthorizationRuleDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createOrUpdateAuthorizationRuleDelegate(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); + Observable> observable = service.delete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Deletes an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Deletes an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Deletes an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -1328,36 +1357,32 @@ public Void call(ServiceResponse response) { } /** - * Deletes an AuthorizationRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the 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 * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, 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 (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.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.beginDelete(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1366,92 +1391,86 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Gets the description of the specified 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 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 AuthorizationRuleInner object if successful. + * @return the EHNamespaceInner object if successful. */ - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public EHNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Gets the description of the specified namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Gets the description of the specified 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable to the EHNamespaceInner object */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AuthorizationRuleInner>() { + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, EHNamespaceInner>() { @Override - public AuthorizationRuleInner call(ServiceResponse response) { + public EHNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Gets the description of the specified 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 - * @return the observable to the AuthorizationRuleInner object + * @return the observable to the EHNamespaceInner object */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, 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 (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.getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getByResourceGroup(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 = getAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1460,91 +1479,93 @@ public Observable> call(Response getAuthorizationRuleDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getByResourceGroupDelegate(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()) .registerError(ErrorResponseException.class) .build(response); } /** - * Gets the primary and secondary connection strings for the Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating a namespace resource. * @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 AccessKeysInner object if successful. + * @return the EHNamespaceInner object if successful. */ - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public EHNamespaceInner update(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Gets the primary and secondary connection strings for the Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating a namespace resource. * @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 listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Gets the primary and secondary connection strings for the Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the EHNamespaceInner object */ - public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable updateAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, EHNamespaceInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public EHNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets the primary and secondary connection strings for the Namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the EHNamespaceInner object */ - public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, EHNamespaceInner parameters) { 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 (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."); } - return service.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + Validator.validate(parameters); + return service.update(resourceGroupName, namespaceName, 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> call(Response response) { try { - ServiceResponse clientResponse = listKeysDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1553,99 +1574,86 @@ public Observable> call(Response }); } - private ServiceResponse listKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateDelegate(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()) + .register(202, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) .build(response); } /** - * Regenerates the primary or secondary connection strings for the specified Namespace. + * Gets messaging plan for specified namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. * @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 AccessKeysInner object if successful. + * @return the MessagingPlanInner object if successful. */ - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + public MessagingPlanInner getMessagingPlan(String resourceGroupName, String namespaceName) { + return getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Regenerates the primary or secondary connection strings for the specified Namespace. + * Gets messaging plan for specified namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. * @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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture getMessagingPlanAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Regenerates the primary or secondary connection strings for the specified Namespace. + * Gets messaging plan for specified namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the MessagingPlanInner object */ - public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + public Observable getMessagingPlanAsync(String resourceGroupName, String namespaceName) { + return getMessagingPlanWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, MessagingPlanInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public MessagingPlanInner call(ServiceResponse response) { return response.body(); } }); } /** - * Regenerates the primary or secondary connection strings for the specified Namespace. + * Gets messaging plan for specified namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the MessagingPlanInner object */ - public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + public Observable> getMessagingPlanWithServiceResponseAsync(String resourceGroupName, 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 (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.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getMessagingPlan(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 = regenerateKeysDelegate(response); + ServiceResponse clientResponse = getMessagingPlanDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1654,9 +1662,9 @@ public Observable> call(Response }); } - private ServiceResponse regenerateKeysDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getMessagingPlanDelegate(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); } @@ -1841,6 +1849,240 @@ private ServiceResponse getNetworkRuleSetDelegate(Response< .build(response); } + /** + * 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 + * @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<NetworkRuleSetInner> object if successful. + */ + public PagedList listNetworkRuleSets(final String resourceGroupName, final String namespaceName) { + ServiceResponse> response = listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNetworkRuleSetsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace 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> listNetworkRuleSetsAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNetworkRuleSetsSinglePageAsync(resourceGroupName, namespaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNetworkRuleSetsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 to the PagedList<NetworkRuleSetInner> object + */ + public Observable> listNetworkRuleSetsAsync(final String resourceGroupName, final String namespaceName) { + return listNetworkRuleSetsWithServiceResponseAsync(resourceGroupName, namespaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 to the PagedList<NetworkRuleSetInner> object + */ + public Observable>> listNetworkRuleSetsWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { + return listNetworkRuleSetsSinglePageAsync(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(listNetworkRuleSetsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * + 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<NetworkRuleSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNetworkRuleSetsSinglePageAsync(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 (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.listNetworkRuleSets(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNetworkRuleSetsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNetworkRuleSetsDelegate(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 a list of authorization rules for a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<AuthorizationRuleInner> object if successful. + */ + public PagedList listAuthorizationRulesNext(final String nextPageLink) { + ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAuthorizationRulesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of authorization rules for a Namespace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AuthorizationRuleInner> object + */ + public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink) + .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 nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAuthorizationRulesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAuthorizationRulesNextDelegate(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); + } + /** * Lists all the available Namespaces within a subscription, irrespective of the resource groups. * @@ -2064,26 +2306,26 @@ private ServiceResponse> listByResourceGroupNextDeleg } /** - * Gets a list of authorization rules for a Namespace. + * Gets list of NetworkRuleSet for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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<AuthorizationRuleInner> object if successful. + * @return the PagedList<NetworkRuleSetInner> object if successful. */ - public PagedList listAuthorizationRulesNext(final String nextPageLink) { - ServiceResponse> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listNetworkRuleSetsNext(final String nextPageLink) { + ServiceResponse> response = listNetworkRuleSetsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listNetworkRuleSetsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets a list of authorization rules for a Namespace. + * Gets list of NetworkRuleSet for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls @@ -2091,75 +2333,75 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listNetworkRuleSetsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesNextSinglePageAsync(nextPageLink), - new Func1>>>() { + listNetworkRuleSetsNextSinglePageAsync(nextPageLink), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listNetworkRuleSetsNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets a list of authorization rules for a Namespace. + * Gets list of NetworkRuleSet for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<NetworkRuleSetInner> object */ - public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { - return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + public Observable> listNetworkRuleSetsNextAsync(final String nextPageLink) { + return listNetworkRuleSetsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets a list of authorization rules for a Namespace. + * Gets list of NetworkRuleSet for a Namespace. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AuthorizationRuleInner> object + * @return the observable to the PagedList<NetworkRuleSetInner> object */ - public Observable>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listNetworkRuleSetsNextWithServiceResponseAsync(final String nextPageLink) { + return listNetworkRuleSetsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listNetworkRuleSetsNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets a list of authorization rules for a Namespace. + * Gets list of NetworkRuleSet for a Namespace. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkRuleSetInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAuthorizationRulesNextSinglePageAsync(final String nextPageLink) { + public Observable>> listNetworkRuleSetsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); - return service.listAuthorizationRulesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listNetworkRuleSetsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listAuthorizationRulesNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listNetworkRuleSetsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2167,9 +2409,9 @@ public Observable>> call(Response> listAuthorizationRulesNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNetworkRuleSetsNextDelegate(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); } diff --git a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NetworkRuleSetImpl.java b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NetworkRuleSetImpl.java index 55553c9d4d0e1..c96f414c12a6e 100644 --- a/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NetworkRuleSetImpl.java +++ b/sdk/eventhubs/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/eventhubs/v2017_04_01/implementation/NetworkRuleSetImpl.java @@ -10,6 +10,7 @@ import com.microsoft.azure.management.eventhubs.v2017_04_01.NetworkRuleSet; import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; import com.microsoft.azure.management.eventhubs.v2017_04_01.DefaultAction; import java.util.List; import com.microsoft.azure.management.eventhubs.v2017_04_01.NWRuleSetIpRules; @@ -17,7 +18,8 @@ class NetworkRuleSetImpl extends WrapperImpl implements NetworkRuleSet { private final EventHubsManager manager; - NetworkRuleSetImpl(NetworkRuleSetInner inner, EventHubsManager manager) { + + NetworkRuleSetImpl(NetworkRuleSetInner inner, EventHubsManager manager) { super(inner); this.manager = manager; } @@ -27,6 +29,8 @@ public EventHubsManager manager() { return this.manager; } + + @Override public DefaultAction defaultAction() { return this.inner().defaultAction();