Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ interface ConsumerGroupsService {

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.ConsumerGroups listByEventHub" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups")
Observable<Response<ResponseBody>> listByEventHub(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Observable<Response<ResponseBody>> listByEventHub(@Path("resourceGroupName") String resourceGroupName, @Path("namespaceName") String namespaceName, @Path("eventHubName") String eventHubName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skip") Integer skip, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventhub.ConsumerGroups listByEventHubNext" })
@GET
Expand Down Expand Up @@ -569,16 +569,152 @@ public Observable<ServiceResponse<Page<ConsumerGroupInner>>> call(ServiceRespons
});
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param eventHubName The Event Hub name
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList&lt;ConsumerGroupInner&gt; object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> listByEventHubSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (namespaceName == null) {
throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
}
if (eventHubName == null) {
throw new IllegalArgumentException("Parameter eventHubName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final Integer skip = null;
final Integer top = null;
return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ConsumerGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ConsumerGroupInner>> result = listByEventHubDelegate(response);
return Observable.just(new ServiceResponse<Page<ConsumerGroupInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param eventHubName The Event Hub name
* @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.
* @param top May be used to limit the number of results to the most recent N usageDetails.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList&lt;ConsumerGroupInner&gt; object if successful.
*/
public PagedList<ConsumerGroupInner> listByEventHub(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) {
ServiceResponse<Page<ConsumerGroupInner>> response = listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top).toBlocking().single();
return new PagedList<ConsumerGroupInner>(response.body()) {
@Override
public Page<ConsumerGroupInner> nextPage(String nextPageLink) {
return listByEventHubNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param eventHubName The Event Hub name
* @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.
* @param top May be used to limit the number of results to the most recent N usageDetails.
* @param 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<ConsumerGroupInner>> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top, final ListOperationCallback<ConsumerGroupInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top),
new Func1<String, Observable<ServiceResponse<Page<ConsumerGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> call(String nextPageLink) {
return listByEventHubNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param eventHubName The Event Hub name
* @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.
* @param top May be used to limit the number of results to the most recent N usageDetails.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList&lt;ConsumerGroupInner&gt; object
*/
public Observable<Page<ConsumerGroupInner>> listByEventHubAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) {
return listByEventHubWithServiceResponseAsync(resourceGroupName, namespaceName, eventHubName, skip, top)
.map(new Func1<ServiceResponse<Page<ConsumerGroupInner>>, Page<ConsumerGroupInner>>() {
@Override
public Page<ConsumerGroupInner> call(ServiceResponse<Page<ConsumerGroupInner>> response) {
return response.body();
}
});
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param eventHubName The Event Hub name
* @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.
* @param top May be used to limit the number of results to the most recent N usageDetails.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList&lt;ConsumerGroupInner&gt; object
*/
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> listByEventHubWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) {
return listByEventHubSinglePageAsync(resourceGroupName, namespaceName, eventHubName, skip, top)
.concatMap(new Func1<ServiceResponse<Page<ConsumerGroupInner>>, Observable<ServiceResponse<Page<ConsumerGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> call(ServiceResponse<Page<ConsumerGroupInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByEventHubNextWithServiceResponseAsync(nextPageLink));
}
});
}

/**
* Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
*
ServiceResponse<PageImpl<ConsumerGroupInner>> * @param resourceGroupName Name of the resource group within the azure subscription.
ServiceResponse<PageImpl<ConsumerGroupInner>> * @param namespaceName The Namespace name
ServiceResponse<PageImpl<ConsumerGroupInner>> * @param eventHubName The Event Hub name
ServiceResponse<PageImpl<ConsumerGroupInner>> * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls.
ServiceResponse<PageImpl<ConsumerGroupInner>> * @param top May be used to limit the number of results to the most recent N usageDetails.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList&lt;ConsumerGroupInner&gt; object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> listByEventHubSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName) {
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> listByEventHubSinglePageAsync(final String resourceGroupName, final String namespaceName, final String eventHubName, final Integer skip, final Integer top) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
Expand All @@ -594,7 +730,7 @@ public Observable<ServiceResponse<Page<ConsumerGroupInner>>> listByEventHubSingl
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
return service.listByEventHub(resourceGroupName, namespaceName, eventHubName, this.client.subscriptionId(), this.client.apiVersion(), skip, top, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ConsumerGroupInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ConsumerGroupInner>>> call(Response<ResponseBody> response) {
Expand Down
Loading