diff --git a/sdk/servicebus/mgmt-v2017_04_01/pom.xml b/sdk/servicebus/mgmt-v2017_04_01/pom.xml index 7b00002800b0..29c6060d5338 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/pom.xml +++ b/sdk/servicebus/mgmt-v2017_04_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-servicebus 1.0.0-beta @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorAdditionalInfo.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..50098dbee33b --- /dev/null +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2017_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponse.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponse.java index f276989db507..4190cc71b63c 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponse.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponse.java @@ -11,59 +11,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Error response indicates ServiceBus service is not able to process the - * incoming request. The reason is provided in the error message. + * The resource management error response. */ public class ErrorResponse { /** - * Error code. + * The error object. */ - @JsonProperty(value = "code") - private String code; + @JsonProperty(value = "error") + private ErrorResponseError error; /** - * Error message indicating why the operation failed. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get error code. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Set error code. - * - * @param code the code value to set - * @return the ErrorResponse object itself. - */ - public ErrorResponse withCode(String code) { - this.code = code; - return this; - } - - /** - * Get error message indicating why the operation failed. + * Get the error object. * - * @return the message value + * @return the error value */ - public String message() { - return this.message; + public ErrorResponseError error() { + return this.error; } /** - * Set error message indicating why the operation failed. + * Set the error object. * - * @param message the message value to set + * @param error the error value to set * @return the ErrorResponse object itself. */ - public ErrorResponse withMessage(String message) { - this.message = message; + public ErrorResponse withError(ErrorResponseError error) { + this.error = error; return this; } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponseError.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponseError.java new file mode 100644 index 000000000000..77a928038357 --- /dev/null +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ErrorResponseError.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicebus.v2017_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error object. + */ +public class ErrorResponseError { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/Namespaces.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/Namespaces.java index 53a1692d1da7..85164d19e4d8 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/Namespaces.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/Namespaces.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.servicebus.v2017_04_01.implementation.NamespacesInner; import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.servicebus.v2017_04_01.NamespaceSBAuthorizationRule; +import com.microsoft.azure.management.servicebus.v2017_04_01.NetworkRuleSet; import com.microsoft.azure.management.servicebus.v2017_04_01.implementation.NetworkRuleSetInner; /** @@ -107,6 +108,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/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/NetworkRuleSet.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/NetworkRuleSet.java index e38c0cc505ff..530fb26328bc 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/NetworkRuleSet.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/NetworkRuleSet.java @@ -9,9 +9,9 @@ package com.microsoft.azure.management.servicebus.v2017_04_01; import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicebus.v2017_04_01.implementation.NetworkRuleSetInner; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.servicebus.v2017_04_01.implementation.ServiceBusManager; -import com.microsoft.azure.management.servicebus.v2017_04_01.implementation.NetworkRuleSetInner; import java.util.List; /** diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ResourceNamespacePatch.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ResourceNamespacePatch.java index 25e7281a3056..d1072bc13bd1 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ResourceNamespacePatch.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/ResourceNamespacePatch.java @@ -8,11 +8,64 @@ package com.microsoft.azure.management.servicebus.v2017_04_01; -import com.microsoft.azure.Resource; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; /** * The Resource definition. */ -public class ResourceNamespacePatch extends Resource { +public class ResourceNamespacePatch extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the ResourceNamespacePatch object itself. + */ + public ResourceNamespacePatch withTags(Map tags) { + this.tags = tags; + return this; + } } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/SqlFilter.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/SqlFilter.java index a917c1821c4f..ac0a9021ba14 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/SqlFilter.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/SqlFilter.java @@ -25,7 +25,7 @@ public class SqlFilter { * This property is reserved for future use. An integer value showing the * compatibility level, currently hard-coded to 20. */ - @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "compatibilityLevel") private Integer compatibilityLevel; /** @@ -63,6 +63,17 @@ public Integer compatibilityLevel() { return this.compatibilityLevel; } + /** + * Set this property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20. + * + * @param compatibilityLevel the compatibilityLevel value to set + * @return the SqlFilter object itself. + */ + public SqlFilter withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + /** * Get value that indicates whether the rule action requires preprocessing. * diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java index d1e32adbb74f..0522b355e330 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/DisasterRecoveryConfigsImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/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)); + } } }); } @@ -122,10 +126,14 @@ private Observable getSBAuthorizationRuleInnerUsingDis 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 DisasterRecoveryConfigNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { - return wrapDisasterRecoveryConfigNamespaceSBAuthorizationRuleModel(inner); + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DisasterRecoveryConfigNamespaceSBAuthorizationRule)wrapDisasterRecoveryConfigNamespaceSBAuthorizationRuleModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/EventhubInner.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/EventhubInner.java index 7dc88e4caa44..f559f36aa899 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/EventhubInner.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/EventhubInner.java @@ -54,7 +54,7 @@ public class EventhubInner extends ProxyResource { private Long partitionCount; /** - * Enumerates the possible values for the status of the Event Hub. Possible + * Enumerates the possible values for the status of a Event Hub. Possible * values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', * 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. */ @@ -135,7 +135,7 @@ public EventhubInner withPartitionCount(Long partitionCount) { } /** - * Get enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * Get enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. * * @return the status value */ @@ -144,7 +144,7 @@ public EntityStatus status() { } /** - * Set enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. + * Set enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'. * * @param status the status value to set * @return the EventhubInner object itself. diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/MigrationConfigsImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/MigrationConfigsImpl.java index 53b139e8bcaa..c17e8ca21c90 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/MigrationConfigsImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/MigrationConfigsImpl.java @@ -76,10 +76,14 @@ public MigrationConfigProperties call(MigrationConfigPropertiesInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName) { MigrationConfigsInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public MigrationConfigProperties call(MigrationConfigPropertiesInner inner) { - return wrapModel(inner); + public Observable call(MigrationConfigPropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MigrationConfigProperties)wrapModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesImpl.java index a3d14e72a7b3..91e98b609eb9 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesImpl.java @@ -172,6 +172,10 @@ private NamespaceSBAuthorizationRuleImpl wrapNamespaceSBAuthorizationRuleModel(S return new NamespaceSBAuthorizationRuleImpl(inner, manager()); } + private NetworkRuleSetImpl wrapNetworkRuleSetModel(NetworkRuleSetInner inner) { + return new NetworkRuleSetImpl(inner, manager()); + } + private Observable getSBAuthorizationRuleInnerUsingNamespacesInnerAsync(String id) { String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); String namespaceName = IdParsingUtils.getValueFromIdByName(id, "namespaces"); @@ -184,10 +188,14 @@ private Observable getSBAuthorizationRuleInnerUsingNam 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 NamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { - return wrapNamespaceSBAuthorizationRuleModel(inner); + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NamespaceSBAuthorizationRule)wrapNamespaceSBAuthorizationRuleModel(inner)); + } } }); } @@ -240,6 +248,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/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesInner.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesInner.java index 9ccdbb2c48dc..33f72a2019e1 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesInner.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NamespacesInner.java @@ -72,10 +72,38 @@ public NamespacesInner(Retrofit retrofit, ServiceBusManagementClientImpl 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.servicebus.v2017_04_01.Namespaces listAuthorizationRules" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces createOrUpdateAuthorizationRule" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 SBAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces deleteAuthorizationRule" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces getAuthorizationRule" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces regenerateKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces checkNameAvailabilityMethod" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability") Observable> checkNameAvailabilityMethod(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailability parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces migrate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate") + Observable> migrate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBNamespaceMigrate parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -108,34 +136,6 @@ interface NamespacesService { @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}") Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Body SBNamespaceUpdateParameters 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.servicebus.v2017_04_01.Namespaces listAuthorizationRules" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces createOrUpdateAuthorizationRule" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 SBAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces deleteAuthorizationRule" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces getAuthorizationRule" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces listKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces regenerateKeys" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces migrate" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrate") - Observable> migrate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SBNamespaceMigrate parameters, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces createOrUpdateNetworkRuleSet" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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); @@ -144,6 +144,14 @@ interface NamespacesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.v2017_04_01.Namespaces listNetworkRuleSets" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.servicebus.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.servicebus.v2017_04_01.Namespaces listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -152,79 +160,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.servicebus.v2017_04_01.Namespaces listAuthorizationRulesNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces listNetworkRuleSetsNext" }) @GET - Observable> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listNetworkRuleSetsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } /** - * Check the give namespace name availability. + * Gets the authorization rules for a namespace. * - * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @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 CheckNameAvailabilityResultInner object if successful. + * @return the PagedList<SBAuthorizationRuleInner> object if successful. */ - public CheckNameAvailabilityResultInner checkNameAvailabilityMethod(String name) { - return checkNameAvailabilityMethodWithServiceResponseAsync(name).toBlocking().single().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 listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Check the give namespace name availability. + * Gets the authorization rules for a namespace. * - * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @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 checkNameAvailabilityMethodAsync(String name, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkNameAvailabilityMethodWithServiceResponseAsync(name), serviceCallback); + 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); } /** - * Check the give namespace name availability. + * Gets the authorization rules for a namespace. * - * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @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 CheckNameAvailabilityResultInner object + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable checkNameAvailabilityMethodAsync(String name) { - return checkNameAvailabilityMethodWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { - @Override - public CheckNameAvailabilityResultInner call(ServiceResponse response) { - return response.body(); - } - }); + 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(); + } + }); } /** - * Check the give namespace name availability. + * Gets the authorization rules for a namespace. * - * @param name The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. + * @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 CheckNameAvailabilityResultInner object + * @return the observable to the PagedList<SBAuthorizationRuleInner> object */ - public Observable> checkNameAvailabilityMethodWithServiceResponseAsync(String name) { + 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 the 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<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + 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."); } - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); - } - CheckNameAvailability parameters = new CheckNameAvailability(); - parameters.withName(name); - return service.checkNameAvailabilityMethod(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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 clientResponse = checkNameAvailabilityMethodDelegate(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); } @@ -232,106 +282,102 @@ public Observable> call(Respon }); } - private ServiceResponse checkNameAvailabilityMethodDelegate(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 the available namespaces within the subscription, irrespective of the resource groups. + * Creates or updates an authorization rule 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<SBNamespaceInner> object if successful. + * @return the SBAuthorizationRuleInner 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(); - } - }; + public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Creates or updates an authorization rule 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> listAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBNamespaceInner> object - */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public ServiceFuture createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Creates or updates an authorization rule 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<SBNamespaceInner> object + * @return the observable to the SBAuthorizationRuleInner 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)); - } - }); + public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * Creates or updates an authorization rule 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 PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable>> listSinglePageAsync() { + 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.list(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); + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + 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 = listDelegate(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); } @@ -339,114 +385,91 @@ 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 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 the available namespaces within a resource group. + * Deletes a namespace authorization rule. * * @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 PagedList<SBNamespaceInner> 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 void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Gets the available namespaces within a resource group. + * Deletes a namespace authorization rule. * * @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> 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Gets the available namespaces within a resource group. + * Deletes a namespace authorization rule. * * @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 PagedList<SBNamespaceInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { - return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets the available namespaces within a resource group. + * Deletes a namespace authorization rule. * * @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 PagedList<SBNamespaceInner> 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)); - } - }); - } - - /** - * Gets 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<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + 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 (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>>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = deleteAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -454,169 +477,185 @@ 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 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 service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets an authorization rule 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 supplied to create a namespace resource. + * @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 SBNamespaceInner object if successful. + * @return the SBAuthorizationRuleInner object if successful. */ - public SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets an authorization rule 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 supplied to create a namespace resource. + * @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 createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(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 service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets an authorization rule 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 supplied to create a namespace resource. + * @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 SBAuthorizationRuleInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public SBAuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets an authorization rule 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 supplied to create a namespace resource. + * @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 SBAuthorizationRuleInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner 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); - 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.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) { + try { + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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 service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters supplied to create a namespace resource. + * @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 SBNamespaceInner object if successful. + * @return the AccessKeysInner object if successful. */ - public SBNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters supplied to create a namespace resource. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the AccessKeysInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * 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 parameters Parameters supplied to create a namespace resource. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the AccessKeysInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + 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 (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.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) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = listKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -625,153 +664,180 @@ 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 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 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 supplied to regenerate the authorization 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 AccessKeysInner object if successful. */ - public void delete(String resourceGroupName, String namespaceName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().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 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 supplied to regenerate the authorization 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 deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(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 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 supplied to regenerate the authorization rule. * @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 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 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 supplied to regenerate the authorization rule. * @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> 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."); } - 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()); + 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) { + try { + ServiceResponse clientResponse = regenerateKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the 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 The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @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 beginDelete(String resourceGroupName, String namespaceName) { - beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public CheckNameAvailabilityResultInner checkNameAvailabilityMethod(String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(name).toBlocking().single().body(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the 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 The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @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 checkNameAvailabilityMethodAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityMethodWithServiceResponseAsync(name), serviceCallback); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the 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 The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { + public Observable checkNameAvailabilityMethodAsync(String name) { + return checkNameAvailabilityMethodWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { @Override - public Void call(ServiceResponse response) { + public CheckNameAvailabilityResultInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the 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 The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the CheckNameAvailabilityResultInner object */ - 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."); - } + public Observable> checkNameAvailabilityMethodWithServiceResponseAsync(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."); } - return service.beginDelete(resourceGroupName, namespaceName, 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."); + } + CheckNameAvailability parameters = new CheckNameAvailability(); + parameters.withName(name); + return service.checkNameAvailabilityMethod(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 clientResponse = beginDeleteDelegate(response); + ServiceResponse clientResponse = checkNameAvailabilityMethodDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -780,68 +846,69 @@ 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 checkNameAvailabilityMethodDelegate(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 a description for the specified namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @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 SBNamespaceInner object if successful. */ - public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); + public void migrate(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).toBlocking().single().body(); } /** - * Gets a description for the specified namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @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 migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType), serviceCallback); } /** - * Gets a description for the specified namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, SBNamespaceInner>() { + public Observable migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + return migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).map(new Func1, Void>() { @Override - public SBNamespaceInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets a description for the specified namespace. + * This operation Migrate the given namespace to provided name type. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String namespaceName) { + public Observable> migrateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -854,12 +921,17 @@ public Observable> getByResourceGroupWithServi 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>>() { + if (targetNamespaceType == null) { + throw new IllegalArgumentException("Parameter targetNamespaceType is required and cannot be null."); + } + SBNamespaceMigrate parameters = new SBNamespaceMigrate(); + parameters.withTargetNamespaceType(targetNamespaceType); + return service.migrate(resourceGroupName, namespaceName, 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 clientResponse = getByResourceGroupDelegate(response); + ServiceResponse clientResponse = migrateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -868,93 +940,106 @@ 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()) + private ServiceResponse migrateDelegate(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); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets all the available namespaces within the subscription, irrespective of the resource groups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters supplied to update 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 SBNamespaceInner object if successful. + * @return the PagedList<SBNamespaceInner> object if successful. */ - public SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); + 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(); + } + }; } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets all the available namespaces within the subscription, irrespective of the resource groups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters supplied to update 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 updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the available namespaces within the subscription, irrespective of the resource groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SBNamespaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets all the available namespaces within the subscription, irrespective of the resource groups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the observable to the PagedList<SBNamespaceInner> object */ - public Observable updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { - return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { - @Override - public SBNamespaceInner call(ServiceResponse response) { - return response.body(); - } - }); + 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)); + } + }); } /** - * Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. + * Gets all the available namespaces within the subscription, irrespective of the resource groups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters supplied to update a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBNamespaceInner object + * @return the PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters 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."); - } + public Observable>> listSinglePageAsync() { 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.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 = updateDelegate(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); } @@ -962,124 +1047,114 @@ 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> 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); } /** - * Gets the authorization rules for a namespace. + * Gets the available namespaces within a resource group. * * @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<SBAuthorizationRuleInner> object if successful. + * @return the PagedList<SBNamespaceInner> object if successful. */ - public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName) { - ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).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 listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Gets the authorization rules for a namespace. + * Gets the available namespaces within a resource group. * * @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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets the authorization rules for a namespace. + * Gets the available namespaces within a resource group. * * @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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBNamespaceInner> object */ - public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName) { - return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName) - .map(new Func1>, Page>() { + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets the authorization rules for a namespace. + * Gets the available namespaces within a resource group. * * @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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBNamespaceInner> object */ - public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) { - return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Gets the authorization rules for a namespace. + * Gets the available namespaces within a resource group. * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The namespace name + ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBNamespaceInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listAuthorizationRulesSinglePageAsync(final String resourceGroupName, final String namespaceName) { + 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 (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>>>() { + 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> result = listAuthorizationRulesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1087,193 +1162,169 @@ public Observable>> call(Response }); } - 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> 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); } /** - * Creates or updates an authorization rule for a namespace. + * Creates or updates a service 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 rights The rights associated with the rule. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create 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 SBAuthorizationRuleInner object if successful. + * @return the SBNamespaceInner object if successful. */ - public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).toBlocking().single().body(); + public SBNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().last().body(); } /** - * Creates or updates an authorization rule for a namespace. + * Creates or updates a service 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 rights The rights associated with the rule. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create 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 createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, rights), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Creates or updates an authorization rule for a namespace. + * Creates or updates a service 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 rights The rights associated with the rule. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBAuthorizationRuleInner 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, SBAuthorizationRuleInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { @Override - public SBAuthorizationRuleInner call(ServiceResponse response) { + public SBNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates an authorization rule for a namespace. + * Creates or updates a service 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 rights The rights associated with the rule. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBAuthorizationRuleInner object + * @return the observable for the request */ - public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, List rights) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner 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."); } - if (rights == null) { - throw new IllegalArgumentException("Parameter rights is required and cannot be null."); - } - Validator.validate(rights); - SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); - 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); + 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()); } /** - * Deletes a namespace authorization rule. + * Creates or updates a service 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 namespaceName The namespace name. + * @param parameters Parameters supplied to create 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 SBNamespaceInner object if successful. */ - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public SBNamespaceInner beginCreateOrUpdate(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * Deletes a namespace authorization rule. + * Creates or updates a service 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 namespaceName The namespace name. + * @param parameters Parameters supplied to create 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * Deletes a namespace authorization rule. + * Creates or updates a service 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 namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBNamespaceInner object */ - public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, Void>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, SBNamespaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { @Override - public Void call(ServiceResponse response) { + public SBNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes a namespace authorization rule. + * Creates or updates a service 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 namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBNamespaceInner object */ - public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceInner 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.deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, 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 clientResponse = deleteAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1282,185 +1333,153 @@ 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 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); } /** - * Gets an authorization rule for a namespace by rule name. + * 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 - * @return the SBAuthorizationRuleInner object if successful. */ - public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().last().body(); } /** - * Gets an authorization rule for a namespace by rule name. + * 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Gets an authorization rule for a namespace by rule name. + * 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 observable to the SBAuthorizationRuleInner object + * @return the observable for the request */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, Void>() { @Override - public SBAuthorizationRuleInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an authorization rule for a namespace by rule name. + * 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 observable to the SBAuthorizationRuleInner object + * @return the observable for the request */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { + 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."); } - 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) { - try { - ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - 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); + 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()); } /** - * Gets the primary and secondary connection strings for the 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 - * @return the AccessKeysInner object if successful. */ - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String namespaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Gets the primary and secondary connection strings for the 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 listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName), serviceCallback); + public ServiceFuture beginDeleteAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Gets the primary and secondary connection strings for the 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 observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable listKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, namespaceName).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. + * 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 observable to the AccessKeysInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listKeysWithServiceResponseAsync(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.listKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = listKeysDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1469,99 +1488,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 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); } /** - * Regenerates the primary or secondary connection strings for the namespace. + * Gets a description 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 supplied to regenerate the authorization 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 AccessKeysInner object if successful. + * @return the SBNamespaceInner object if successful. */ - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).toBlocking().single().body(); + public SBNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).toBlocking().single().body(); } /** - * Regenerates the primary or secondary connection strings for the namespace. + * Gets a description 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 supplied to regenerate the authorization 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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String namespaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName), serviceCallback); } /** - * Regenerates the primary or secondary connection strings for the namespace. + * Gets a description 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 supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBNamespaceInner object */ - public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + public Observable getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1, SBNamespaceInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public SBNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * Regenerates the primary or secondary connection strings for the namespace. + * Gets a description 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 supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBNamespaceInner object */ - public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + 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 (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.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 = regenerateKeysDelegate(response); + ServiceResponse clientResponse = getByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1570,69 +1576,70 @@ 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 getByResourceGroupDelegate(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); } /** - * This operation Migrate the given namespace to provided name type. + * Updates a service 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 targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' + * @param parameters Parameters supplied to update 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 SBNamespaceInner object if successful. */ - public void migrate(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { - migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).toBlocking().single().body(); + public SBNamespaceInner update(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); } /** - * This operation Migrate the given namespace to provided name type. + * Updates a service 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 targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' + * @param parameters Parameters supplied to update 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 migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters), serviceCallback); } /** - * This operation Migrate the given namespace to provided name type. + * Updates a service 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 targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' + * @param parameters Parameters supplied to update a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBNamespaceInner object */ - public Observable migrateAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { - return migrateWithServiceResponseAsync(resourceGroupName, namespaceName, targetNamespaceType).map(new Func1, Void>() { + public Observable updateAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).map(new Func1, SBNamespaceInner>() { @Override - public Void call(ServiceResponse response) { + public SBNamespaceInner call(ServiceResponse response) { return response.body(); } }); } /** - * This operation Migrate the given namespace to provided name type. + * Updates a service 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 targetNamespaceType Type of namespaces. Possible values include: 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' + * @param parameters Parameters supplied to update a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBNamespaceInner object */ - public Observable> migrateWithServiceResponseAsync(String resourceGroupName, String namespaceName, NameSpaceType targetNamespaceType) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String namespaceName, SBNamespaceUpdateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1642,20 +1649,19 @@ public Observable> migrateWithServiceResponseAsync(String 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."); } - if (targetNamespaceType == null) { - throw new IllegalArgumentException("Parameter targetNamespaceType is required and cannot be null."); - } - SBNamespaceMigrate parameters = new SBNamespaceMigrate(); - parameters.withTargetNamespaceType(targetNamespaceType); - return service.migrate(resourceGroupName, namespaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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 = migrateDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1664,9 +1670,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse migrateDelegate(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); } @@ -1851,6 +1859,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 the 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<SBAuthorizationRuleInner> 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 the 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 the 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<SBAuthorizationRuleInner> object + */ + public Observable> listAuthorizationRulesNextAsync(final String nextPageLink) { + return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the 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<SBAuthorizationRuleInner> 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 the 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<SBAuthorizationRuleInner> 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); + } + /** * Gets all the available namespaces within the subscription, irrespective of the resource groups. * @@ -2074,26 +2316,26 @@ private ServiceResponse> listByResourceGroupNextDeleg } /** - * Gets the 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<SBAuthorizationRuleInner> 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 the 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 @@ -2101,75 +2343,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 the 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<SBAuthorizationRuleInner> 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 the 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<SBAuthorizationRuleInner> 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 the 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<SBAuthorizationRuleInner> 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); } @@ -2177,9 +2419,9 @@ public Observable>> call(Response }); } - private ServiceResponse> 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/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NetworkRuleSetImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NetworkRuleSetImpl.java index 2b0eae6e1e38..e13ec320ef38 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NetworkRuleSetImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/NetworkRuleSetImpl.java @@ -10,6 +10,7 @@ import com.microsoft.azure.management.servicebus.v2017_04_01.NetworkRuleSet; import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; import com.microsoft.azure.management.servicebus.v2017_04_01.DefaultAction; import java.util.List; import com.microsoft.azure.management.servicebus.v2017_04_01.NWRuleSetIpRules; @@ -17,7 +18,8 @@ class NetworkRuleSetImpl extends WrapperImpl implements NetworkRuleSet { private final ServiceBusManager manager; - NetworkRuleSetImpl(NetworkRuleSetInner inner, ServiceBusManager manager) { + + NetworkRuleSetImpl(NetworkRuleSetInner inner, ServiceBusManager manager) { super(inner); this.manager = manager; } @@ -27,6 +29,8 @@ public ServiceBusManager manager() { return this.manager; } + + @Override public DefaultAction defaultAction() { return this.inner().defaultAction(); diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesImpl.java index 0211a389ac2e..1e8393b7f4ce 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesImpl.java @@ -67,10 +67,14 @@ public SBQueue call(SBQueueInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName, String queueName) { QueuesInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName, queueName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public SBQueue call(SBQueueInner inner) { - return wrapModel(inner); + public Observable call(SBQueueInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBQueue)wrapModel(inner)); + } } }); } @@ -107,10 +111,14 @@ private Observable getSBAuthorizationRuleInnerUsingQue public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { QueuesInner client = this.inner(); return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public QueueNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { - return wrapQueueNamespaceSBAuthorizationRuleModel(inner); + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueueNamespaceSBAuthorizationRule)wrapQueueNamespaceSBAuthorizationRuleModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesInner.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesInner.java index f25949363da2..16bff55b75ac 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesInner.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/QueuesInner.java @@ -64,22 +64,6 @@ public QueuesInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface QueuesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Queues listByNamespace" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues") - 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.servicebus.v2017_04_01.Queues createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Body SBQueueInner 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.servicebus.v2017_04_01.Queues delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @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.servicebus.v2017_04_01.Queues get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") - Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @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.servicebus.v2017_04_01.Queues listAuthorizationRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules") Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -104,127 +88,149 @@ interface QueuesService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys") Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @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.servicebus.v2017_04_01.Queues 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.servicebus.v2017_04_01.Queues listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues") + 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.servicebus.v2017_04_01.Queues createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @Path("subscriptionId") String subscriptionId, @Body SBQueueInner 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.servicebus.v2017_04_01.Queues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @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.servicebus.v2017_04_01.Queues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("queueName") String queueName, @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.servicebus.v2017_04_01.Queues 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.servicebus.v2017_04_01.Queues listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Gets the queues within a namespace. + * Gets all authorization rules for a queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param queueName The queue 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<SBQueueInner> object if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 queueName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName).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 the queues within a namespace. + * Gets all authorization rules for a queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param queueName The queue 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 queueName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets the queues within a namespace. + * Gets all authorization rules for a queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param queueName The queue name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBQueueInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 queueName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, queueName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets the queues within a namespace. + * Gets all authorization rules for a queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param queueName The queue name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBQueueInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 queueName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName) + .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 the queues within a namespace. + * Gets all authorization rules for a queue. * - * @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 queueName The queue name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 queueName) { 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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, queueName, 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 the queues within a namespace. + * Creates an authorization rule for a queue. * * @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 queueName The queue 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<SBQueueInner> object if successful. + * @return the SBAuthorizationRuleInner 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 SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Gets the queues within a namespace. + * Creates an authorization rule for a queue. * * @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 queueName The queue 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 queueName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights), serviceCallback); } /** - * Gets the queues within a namespace. + * Creates an authorization rule for a queue. * * @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 queueName The queue 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<SBQueueInner> object + * @return the observable to the SBAuthorizationRuleInner 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 queueName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets the queues within a namespace. + * Creates an authorization rule for a queue. * * @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<SBQueueInner> 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 the queues within 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 queueName The queue 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<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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); + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, queueName, 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,73 @@ 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 Service Bus queue. This operation is idempotent. + * Deletes a queue authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param parameters Parameters supplied to create or update a queue 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 SBQueueInner object if successful. */ - public SBQueueInner createOrUpdate(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).toBlocking().single().body(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates or updates a Service Bus queue. This operation is idempotent. + * Deletes a queue authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param parameters Parameters supplied to create or update a queue 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 queueName, SBQueueInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters), serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); } /** - * Creates or updates a Service Bus queue. This operation is idempotent. + * Deletes a queue authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param parameters Parameters supplied to create or update a queue resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBQueueInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).map(new Func1, SBQueueInner>() { + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, Void>() { @Override - public SBQueueInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Creates or updates a Service Bus queue. This operation is idempotent. + * Deletes a queue authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param parameters Parameters supplied to create or update a queue resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBQueueInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -435,22 +424,21 @@ public Observable> createOrUpdateWithServiceRespon if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, queueName, 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 = deleteAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -459,69 +447,75 @@ public Observable> call(Response res }); } - 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 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); } /** - * Deletes a queue from the specified namespace in a resource group. + * Gets an authorization rule for a queue by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 SBAuthorizationRuleInner object if successful. */ - public void delete(String resourceGroupName, String namespaceName, String queueName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); } /** - * Deletes a queue from the specified namespace in a resource group. + * Gets an authorization rule for a queue by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); } /** - * Deletes a queue from the specified namespace in a resource group. + * Gets an authorization rule for a queue by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable deleteAsync(String resourceGroupName, String namespaceName, String queueName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, Void>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { @Override - public Void call(ServiceResponse response) { + public SBAuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes a queue from the specified namespace in a resource group. + * Gets an authorization rule for a queue by rule name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -531,18 +525,21 @@ public Observable> deleteWithServiceResponseAsync(String r if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getAuthorizationRule(resourceGroupName, namespaceName, queueName, 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 = deleteDelegate(response); + ServiceResponse clientResponse = getAuthorizationRuleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -551,71 +548,74 @@ 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()) - .register(204, 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); } /** - * Returns a description for the specified queue. + * Primary and secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 SBQueueInner object if successful. + * @return the AccessKeysInner object if successful. */ - public SBQueueInner get(String resourceGroupName, String namespaceName, String queueName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); } /** - * Returns a description for the specified queue. + * Primary and secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); } /** - * Returns a description for the specified queue. + * Primary and secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBQueueInner object + * @return the observable to the AccessKeysInner object */ - public Observable getAsync(String resourceGroupName, String namespaceName, String queueName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, SBQueueInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public SBQueueInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a description for the specified queue. + * Primary and secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBQueueInner object + * @return the observable to the AccessKeysInner object */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -625,18 +625,21 @@ public Observable> getWithServiceResponseAsync(Str if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listKeys(resourceGroupName, namespaceName, queueName, 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 res }); } - 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 all authorization rules for a queue. + * Regenerates the primary or secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization 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<SBAuthorizationRuleInner> object if successful. + * @return the AccessKeysInner object if successful. */ - public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String queueName) { - ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName).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 queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Gets all authorization rules for a queue. + * Regenerates the primary or secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization 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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters), serviceCallback); } /** - * Gets all authorization rules for a queue. + * Regenerates the primary or secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBAuthorizationRuleInner> object + * @return the observable to the AccessKeysInner object */ - public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String queueName) { - return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, queueName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all authorization rules for a queue. + * Regenerates the primary or secondary connection strings to the queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBAuthorizationRuleInner> object - */ - public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String queueName) { - return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, queueName) - .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 all authorization rules for a queue. - * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The namespace name - ServiceResponse> * @param queueName The queue name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBAuthorizationRuleInner> 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 queueName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -756,19 +729,26 @@ public Observable>> listAuthoriza if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + return service.regenerateKeys(resourceGroupName, namespaceName, queueName, 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 }); } - 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 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 an authorization rule for a queue. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 SBAuthorizationRuleInner object if successful. + * @return the PagedList<SBQueueInner> object if successful. */ - public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, 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 an authorization rule for a queue. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 queueName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights), serviceCallback); + 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); } /** - * Creates an authorization rule for a queue. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBQueueInner> object */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { - @Override - public SBAuthorizationRuleInner call(ServiceResponse response) { - return response.body(); - } - }); + 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 an authorization rule for a queue. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBQueueInner> object */ - public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, List rights) { + 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)); + } + }); + } + + /** + * Gets the queues within 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 PagedList<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + 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 (queueName == null) { - throw new IllegalArgumentException("Parameter queueName 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); - SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); - parameters.withRights(rights); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, queueName, 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,98 +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); - } - /** - * Deletes a queue authorization rule. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 PagedList<SBQueueInner> object if successful. */ - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { - deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, 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(); + } + }; } /** - * Deletes a queue authorization rule. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, 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); } /** - * Deletes a queue authorization rule. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<SBQueueInner> object */ - public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { - return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, Void>() { - @Override - public Void 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(); + } + }); } /** - * Deletes a queue authorization rule. + * Gets the queues within a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param queueName The queue 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 {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<SBQueueInner> object */ - public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, 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 the queues within 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<SBQueueInner> 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 (queueName == null) { - throw new IllegalArgumentException("Parameter queueName 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, queueName, 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 = deleteAuthorizationRuleDelegate(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); } @@ -985,75 +1007,74 @@ 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> 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); } /** - * Gets an authorization rule for a queue by rule name. + * Creates or updates a Service Bus queue. This operation is idempotent. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create or update a queue 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 SBAuthorizationRuleInner object if successful. + * @return the SBQueueInner object if successful. */ - public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); + public SBQueueInner createOrUpdate(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).toBlocking().single().body(); } /** - * Gets an authorization rule for a queue by rule name. + * Creates or updates a Service Bus queue. This operation is idempotent. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create or update a queue 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 getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters), serviceCallback); } /** - * Gets an authorization rule for a queue by rule name. + * Creates or updates a Service Bus queue. This operation is idempotent. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create or update a queue resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBAuthorizationRuleInner object + * @return the observable to the SBQueueInner object */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, parameters).map(new Func1, SBQueueInner>() { @Override - public SBAuthorizationRuleInner call(ServiceResponse response) { + public SBQueueInner call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an authorization rule for a queue by rule name. + * Creates or updates a Service Bus queue. This operation is idempotent. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create or update a queue resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBAuthorizationRuleInner object + * @return the observable to the SBQueueInner object */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, SBQueueInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1063,21 +1084,22 @@ public Observable> getAuthorizationRul if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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.getAuthorizationRule(resourceGroupName, namespaceName, queueName, 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, queueName, 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 = getAuthorizationRuleDelegate(response); + ServiceResponse clientResponse = createOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1086,74 +1108,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 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); } /** - * Primary and secondary connection strings to the queue. + * Deletes a queue from the specified namespace in a resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName, String queueName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); } /** - * Primary and secondary connection strings to the queue. + * Deletes a queue from the specified namespace in a resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); } /** - * Primary and secondary connection strings to the queue. + * Deletes a queue from the specified namespace in a resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName, String queueName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, Void>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Primary and secondary connection strings to the queue. + * Deletes a queue from the specified namespace in a resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue 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 queueName, String authorizationRuleName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1163,21 +1180,18 @@ public Observable> listKeysWithServiceResponseA if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.delete(resourceGroupName, namespaceName, queueName, 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 primary or secondary connection strings to the queue. + * Returns a description for the specified queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization 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 AccessKeysInner object if successful. + * @return the SBQueueInner object if successful. */ - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).toBlocking().single().body(); + public SBQueueInner get(String resourceGroupName, String namespaceName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).toBlocking().single().body(); } /** - * Regenerates the primary or secondary connection strings to the queue. + * Returns a description for the specified queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization 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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName), serviceCallback); } /** - * Regenerates the primary or secondary connection strings to the queue. + * Returns a description for the specified queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBQueueInner object */ - public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + public Observable getAsync(String resourceGroupName, String namespaceName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, queueName).map(new Func1, SBQueueInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public SBQueueInner call(ServiceResponse response) { return response.body(); } }); } /** - * Regenerates the primary or secondary connection strings to the queue. + * Returns a description for the specified queue. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param queueName The queue name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBQueueInner object */ - public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String queueName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1267,25 +1274,18 @@ public Observable> regenerateKeysWithServiceRes if (queueName == null) { throw new IllegalArgumentException("Parameter queueName 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, queueName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.get(resourceGroupName, namespaceName, queueName, 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 the queues within a namespace. + * Gets all authorization rules for a queue. * * @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<SBQueueInner> object if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 the queues within a namespace. + * Gets all authorization rules for a queue. * * @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 the queues within a namespace. + * Gets all authorization rules for a queue. * * @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<SBQueueInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 the queues within a namespace. + * Gets all authorization rules for a queue. * * @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<SBQueueInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 the queues within a namespace. + * Gets all authorization rules for a queue. * - 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<SBQueueInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 all authorization rules for a queue. + * Gets the queues within 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<SBAuthorizationRuleInner> object if successful. + * @return the PagedList<SBQueueInner> 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 all authorization rules for a queue. + * Gets the queues within 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 all authorization rules for a queue. + * Gets the queues within 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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBQueueInner> 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 all authorization rules for a queue. + * Gets the queues within 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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBQueueInner> 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 all authorization rules for a queue. + * Gets the queues within 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<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBQueueInner> 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 }); } - private ServiceResponse> 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/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/RulesImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/RulesImpl.java index b07be1440337..62139d161a5f 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/RulesImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/RulesImpl.java @@ -64,10 +64,14 @@ public Rule call(RuleInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName, String ruleName) { RulesInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Rule call(RuleInner inner) { - return wrapModel(inner); + public Observable call(RuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Rule)wrapModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManagementClientImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManagementClientImpl.java index bd40bf2e9d64..1f95e9bd2356 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManagementClientImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManagementClientImpl.java @@ -133,29 +133,42 @@ public ServiceBusManagementClientImpl withGenerateClientRequestId(boolean genera } /** - * The OperationsInner object to access its operations. + * The NamespacesInner object to access its operations. */ - private OperationsInner operations; + private NamespacesInner namespaces; /** - * Gets the OperationsInner object to access its operations. - * @return the OperationsInner object. + * Gets the NamespacesInner object to access its operations. + * @return the NamespacesInner object. */ - public OperationsInner operations() { - return this.operations; + public NamespacesInner namespaces() { + return this.namespaces; } /** - * The NamespacesInner object to access its operations. + * The QueuesInner object to access its operations. */ - private NamespacesInner namespaces; + private QueuesInner queues; /** - * Gets the NamespacesInner object to access its operations. - * @return the NamespacesInner object. + * Gets the QueuesInner object to access its operations. + * @return the QueuesInner object. */ - public NamespacesInner namespaces() { - return this.namespaces; + public QueuesInner queues() { + return this.queues; + } + + /** + * The TopicsInner object to access its operations. + */ + private TopicsInner topics; + + /** + * Gets the TopicsInner object to access its operations. + * @return the TopicsInner object. + */ + public TopicsInner topics() { + return this.topics; } /** @@ -172,55 +185,55 @@ public DisasterRecoveryConfigsInner disasterRecoveryConfigs() { } /** - * The MigrationConfigsInner object to access its operations. + * The EventHubsInner object to access its operations. */ - private MigrationConfigsInner migrationConfigs; + private EventHubsInner eventHubs; /** - * Gets the MigrationConfigsInner object to access its operations. - * @return the MigrationConfigsInner object. + * Gets the EventHubsInner object to access its operations. + * @return the EventHubsInner object. */ - public MigrationConfigsInner migrationConfigs() { - return this.migrationConfigs; + public EventHubsInner eventHubs() { + return this.eventHubs; } /** - * The QueuesInner object to access its operations. + * The MigrationConfigsInner object to access its operations. */ - private QueuesInner queues; + private MigrationConfigsInner migrationConfigs; /** - * Gets the QueuesInner object to access its operations. - * @return the QueuesInner object. + * Gets the MigrationConfigsInner object to access its operations. + * @return the MigrationConfigsInner object. */ - public QueuesInner queues() { - return this.queues; + public MigrationConfigsInner migrationConfigs() { + return this.migrationConfigs; } /** - * The TopicsInner object to access its operations. + * The OperationsInner object to access its operations. */ - private TopicsInner topics; + private OperationsInner operations; /** - * Gets the TopicsInner object to access its operations. - * @return the TopicsInner object. + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. */ - public TopicsInner topics() { - return this.topics; + public OperationsInner operations() { + return this.operations; } /** - * The SubscriptionsInner object to access its operations. + * The PremiumMessagingRegionsInner object to access its operations. */ - private SubscriptionsInner subscriptions; + private PremiumMessagingRegionsInner premiumMessagingRegions; /** - * Gets the SubscriptionsInner object to access its operations. - * @return the SubscriptionsInner object. + * Gets the PremiumMessagingRegionsInner object to access its operations. + * @return the PremiumMessagingRegionsInner object. */ - public SubscriptionsInner subscriptions() { - return this.subscriptions; + public PremiumMessagingRegionsInner premiumMessagingRegions() { + return this.premiumMessagingRegions; } /** @@ -250,29 +263,16 @@ public RegionsInner regions() { } /** - * The PremiumMessagingRegionsInner object to access its operations. - */ - private PremiumMessagingRegionsInner premiumMessagingRegions; - - /** - * Gets the PremiumMessagingRegionsInner object to access its operations. - * @return the PremiumMessagingRegionsInner object. - */ - public PremiumMessagingRegionsInner premiumMessagingRegions() { - return this.premiumMessagingRegions; - } - - /** - * The EventHubsInner object to access its operations. + * The SubscriptionsInner object to access its operations. */ - private EventHubsInner eventHubs; + private SubscriptionsInner subscriptions; /** - * Gets the EventHubsInner object to access its operations. - * @return the EventHubsInner object. + * Gets the SubscriptionsInner object to access its operations. + * @return the SubscriptionsInner object. */ - public EventHubsInner eventHubs() { - return this.eventHubs; + public SubscriptionsInner subscriptions() { + return this.subscriptions; } /** @@ -310,17 +310,17 @@ 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.migrationConfigs = new MigrationConfigsInner(restClient().retrofit(), this); this.queues = new QueuesInner(restClient().retrofit(), this); this.topics = new TopicsInner(restClient().retrofit(), this); - this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsInner(restClient().retrofit(), this); + this.eventHubs = new EventHubsInner(restClient().retrofit(), this); + this.migrationConfigs = new MigrationConfigsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.premiumMessagingRegions = new PremiumMessagingRegionsInner(restClient().retrofit(), this); this.rules = new RulesInner(restClient().retrofit(), this); this.regions = new RegionsInner(restClient().retrofit(), this); - this.premiumMessagingRegions = new PremiumMessagingRegionsInner(restClient().retrofit(), this); - this.eventHubs = new EventHubsInner(restClient().retrofit(), this); + this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManager.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManager.java index 967732effc15..47b27e1ee78f 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManager.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/ServiceBusManager.java @@ -16,17 +16,17 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; -import com.microsoft.azure.management.servicebus.v2017_04_01.Operations; import com.microsoft.azure.management.servicebus.v2017_04_01.Namespaces; -import com.microsoft.azure.management.servicebus.v2017_04_01.DisasterRecoveryConfigs; -import com.microsoft.azure.management.servicebus.v2017_04_01.MigrationConfigs; import com.microsoft.azure.management.servicebus.v2017_04_01.Queues; import com.microsoft.azure.management.servicebus.v2017_04_01.Topics; -import com.microsoft.azure.management.servicebus.v2017_04_01.Subscriptions; +import com.microsoft.azure.management.servicebus.v2017_04_01.DisasterRecoveryConfigs; +import com.microsoft.azure.management.servicebus.v2017_04_01.EventHubs; +import com.microsoft.azure.management.servicebus.v2017_04_01.MigrationConfigs; +import com.microsoft.azure.management.servicebus.v2017_04_01.Operations; +import com.microsoft.azure.management.servicebus.v2017_04_01.PremiumMessagingRegions; import com.microsoft.azure.management.servicebus.v2017_04_01.Rules; import com.microsoft.azure.management.servicebus.v2017_04_01.Regions; -import com.microsoft.azure.management.servicebus.v2017_04_01.PremiumMessagingRegions; -import com.microsoft.azure.management.servicebus.v2017_04_01.EventHubs; +import com.microsoft.azure.management.servicebus.v2017_04_01.Subscriptions; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -34,17 +34,17 @@ * Entry point to Azure ServiceBus resource management. */ public final class ServiceBusManager extends ManagerCore { - private Operations operations; private Namespaces namespaces; - private DisasterRecoveryConfigs disasterRecoveryConfigs; - private MigrationConfigs migrationConfigs; private Queues queues; private Topics topics; - private Subscriptions subscriptions; + private DisasterRecoveryConfigs disasterRecoveryConfigs; + private EventHubs eventHubs; + private MigrationConfigs migrationConfigs; + private Operations operations; + private PremiumMessagingRegions premiumMessagingRegions; private Rules rules; private Regions regions; - private PremiumMessagingRegions premiumMessagingRegions; - private EventHubs eventHubs; + private Subscriptions subscriptions; /** * Get a Configurable instance that can be used to create ServiceBusManager with optional configuration. * @@ -92,16 +92,6 @@ public interface Configurable extends AzureConfigurable { ServiceBusManager 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. */ @@ -112,6 +102,26 @@ public Namespaces namespaces() { return this.namespaces; } + /** + * @return Entry point to manage Queues. + */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(this); + } + return this.queues; + } + + /** + * @return Entry point to manage Topics. + */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(this); + } + return this.topics; + } + /** * @return Entry point to manage DisasterRecoveryConfigs. */ @@ -123,43 +133,43 @@ public DisasterRecoveryConfigs disasterRecoveryConfigs() { } /** - * @return Entry point to manage MigrationConfigs. + * @return Entry point to manage EventHubs. */ - public MigrationConfigs migrationConfigs() { - if (this.migrationConfigs == null) { - this.migrationConfigs = new MigrationConfigsImpl(this); + public EventHubs eventHubs() { + if (this.eventHubs == null) { + this.eventHubs = new EventHubsImpl(this); } - return this.migrationConfigs; + return this.eventHubs; } /** - * @return Entry point to manage Queues. + * @return Entry point to manage MigrationConfigs. */ - public Queues queues() { - if (this.queues == null) { - this.queues = new QueuesImpl(this); + public MigrationConfigs migrationConfigs() { + if (this.migrationConfigs == null) { + this.migrationConfigs = new MigrationConfigsImpl(this); } - return this.queues; + return this.migrationConfigs; } /** - * @return Entry point to manage Topics. + * @return Entry point to manage Operations. */ - public Topics topics() { - if (this.topics == null) { - this.topics = new TopicsImpl(this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); } - return this.topics; + return this.operations; } /** - * @return Entry point to manage Subscriptions. + * @return Entry point to manage PremiumMessagingRegions. */ - public Subscriptions subscriptions() { - if (this.subscriptions == null) { - this.subscriptions = new SubscriptionsImpl(this); + public PremiumMessagingRegions premiumMessagingRegions() { + if (this.premiumMessagingRegions == null) { + this.premiumMessagingRegions = new PremiumMessagingRegionsImpl(this); } - return this.subscriptions; + return this.premiumMessagingRegions; } /** @@ -183,23 +193,13 @@ public Regions regions() { } /** - * @return Entry point to manage PremiumMessagingRegions. - */ - public PremiumMessagingRegions premiumMessagingRegions() { - if (this.premiumMessagingRegions == null) { - this.premiumMessagingRegions = new PremiumMessagingRegionsImpl(this); - } - return this.premiumMessagingRegions; - } - - /** - * @return Entry point to manage EventHubs. + * @return Entry point to manage Subscriptions. */ - public EventHubs eventHubs() { - if (this.eventHubs == null) { - this.eventHubs = new EventHubsImpl(this); + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(this); } - return this.eventHubs; + return this.subscriptions; } /** diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/SubscriptionsImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/SubscriptionsImpl.java index 275987ab62fb..9dbc2c0612ec 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/SubscriptionsImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/SubscriptionsImpl.java @@ -64,10 +64,14 @@ public SBSubscription call(SBSubscriptionInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName, String topicName, String subscriptionName) { SubscriptionsInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName, topicName, subscriptionName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public SBSubscription call(SBSubscriptionInner inner) { - return wrapModel(inner); + public Observable call(SBSubscriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBSubscription)wrapModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsImpl.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsImpl.java index c74872e74fc4..bfe3b6bff2d2 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsImpl.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsImpl.java @@ -67,10 +67,14 @@ public SBTopic call(SBTopicInner inner) { public Observable getAsync(String resourceGroupName, String namespaceName, String topicName) { TopicsInner client = this.inner(); return client.getAsync(resourceGroupName, namespaceName, topicName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public SBTopic call(SBTopicInner inner) { - return wrapModel(inner); + public Observable call(SBTopicInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SBTopic)wrapModel(inner)); + } } }); } @@ -107,10 +111,14 @@ private Observable getSBAuthorizationRuleInnerUsingTop public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { TopicsInner client = this.inner(); return client.getAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public TopicNamespaceSBAuthorizationRule call(SBAuthorizationRuleInner inner) { - return wrapTopicNamespaceSBAuthorizationRuleModel(inner); + public Observable call(SBAuthorizationRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TopicNamespaceSBAuthorizationRule)wrapTopicNamespaceSBAuthorizationRuleModel(inner)); + } } }); } diff --git a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsInner.java b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsInner.java index 9b25e5d91861..0f53da3820e3 100644 --- a/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsInner.java +++ b/sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/implementation/TopicsInner.java @@ -64,22 +64,6 @@ public TopicsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface TopicsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.v2017_04_01.Topics listByNamespace" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics") - 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.servicebus.v2017_04_01.Topics createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Body SBTopicInner 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.servicebus.v2017_04_01.Topics delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.servicebus.v2017_04_01.Topics get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") - Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.servicebus.v2017_04_01.Topics listAuthorizationRules" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules") Observable> listAuthorizationRules(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -104,127 +88,149 @@ interface TopicsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys") Observable> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.servicebus.v2017_04_01.Topics 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.servicebus.v2017_04_01.Topics listByNamespace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics") + 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.servicebus.v2017_04_01.Topics createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Body SBTopicInner 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.servicebus.v2017_04_01.Topics delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.servicebus.v2017_04_01.Topics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.servicebus.v2017_04_01.Topics 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.servicebus.v2017_04_01.Topics listByNamespaceNext" }) + @GET + Observable> listByNamespaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Gets all the topics in a namespace. + * Gets authorization rules for a topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param topicName The topic 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<SBTopicInner> object if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 topicName) { + ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName).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 topics in a namespace. + * Gets authorization rules for a topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param topicName The topic 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 topicName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - new Func1>>>() { + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listByNamespaceNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listAuthorizationRulesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Gets all the topics in a namespace. + * Gets authorization rules for a topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param topicName The topic name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBTopicInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 topicName) { + return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, topicName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Gets all the topics in a namespace. + * Gets authorization rules for a topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name + * @param topicName The topic name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBTopicInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 topicName) { + return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName) + .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 topics in a namespace. + * Gets authorization rules for a topic. * - * @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 topicName The topic name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 topicName) { 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 (topicName == null) { + throw new IllegalArgumentException("Parameter topicName 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, topicName, 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 topics in a namespace. + * Creates an authorization rule for the specified topic. * * @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 topicName The topic 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<SBTopicInner> object if successful. + * @return the SBAuthorizationRuleInner 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 SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).toBlocking().single().body(); } /** - * Gets all the topics in a namespace. + * Creates an authorization rule for the specified topic. * * @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 topicName The topic 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 topicName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights), serviceCallback); } /** - * Gets all the topics in a namespace. + * Creates an authorization rule for the specified topic. * * @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 topicName The topic 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<SBTopicInner> object + * @return the observable to the SBAuthorizationRuleInner 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 topicName, String authorizationRuleName, List rights) { + return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { + @Override + public SBAuthorizationRuleInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets all the topics in a namespace. + * Creates an authorization rule for the specified topic. * * @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<SBTopicInner> 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 topics 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 topicName The topic 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<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable>> listByNamespaceSinglePageAsync(final String resourceGroupName, final String namespaceName, final Integer skip, final Integer top) { + public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (topicName == null) { + throw new IllegalArgumentException("Parameter topicName 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); + SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); + parameters.withRights(rights); + return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, topicName, 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 a topic in the specified namespace. + * Returns the specified authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param parameters Parameters supplied to create a topic 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 SBTopicInner object if successful. + * @return the SBAuthorizationRuleInner object if successful. */ - public SBTopicInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).toBlocking().single().body(); + public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); } /** - * Creates a topic in the specified namespace. + * Returns the specified authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param parameters Parameters supplied to create a topic 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 topicName, SBTopicInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters), serviceCallback); + public ServiceFuture getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); } /** - * Creates a topic in the specified namespace. + * Returns the specified authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param parameters Parameters supplied to create a topic resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBTopicInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).map(new Func1, SBTopicInner>() { + public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { @Override - public SBTopicInner call(ServiceResponse response) { + public SBAuthorizationRuleInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates a topic in the specified namespace. + * Returns the specified authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param parameters Parameters supplied to create a topic resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBTopicInner object + * @return the observable to the SBAuthorizationRuleInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -435,22 +425,21 @@ public Observable> createOrUpdateWithServiceRespon if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getAuthorizationRule(resourceGroupName, namespaceName, topicName, 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 res }); } - 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 a topic from the specified namespace and resource group. + * Deletes a topic authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName) { - deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); } /** - * Deletes a topic from the specified namespace and resource group. + * Deletes a topic authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); + public ServiceFuture deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); } /** - * Deletes a topic from the specified namespace and resource group. + * Deletes a topic authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName) { - return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1, Void>() { + public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -513,15 +505,16 @@ public Void call(ServiceResponse response) { } /** - * Deletes a topic from the specified namespace and resource group. + * Deletes a topic authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName) { + public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.deleteAuthorizationRule(resourceGroupName, namespaceName, topicName, 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 } /** - * Returns a description for the specified topic. + * Gets the primary and secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 SBTopicInner object if successful. + * @return the AccessKeysInner object if successful. */ - public SBTopicInner get(String resourceGroupName, String namespaceName, String topicName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); } /** - * Returns a description for the specified topic. + * Gets the primary and secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); + public ServiceFuture listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); } /** - * Returns a description for the specified topic. + * Gets the primary and secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBTopicInner object + * @return the observable to the AccessKeysInner object */ - public Observable getAsync(String resourceGroupName, String namespaceName, String topicName) { - return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1, SBTopicInner>() { + public Observable listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, AccessKeysInner>() { @Override - public SBTopicInner call(ServiceResponse response) { + public AccessKeysInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a description for the specified topic. + * Gets the primary and secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SBTopicInner object + * @return the observable to the AccessKeysInner object */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -625,18 +625,21 @@ public Observable> getWithServiceResponseAsync(Str if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listKeys(resourceGroupName, namespaceName, topicName, 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 res }); } - 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 authorization rules for a topic. + * Regenerates primary or secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization 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<SBAuthorizationRuleInner> object if successful. + * @return the AccessKeysInner object if successful. */ - public PagedList listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String topicName) { - ServiceResponse> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName).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 topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).toBlocking().single().body(); } /** - * Gets authorization rules for a topic. + * Regenerates primary or secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization 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> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listAuthorizationRulesNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters), serviceCallback); } /** - * Gets authorization rules for a topic. + * Regenerates primary or secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBAuthorizationRuleInner> object + * @return the observable to the AccessKeysInner object */ - public Observable> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName) { - return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, topicName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + @Override + public AccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Gets authorization rules for a topic. + * Regenerates primary or secondary connection strings for the topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<SBAuthorizationRuleInner> object - */ - public Observable>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName) { - return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName) - .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 authorization rules for a topic. - * - ServiceResponse> * @param resourceGroupName Name of the Resource group within the Azure subscription. - ServiceResponse> * @param namespaceName The namespace name - ServiceResponse> * @param topicName The topic name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<SBAuthorizationRuleInner> 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 topicName) { + public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -756,19 +729,26 @@ public Observable>> listAuthoriza if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + Validator.validate(parameters); + return service.regenerateKeys(resourceGroupName, namespaceName, topicName, 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 }); } - 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 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 an authorization rule for the specified topic. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object if successful. + * @return the PagedList<SBTopicInner> object if successful. */ - public SBAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, 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 an authorization rule for the specified topic. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 topicName, String authorizationRuleName, List rights, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights), serviceCallback); + 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); } /** - * Creates an authorization rule for the specified topic. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBTopicInner> object */ - public Observable createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { - return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).map(new Func1, SBAuthorizationRuleInner>() { - @Override - public SBAuthorizationRuleInner call(ServiceResponse response) { - return response.body(); - } - }); + 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 an authorization rule for the specified topic. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBTopicInner> object */ - public Observable> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List rights) { + 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)); + } + }); + } + + /** + * Gets all the topics 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 PagedList<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + */ + 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 (topicName == null) { - throw new IllegalArgumentException("Parameter topicName 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); - SBAuthorizationRuleInner parameters = new SBAuthorizationRuleInner(); - parameters.withRights(rights); - return service.createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, topicName, 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); - } - /** - * Returns the specified authorization rule. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object if successful. + * @return the PagedList<SBTopicInner> object if successful. */ - public SBAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, 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(); + } + }; } /** - * Returns the specified authorization rule. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, 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); } /** - * Returns the specified authorization rule. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBTopicInner> object */ - public Observable getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { - return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, SBAuthorizationRuleInner>() { - @Override - public SBAuthorizationRuleInner 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(); + } + }); } /** - * Returns the specified authorization rule. + * Gets all the topics in a namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param topicName The topic 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 SBAuthorizationRuleInner object + * @return the observable to the PagedList<SBTopicInner> object */ - public Observable> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 topics 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<SBTopicInner> 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 (topicName == null) { - throw new IllegalArgumentException("Parameter topicName 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, topicName, 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 a topic authorization rule. + * Creates a topic in the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a topic 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 SBTopicInner object if successful. */ - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { - deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); + public SBTopicInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).toBlocking().single().body(); } /** - * Deletes a topic authorization rule. + * Creates a topic in the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a topic 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 topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters), serviceCallback); } /** - * Deletes a topic authorization rule. + * Creates a topic in the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a topic resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBTopicInner object */ - public Observable deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { - return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, Void>() { + public Observable createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).map(new Func1, SBTopicInner>() { @Override - public Void call(ServiceResponse response) { + public SBTopicInner call(ServiceResponse response) { return response.body(); } }); } /** - * Deletes a topic authorization rule. + * Creates a topic in the specified namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a topic resource. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the SBTopicInner object */ - public Observable> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, SBTopicInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1062,21 +1084,22 @@ public Observable> deleteAuthorizationRuleWithServiceRespo if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, 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, topicName, 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 primary and secondary connection strings for the topic. + * Deletes a topic from the specified namespace and resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body(); + public void delete(String resourceGroupName, String namespaceName, String topicName) { + deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); } /** - * Gets the primary and secondary connection strings for the topic. + * Deletes a topic from the specified namespace and resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, String authorizationRuleName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); } /** - * Gets the primary and secondary connection strings for the topic. + * Deletes a topic from the specified namespace and resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, String authorizationRuleName) { - return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1, AccessKeysInner>() { + public Observable deleteAsync(String resourceGroupName, String namespaceName, String topicName) { + return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).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 topic. + * Deletes a topic from the specified namespace and resource group. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic 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 topicName, String authorizationRuleName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1163,21 +1180,18 @@ public Observable> listKeysWithServiceResponseA if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.delete(resourceGroupName, namespaceName, topicName, 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 primary or secondary connection strings for the topic. + * Returns a description for the specified topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization 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 AccessKeysInner object if successful. + * @return the SBTopicInner object if successful. */ - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).toBlocking().single().body(); + public SBTopicInner get(String resourceGroupName, String namespaceName, String topicName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body(); } /** - * Regenerates primary or secondary connection strings for the topic. + * Returns a description for the specified topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization 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 regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback); } /** - * Regenerates primary or secondary connection strings for the topic. + * Returns a description for the specified topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBTopicInner object */ - public Observable regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).map(new Func1, AccessKeysInner>() { + public Observable getAsync(String resourceGroupName, String namespaceName, String topicName) { + return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1, SBTopicInner>() { @Override - public AccessKeysInner call(ServiceResponse response) { + public SBTopicInner call(ServiceResponse response) { return response.body(); } }); } /** - * Regenerates primary or secondary connection strings for the topic. + * Returns a description for the specified topic. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param topicName The topic name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AccessKeysInner object + * @return the observable to the SBTopicInner object */ - public Observable> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1267,25 +1274,18 @@ public Observable> regenerateKeysWithServiceRes if (topicName == null) { throw new IllegalArgumentException("Parameter topicName 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, topicName, authorizationRuleName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.get(resourceGroupName, namespaceName, topicName, 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 topics in a namespace. + * Gets authorization rules for a topic. * * @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<SBTopicInner> object if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 topics in a namespace. + * Gets authorization rules for a topic. * * @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 topics in a namespace. + * Gets authorization rules for a topic. * * @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<SBTopicInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 topics in a namespace. + * Gets authorization rules for a topic. * * @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<SBTopicInner> object + * @return the observable to the PagedList<SBAuthorizationRuleInner> 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 topics in a namespace. + * Gets authorization rules for a topic. * - 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<SBTopicInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBAuthorizationRuleInner> 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 authorization rules for a topic. + * Gets all the topics 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<SBAuthorizationRuleInner> object if successful. + * @return the PagedList<SBTopicInner> 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 authorization rules for a topic. + * Gets all the topics 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 authorization rules for a topic. + * Gets all the topics 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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBTopicInner> 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 authorization rules for a topic. + * Gets all the topics 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<SBAuthorizationRuleInner> object + * @return the observable to the PagedList<SBTopicInner> 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 authorization rules for a topic. + * Gets all the topics 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<SBAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SBTopicInner> 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 }); } - private ServiceResponse> 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); }