Skip to content
Open
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
@@ -0,0 +1,47 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.eventhub;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The MessagingRegionsProperties model.
*/
public class MessagingRegionsProperties {
/**
* Region code.
*/
@JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY)
private String code;

/**
* Full name of the region.
*/
@JsonProperty(value = "fullName", access = JsonProperty.Access.WRITE_ONLY)
private String fullName;

/**
* Get the code value.
*
* @return the code value
*/
public String code() {
return this.code;
}

/**
* Get the fullName value.
*
* @return the fullName value
*/
public String fullName() {
return this.fullName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import com.microsoft.azure.management.eventhub.RoleDisasterRecovery;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;

/**
* Single item in List or Get Alias(Disaster Recovery configuration) operation.
*/
@JsonFlatten
public class ArmDisasterRecoveryInner extends NestedResourceInner {
public class ArmDisasterRecoveryInner extends Resource {
/**
* Provisioning state of the Alias(Disaster Recovery configuration) -
* possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import com.microsoft.azure.management.eventhub.AccessRights;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;

/**
* Single item in a List or Get AuthorizationRule operation.
*/
@JsonFlatten
public class AuthorizationRuleInner extends NestedResourceInner {
public class AuthorizationRuleInner extends Resource {
/**
* The rights associated with the rule.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
import org.joda.time.DateTime;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;

/**
* Single item in List or Get Consumer group operation.
*/
@JsonFlatten
public class ConsumerGroupInner extends NestedResourceInner {
public class ConsumerGroupInner extends Resource {
/**
* Exact time the message was created.
*/
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package com.microsoft.azure.management.eventhub.implementation;

import com.microsoft.azure.Resource;
import com.microsoft.azure.management.eventhub.Sku;
import org.joda.time.DateTime;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -18,7 +17,7 @@
* Single Namespace item in List or Get Operation.
*/
@JsonFlatten
public class EHNamespaceInner extends Resource {
public class EHNamespaceInner extends TrackedResourceInner {
/**
* Properties of sku resource.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ public ConsumerGroupsInner consumerGroups() {
return this.consumerGroups;
}

/**
* The RegionsInner object to access its operations.
*/
private RegionsInner regions;

/**
* Gets the RegionsInner object to access its operations.
* @return the RegionsInner object.
*/
public RegionsInner regions() {
return this.regions;
}

/**
* Initializes an instance of EventHubManagementClient client.
*
Expand Down Expand Up @@ -237,6 +250,7 @@ protected void initialize() {
this.disasterRecoveryConfigs = new DisasterRecoveryConfigsInner(restClient().retrofit(), this);
this.eventHubs = new EventHubsInner(restClient().retrofit(), this);
this.consumerGroups = new ConsumerGroupsInner(restClient().retrofit(), this);
this.regions = new RegionsInner(restClient().retrofit(), this);
this.azureClient = new AzureClient(this);
}

Expand Down
Loading