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.
/**
* 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.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.management.servicebus.AccessRights;
import com.microsoft.azure.management.servicebus.Policykey;
import com.microsoft.azure.management.servicebus.RegenerateKeysParameters;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
An instance of this class provides access to all the operations defined
in Topics.
/**
* An instance of this class provides access to all the operations defined
* in Topics.
*/
public class TopicsInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private TopicsService service;
The service client containing this operation class. /** The service client containing this operation class. */
private ServiceBusManagementClientImpl client;
Initializes an instance of TopicsInner.
Params: - retrofit – the Retrofit instance built from a Retrofit Builder.
- client – the instance of the service client containing this operation class.
/**
* Initializes an instance of TopicsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public TopicsInner(Retrofit retrofit, ServiceBusManagementClientImpl client) {
this.service = retrofit.create(TopicsService.class);
this.client = client;
}
The interface defining all the services for Topics to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for Topics to be
* 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.Topics listByNamespace" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics")
Observable<Response<ResponseBody>> listByNamespace(@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.Topics createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}")
Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("subscriptionId") String subscriptionId, @Body TopicInner 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.Topics delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> 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.Topics get" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}")
Observable<Response<ResponseBody>> 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.Topics listAuthorizationRules" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules")
Observable<Response<ResponseBody>> 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);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.Topics createOrUpdateAuthorizationRule" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}")
Observable<Response<ResponseBody>> createOrUpdateAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SharedAccessAuthorizationRuleInner parameters, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.Topics getAuthorizationRule" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}")
Observable<Response<ResponseBody>> getAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.Topics deleteAuthorizationRule" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", method = "DELETE", hasBody = true)
Observable<Response<ResponseBody>> deleteAuthorizationRule(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.Topics listKeys" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys")
Observable<Response<ResponseBody>> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @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.Topics regenerateKeys" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys")
Observable<Response<ResponseBody>> regenerateKeys(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("topicName") String topicName, @Path("authorizationRuleName") String authorizationRuleName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateKeysParameters parameters, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicebus.Topics listByNamespaceNext" })
@GET
Observable<Response<ResponseBody>> 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.Topics listAuthorizationRulesNext" })
@GET
Observable<Response<ResponseBody>> listAuthorizationRulesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Gets all the topics in a namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<TopicInner> object if successful.
/**
* 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
* @throws CloudException 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<TopicInner> object if successful.
*/
public PagedList<TopicInner> listByNamespace(final String resourceGroupName, final String namespaceName) {
ServiceResponse<Page<TopicInner>> response = listByNamespaceSinglePageAsync(resourceGroupName, namespaceName).toBlocking().single();
return new PagedList<TopicInner>(response.body()) {
@Override
public Page<TopicInner> nextPage(String nextPageLink) {
return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the topics in a namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets all the topics in 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<List<TopicInner>> listByNamespaceAsync(final String resourceGroupName, final String namespaceName, final ListOperationCallback<TopicInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByNamespaceSinglePageAsync(resourceGroupName, namespaceName),
new Func1<String, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(String nextPageLink) {
return listByNamespaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the topics in a namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<TopicInner> object
/**
* 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 observable to the PagedList<TopicInner> object
*/
public Observable<Page<TopicInner>> listByNamespaceAsync(final String resourceGroupName, final String namespaceName) {
return listByNamespaceWithServiceResponseAsync(resourceGroupName, namespaceName)
.map(new Func1<ServiceResponse<Page<TopicInner>>, Page<TopicInner>>() {
@Override
public Page<TopicInner> call(ServiceResponse<Page<TopicInner>> response) {
return response.body();
}
});
}
Gets all the topics in a namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<TopicInner> object
/**
* 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 observable to the PagedList<TopicInner> object
*/
public Observable<ServiceResponse<Page<TopicInner>>> listByNamespaceWithServiceResponseAsync(final String resourceGroupName, final String namespaceName) {
return listByNamespaceSinglePageAsync(resourceGroupName, namespaceName)
.concatMap(new Func1<ServiceResponse<Page<TopicInner>>, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(ServiceResponse<Page<TopicInner>> 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
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<TopicInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the topics in a namespace.
*
ServiceResponse<PageImpl<TopicInner>> * @param resourceGroupName Name of the Resource group within the Azure subscription.
ServiceResponse<PageImpl<TopicInner>> * @param namespaceName The namespace name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<TopicInner>>> 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 (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(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<TopicInner>> result = listByNamespaceDelegate(response);
return Observable.just(new ServiceResponse<Page<TopicInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<TopicInner>> listByNamespaceDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<TopicInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<TopicInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Creates a topic in the specified namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- parameters – Parameters supplied to create a topic resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the TopicInner object if successful.
/**
* 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 parameters Parameters supplied to create a topic resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the TopicInner object if successful.
*/
public TopicInner createOrUpdate(String resourceGroupName, String namespaceName, String topicName, TopicInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).toBlocking().single().body();
}
Creates a topic in the specified namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- parameters – Parameters supplied to create a topic resource.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 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<TopicInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, TopicInner parameters, final ServiceCallback<TopicInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters), serviceCallback);
}
Creates a topic in the specified namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- parameters – Parameters supplied to create a topic resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the TopicInner object
/**
* 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 parameters Parameters supplied to create a topic resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopicInner object
*/
public Observable<TopicInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String topicName, TopicInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, parameters).map(new Func1<ServiceResponse<TopicInner>, TopicInner>() {
@Override
public TopicInner call(ServiceResponse<TopicInner> response) {
return response.body();
}
});
}
Creates a topic in the specified namespace.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- parameters – Parameters supplied to create a topic resource.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the TopicInner object
/**
* 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 parameters Parameters supplied to create a topic resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopicInner object
*/
public Observable<ServiceResponse<TopicInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, TopicInner 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 (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 (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<Response<ResponseBody>, Observable<ServiceResponse<TopicInner>>>() {
@Override
public Observable<ServiceResponse<TopicInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<TopicInner> clientResponse = createOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<TopicInner> createOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<TopicInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<TopicInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes a topic from the specified namespace and resource group.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException 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();
}
Deletes a topic from the specified namespace and resource group.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 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<Void> deleteAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback);
}
Deletes a topic from the specified namespace and resource group.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> deleteAsync(String resourceGroupName, String namespaceName, String topicName) {
return deleteWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a topic from the specified namespace and resource group.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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.");
}
return service.delete(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = deleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> deleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(204, new TypeToken<Void>() { }.getType())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Returns a description for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the TopicInner object if successful.
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the TopicInner object if successful.
*/
public TopicInner get(String resourceGroupName, String namespaceName, String topicName) {
return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).toBlocking().single().body();
}
Returns a description for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 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<TopicInner> getAsync(String resourceGroupName, String namespaceName, String topicName, final ServiceCallback<TopicInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName), serviceCallback);
}
Returns a description for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the TopicInner object
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopicInner object
*/
public Observable<TopicInner> getAsync(String resourceGroupName, String namespaceName, String topicName) {
return getWithServiceResponseAsync(resourceGroupName, namespaceName, topicName).map(new Func1<ServiceResponse<TopicInner>, TopicInner>() {
@Override
public TopicInner call(ServiceResponse<TopicInner> response) {
return response.body();
}
});
}
Returns a description for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the TopicInner object
/**
* 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.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopicInner object
*/
public Observable<ServiceResponse<TopicInner>> getWithServiceResponseAsync(String resourceGroupName, String namespaceName, 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.");
}
return service.get(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TopicInner>>>() {
@Override
public Observable<ServiceResponse<TopicInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<TopicInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<TopicInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<TopicInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<TopicInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets authorization rules for a topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<SharedAccessAuthorizationRuleInner> object if successful.
/**
* 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 CloudException 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<SharedAccessAuthorizationRuleInner> object if successful.
*/
public PagedList<SharedAccessAuthorizationRuleInner> listAuthorizationRules(final String resourceGroupName, final String namespaceName, final String topicName) {
ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> response = listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName).toBlocking().single();
return new PagedList<SharedAccessAuthorizationRuleInner>(response.body()) {
@Override
public Page<SharedAccessAuthorizationRuleInner> nextPage(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets authorization rules for a topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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<List<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName, final ListOperationCallback<SharedAccessAuthorizationRuleInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName),
new Func1<String, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets authorization rules for a topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<SharedAccessAuthorizationRuleInner> object
/**
* 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<SharedAccessAuthorizationRuleInner> object
*/
public Observable<Page<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesAsync(final String resourceGroupName, final String namespaceName, final String topicName) {
return listAuthorizationRulesWithServiceResponseAsync(resourceGroupName, namespaceName, topicName)
.map(new Func1<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>, Page<SharedAccessAuthorizationRuleInner>>() {
@Override
public Page<SharedAccessAuthorizationRuleInner> call(ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> response) {
return response.body();
}
});
}
Gets authorization rules for a topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<SharedAccessAuthorizationRuleInner> object
/**
* 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<SharedAccessAuthorizationRuleInner> object
*/
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String topicName) {
return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, topicName)
.concatMap(new Func1<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> 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
Returns: the PagedList<SharedAccessAuthorizationRuleInner> object wrapped in ServiceResponse
if successful.
/**
* Gets authorization rules for a topic.
*
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> * @param resourceGroupName Name of the Resource group within the Azure subscription.
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> * @param namespaceName The namespace name
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> * @param topicName The topic name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<SharedAccessAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> 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.");
}
return service.listAuthorizationRules(resourceGroupName, namespaceName, topicName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> result = listAuthorizationRulesDelegate(response);
return Observable.just(new ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<SharedAccessAuthorizationRuleInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<SharedAccessAuthorizationRuleInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Creates an authorizatio rule for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- rights – The rights associated with the rule.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the SharedAccessAuthorizationRuleInner object if successful.
/**
* Creates an authorizatio rule 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 authorizationrule name.
* @param rights The rights associated with the rule.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the SharedAccessAuthorizationRuleInner object if successful.
*/
public SharedAccessAuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List<AccessRights> rights) {
return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).toBlocking().single().body();
}
Creates an authorizatio rule for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- rights – The rights associated with the rule.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Creates an authorizatio rule 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 authorizationrule 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<SharedAccessAuthorizationRuleInner> createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List<AccessRights> rights, final ServiceCallback<SharedAccessAuthorizationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights), serviceCallback);
}
Creates an authorizatio rule for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- rights – The rights associated with the rule.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the SharedAccessAuthorizationRuleInner object
/**
* Creates an authorizatio rule 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 authorizationrule name.
* @param rights The rights associated with the rule.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SharedAccessAuthorizationRuleInner object
*/
public Observable<SharedAccessAuthorizationRuleInner> createOrUpdateAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List<AccessRights> rights) {
return createOrUpdateAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, rights).map(new Func1<ServiceResponse<SharedAccessAuthorizationRuleInner>, SharedAccessAuthorizationRuleInner>() {
@Override
public SharedAccessAuthorizationRuleInner call(ServiceResponse<SharedAccessAuthorizationRuleInner> response) {
return response.body();
}
});
}
Creates an authorizatio rule for the specified topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- rights – The rights associated with the rule.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the SharedAccessAuthorizationRuleInner object
/**
* Creates an authorizatio rule 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 authorizationrule name.
* @param rights The rights associated with the rule.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SharedAccessAuthorizationRuleInner object
*/
public Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, List<AccessRights> 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.");
}
if (rights == null) {
throw new IllegalArgumentException("Parameter rights is required and cannot be null.");
}
Validator.validate(rights);
SharedAccessAuthorizationRuleInner parameters = new SharedAccessAuthorizationRuleInner();
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<Response<ResponseBody>, Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>>>() {
@Override
public Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<SharedAccessAuthorizationRuleInner> clientResponse = createOrUpdateAuthorizationRuleDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<SharedAccessAuthorizationRuleInner> createOrUpdateAuthorizationRuleDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<SharedAccessAuthorizationRuleInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<SharedAccessAuthorizationRuleInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Returns the specified authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the SharedAccessAuthorizationRuleInner object if successful.
/**
* 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 authorizationRuleName The authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the SharedAccessAuthorizationRuleInner object if successful.
*/
public SharedAccessAuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body();
}
Returns the specified authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 authorizationRuleName The authorizationrule 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<SharedAccessAuthorizationRuleInner> getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback<SharedAccessAuthorizationRuleInner> serviceCallback) {
return ServiceFuture.fromResponse(getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback);
}
Returns the specified authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the SharedAccessAuthorizationRuleInner object
/**
* 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 authorizationRuleName The authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SharedAccessAuthorizationRuleInner object
*/
public Observable<SharedAccessAuthorizationRuleInner> getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1<ServiceResponse<SharedAccessAuthorizationRuleInner>, SharedAccessAuthorizationRuleInner>() {
@Override
public SharedAccessAuthorizationRuleInner call(ServiceResponse<SharedAccessAuthorizationRuleInner> response) {
return response.body();
}
});
}
Returns the specified authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the SharedAccessAuthorizationRuleInner object
/**
* 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 authorizationRuleName The authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the SharedAccessAuthorizationRuleInner object
*/
public Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>> getAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (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<Response<ResponseBody>, Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>>>() {
@Override
public Observable<ServiceResponse<SharedAccessAuthorizationRuleInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<SharedAccessAuthorizationRuleInner> clientResponse = getAuthorizationRuleDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<SharedAccessAuthorizationRuleInner> getAuthorizationRuleDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<SharedAccessAuthorizationRuleInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<SharedAccessAuthorizationRuleInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Deletes a topic authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body();
}
Deletes a topic authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 authorizationrule 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<Void> deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback);
}
Deletes a topic authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<Void> deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return deleteAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
}
Deletes a topic authorization rule.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceResponse
object if successful.
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable<ServiceResponse<Void>> deleteAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (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.deleteAuthorizationRule(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = deleteAuthorizationRuleDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<Void> deleteAuthorizationRuleDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
.register(204, new TypeToken<Void>() { }.getType())
.register(200, new TypeToken<Void>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets the primary and secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceListKeysInner object if successful.
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the ResourceListKeysInner object if successful.
*/
public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body();
}
Gets the primary and secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 authorizationrule 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<ResourceListKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback<ResourceListKeysInner> serviceCallback) {
return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback);
}
Gets the primary and secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ResourceListKeysInner> listKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return listKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1<ServiceResponse<ResourceListKeysInner>, ResourceListKeysInner>() {
@Override
public ResourceListKeysInner call(ServiceResponse<ResourceListKeysInner> response) {
return response.body();
}
});
}
Gets the primary and secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ServiceResponse<ResourceListKeysInner>> listKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (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<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {
@Override
public Observable<ServiceResponse<ResourceListKeysInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceListKeysInner> clientResponse = listKeysDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceListKeysInner> listKeysDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceListKeysInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceListKeysInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceListKeysInner object if successful.
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the ResourceListKeysInner object if successful.
*/
public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).toBlocking().single().body();
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 authorizationrule 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<ResourceListKeysInner> regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, final ServiceCallback<ResourceListKeysInner> serviceCallback) {
return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName), serviceCallback);
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ResourceListKeysInner> regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).map(new Func1<ServiceResponse<ResourceListKeysInner>, ResourceListKeysInner>() {
@Override
public ResourceListKeysInner call(ServiceResponse<ResourceListKeysInner> response) {
return response.body();
}
});
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ServiceResponse<ResourceListKeysInner>> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, 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 (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.");
}
final Policykey policykey = null;
RegenerateKeysParameters parameters = new RegenerateKeysParameters();
parameters.withPolicykey(null);
return service.regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {
@Override
public Observable<ServiceResponse<ResourceListKeysInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceListKeysInner> clientResponse = regenerateKeysDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- policykey – Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the ResourceListKeysInner object if successful.
/**
* 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 authorizationrule name.
* @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the ResourceListKeysInner object if successful.
*/
public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, Policykey policykey) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, policykey).toBlocking().single().body();
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- policykey – Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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 authorizationrule name.
* @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<ResourceListKeysInner> regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, Policykey policykey, final ServiceCallback<ResourceListKeysInner> serviceCallback) {
return ServiceFuture.fromResponse(regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, policykey), serviceCallback);
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- policykey – Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ResourceListKeysInner> regenerateKeysAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, Policykey policykey) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, policykey).map(new Func1<ServiceResponse<ResourceListKeysInner>, ResourceListKeysInner>() {
@Override
public ResourceListKeysInner call(ServiceResponse<ResourceListKeysInner> response) {
return response.body();
}
});
}
Regenerates primary or secondary connection strings for the topic.
Params: - resourceGroupName – Name of the Resource group within the Azure subscription.
- namespaceName – The namespace name
- topicName – The topic name.
- authorizationRuleName – The authorizationrule name.
- policykey – Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the ResourceListKeysInner object
/**
* 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 authorizationrule name.
* @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceListKeysInner object
*/
public Observable<ServiceResponse<ResourceListKeysInner>> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, Policykey policykey) {
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.");
}
RegenerateKeysParameters parameters = new RegenerateKeysParameters();
parameters.withPolicykey(policykey);
return service.regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {
@Override
public Observable<ServiceResponse<ResourceListKeysInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceListKeysInner> clientResponse = regenerateKeysDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<ResourceListKeysInner> regenerateKeysDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<ResourceListKeysInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<ResourceListKeysInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets all the topics in a namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<TopicInner> object if successful.
/**
* 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 CloudException 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<TopicInner> object if successful.
*/
public PagedList<TopicInner> listByNamespaceNext(final String nextPageLink) {
ServiceResponse<Page<TopicInner>> response = listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<TopicInner>(response.body()) {
@Override
public Page<TopicInner> nextPage(String nextPageLink) {
return listByNamespaceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets all the topics in a namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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
* @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<List<TopicInner>> listByNamespaceNextAsync(final String nextPageLink, final ServiceFuture<List<TopicInner>> serviceFuture, final ListOperationCallback<TopicInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByNamespaceNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(String nextPageLink) {
return listByNamespaceNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets all the topics in a namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<TopicInner> object
/**
* 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<TopicInner> object
*/
public Observable<Page<TopicInner>> listByNamespaceNextAsync(final String nextPageLink) {
return listByNamespaceNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<TopicInner>>, Page<TopicInner>>() {
@Override
public Page<TopicInner> call(ServiceResponse<Page<TopicInner>> response) {
return response.body();
}
});
}
Gets all the topics in a namespace.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<TopicInner> object
/**
* 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<TopicInner> object
*/
public Observable<ServiceResponse<Page<TopicInner>>> listByNamespaceNextWithServiceResponseAsync(final String nextPageLink) {
return listByNamespaceNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<TopicInner>>, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(ServiceResponse<Page<TopicInner>> 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 nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<TopicInner> object wrapped in ServiceResponse
if successful.
/**
* Gets all the topics in a namespace.
*
ServiceResponse<PageImpl<TopicInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<TopicInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<TopicInner>>> 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.listByNamespaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<TopicInner>>>>() {
@Override
public Observable<ServiceResponse<Page<TopicInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<TopicInner>> result = listByNamespaceNextDelegate(response);
return Observable.just(new ServiceResponse<Page<TopicInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<TopicInner>> listByNamespaceNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<TopicInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<TopicInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets authorization rules for a topic.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the PagedList<SharedAccessAuthorizationRuleInner> object if successful.
/**
* 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 CloudException 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<SharedAccessAuthorizationRuleInner> object if successful.
*/
public PagedList<SharedAccessAuthorizationRuleInner> listAuthorizationRulesNext(final String nextPageLink) {
ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> response = listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<SharedAccessAuthorizationRuleInner>(response.body()) {
@Override
public Page<SharedAccessAuthorizationRuleInner> nextPage(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
Gets authorization rules for a topic.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
- serviceFuture – the ServiceFuture object tracking the Retrofit calls
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* 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
* @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<List<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesNextAsync(final String nextPageLink, final ServiceFuture<List<SharedAccessAuthorizationRuleInner>> serviceFuture, final ListOperationCallback<SharedAccessAuthorizationRuleInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAuthorizationRulesNextSinglePageAsync(nextPageLink),
new Func1<String, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
Gets authorization rules for a topic.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<SharedAccessAuthorizationRuleInner> object
/**
* 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<SharedAccessAuthorizationRuleInner> object
*/
public Observable<Page<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesNextAsync(final String nextPageLink) {
return listAuthorizationRulesNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>, Page<SharedAccessAuthorizationRuleInner>>() {
@Override
public Page<SharedAccessAuthorizationRuleInner> call(ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> response) {
return response.body();
}
});
}
Gets authorization rules for a topic.
Params: - nextPageLink – The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the PagedList<SharedAccessAuthorizationRuleInner> object
/**
* 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<SharedAccessAuthorizationRuleInner> object
*/
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> listAuthorizationRulesNextWithServiceResponseAsync(final String nextPageLink) {
return listAuthorizationRulesNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(ServiceResponse<Page<SharedAccessAuthorizationRuleInner>> 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 nextPageLink The NextLink from the previous successful call to List operation.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the PagedList<SharedAccessAuthorizationRuleInner> object wrapped in ServiceResponse
if successful.
/**
* Gets authorization rules for a topic.
*
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<SharedAccessAuthorizationRuleInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> 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<Response<ResponseBody>, Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> result = listAuthorizationRulesNextDelegate(response);
return Observable.just(new ServiceResponse<Page<SharedAccessAuthorizationRuleInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<PageImpl<SharedAccessAuthorizationRuleInner>> listAuthorizationRulesNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<SharedAccessAuthorizationRuleInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<SharedAccessAuthorizationRuleInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}