From 22f1820a673d14d1543abab1a51ebfdbf3700fbf Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 1 Apr 2020 05:27:11 +0000 Subject: [PATCH] Generated from 97dbb97f6e4284364801d10afcd2fb45d7e910a8 missing property --- .../mgmt-v2020_04_01_preview/pom.xml | 4 +- .../v2020_04_01_preview/ConnectionState.java | 2 +- .../v2020_04_01_preview/EventChannel.java | 33 +- .../EventChannelFilter.java | 163 +++++++++ .../PartnerRegistrationUpdateParameters.java | 27 ++ .../PartnerTopicEventSubscriptions.java | 2 +- .../PrivateEndpointConnection.java | 50 ++- .../SystemTopicEventSubscriptions.java | 2 +- .../eventgrid/v2020_04_01_preview/Topic.java | 2 +- .../implementation/EventChannelImpl.java | 12 + .../implementation/EventChannelInner.java | 27 ++ .../implementation/EventChannelsInner.java | 95 ++++- .../PartnerTopicEventSubscriptionsImpl.java | 10 +- .../PartnerTopicEventSubscriptionsInner.java | 345 ++++++++++++++++-- .../implementation/PartnerTopicImpl.java | 6 + .../PrivateEndpointConnectionImpl.java | 28 +- .../PrivateEndpointConnectionInner.java | 2 +- .../PrivateEndpointConnectionsInner.java | 54 ++- .../SystemTopicEventSubscriptionsImpl.java | 10 +- .../SystemTopicEventSubscriptionsInner.java | 345 ++++++++++++++++-- .../implementation/TopicInner.java | 6 +- 21 files changed, 1122 insertions(+), 103 deletions(-) create mode 100644 sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannelFilter.java diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml b/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml index 20c41d4a513a3..fd1103625787f 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-eventgrid - 1.0.0-beta-2 + 1.0.0-beta jar Microsoft Azure SDK for EventGrid Management This package contains Microsoft EventGrid Management SDK. diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/ConnectionState.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/ConnectionState.java index 0232caa28ee81..3e2a7a6f4da19 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/ConnectionState.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/ConnectionState.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * ConnectionState Information. + * ConnectionState information. */ public class ConnectionState { /** diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannel.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannel.java index bffb2508d2396..73924194e0ee4 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannel.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannel.java @@ -27,6 +27,11 @@ public interface EventChannel extends HasInner, Indexable, Re */ EventChannelDestination destination(); + /** + * @return the filter value. + */ + EventChannelFilter filter(); + /** * @return the id value. */ @@ -93,6 +98,18 @@ interface WithDestination { WithCreate withDestination(EventChannelDestination destination); } + /** + * The stage of the eventchannel definition allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event channel + * @return the next definition stage + */ + WithCreate withFilter(EventChannelFilter filter); + } + /** * The stage of the eventchannel definition allowing to specify Source. */ @@ -110,13 +127,13 @@ interface WithSource { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, DefinitionStages.WithDestination, DefinitionStages.WithSource { + interface WithCreate extends Creatable, DefinitionStages.WithDestination, DefinitionStages.WithFilter, DefinitionStages.WithSource { } } /** * The template for a EventChannel update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithDestination, UpdateStages.WithSource { + interface Update extends Appliable, UpdateStages.WithDestination, UpdateStages.WithFilter, UpdateStages.WithSource { } /** @@ -135,6 +152,18 @@ interface WithDestination { Update withDestination(EventChannelDestination destination); } + /** + * The stage of the eventchannel update allowing to specify Filter. + */ + interface WithFilter { + /** + * Specifies filter. + * @param filter Information about the filter for the event channel + * @return the next update stage + */ + Update withFilter(EventChannelFilter filter); + } + /** * The stage of the eventchannel update allowing to specify Source. */ diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannelFilter.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannelFilter.java new file mode 100644 index 0000000000000..c82965bccc55d --- /dev/null +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/EventChannelFilter.java @@ -0,0 +1,163 @@ +/** + * 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.eventgrid.v2020_04_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter for the Event Channel. + */ +public class EventChannelFilter { + /** + * An optional string to filter events for an event channel based on a + * resource path prefix. + * The format of this depends on the publisher of the events. Wildcard + * characters are not supported in this path. + */ + @JsonProperty(value = "subjectBeginsWith") + private String subjectBeginsWith; + + /** + * An optional string to filter events for an event channel based on a + * resource path suffix. + * Wildcard characters are not supported in this path. + */ + @JsonProperty(value = "subjectEndsWith") + private String subjectEndsWith; + + /** + * A list of applicable event types that need to be part of the event + * channel. If it is desired to subscribe to all default event types, set + * the IncludedEventTypes to null. + */ + @JsonProperty(value = "includedEventTypes") + private List includedEventTypes; + + /** + * Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the + * filter + * should be compared in a case sensitive manner. + */ + @JsonProperty(value = "isSubjectCaseSensitive") + private Boolean isSubjectCaseSensitive; + + /** + * An array of advanced filters that are used for filtering event channels. + */ + @JsonProperty(value = "advancedFilters") + private List advancedFilters; + + /** + * Get an optional string to filter events for an event channel based on a resource path prefix. + The format of this depends on the publisher of the events. Wildcard characters are not supported in this path. + * + * @return the subjectBeginsWith value + */ + public String subjectBeginsWith() { + return this.subjectBeginsWith; + } + + /** + * Set an optional string to filter events for an event channel based on a resource path prefix. + The format of this depends on the publisher of the events. Wildcard characters are not supported in this path. + * + * @param subjectBeginsWith the subjectBeginsWith value to set + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withSubjectBeginsWith(String subjectBeginsWith) { + this.subjectBeginsWith = subjectBeginsWith; + return this; + } + + /** + * Get an optional string to filter events for an event channel based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @return the subjectEndsWith value + */ + public String subjectEndsWith() { + return this.subjectEndsWith; + } + + /** + * Set an optional string to filter events for an event channel based on a resource path suffix. + Wildcard characters are not supported in this path. + * + * @param subjectEndsWith the subjectEndsWith value to set + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withSubjectEndsWith(String subjectEndsWith) { + this.subjectEndsWith = subjectEndsWith; + return this; + } + + /** + * Get a list of applicable event types that need to be part of the event channel. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @return the includedEventTypes value + */ + public List includedEventTypes() { + return this.includedEventTypes; + } + + /** + * Set a list of applicable event types that need to be part of the event channel. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. + * + * @param includedEventTypes the includedEventTypes value to set + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withIncludedEventTypes(List includedEventTypes) { + this.includedEventTypes = includedEventTypes; + return this; + } + + /** + * Get specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @return the isSubjectCaseSensitive value + */ + public Boolean isSubjectCaseSensitive() { + return this.isSubjectCaseSensitive; + } + + /** + * Set specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. + * + * @param isSubjectCaseSensitive the isSubjectCaseSensitive value to set + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withIsSubjectCaseSensitive(Boolean isSubjectCaseSensitive) { + this.isSubjectCaseSensitive = isSubjectCaseSensitive; + return this; + } + + /** + * Get an array of advanced filters that are used for filtering event channels. + * + * @return the advancedFilters value + */ + public List advancedFilters() { + return this.advancedFilters; + } + + /** + * Set an array of advanced filters that are used for filtering event channels. + * + * @param advancedFilters the advancedFilters value to set + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withAdvancedFilters(List advancedFilters) { + this.advancedFilters = advancedFilters; + return this; + } + +} diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerRegistrationUpdateParameters.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerRegistrationUpdateParameters.java index 567694ba34bc8..752645572a9d0 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerRegistrationUpdateParameters.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerRegistrationUpdateParameters.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.eventgrid.v2020_04_01_preview; +import java.util.Map; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,6 +16,12 @@ * Properties of the Partner Registration update. */ public class PartnerRegistrationUpdateParameters { + /** + * Tags of the partner registration resource. + */ + @JsonProperty(value = "tags") + private Map tags; + /** * Name of the partner topic type. */ @@ -59,6 +66,26 @@ public class PartnerRegistrationUpdateParameters { @JsonProperty(value = "authorizedAzureSubscriptionIds") private List authorizedAzureSubscriptionIds; + /** + * Get tags of the partner registration resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags of the partner registration resource. + * + * @param tags the tags value to set + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + /** * Get name of the partner topic type. * diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerTopicEventSubscriptions.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerTopicEventSubscriptions.java index 325d1a23e8e6b..87726bc2bde3d 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerTopicEventSubscriptions.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PartnerTopicEventSubscriptions.java @@ -51,7 +51,7 @@ public interface PartnerTopicEventSubscriptions extends SupportsCreating listByPartnerTopicAsync(String resourceGroupName, String partnerTopicName); + Observable listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName); /** * Delete an event subscription of a partner topic. diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PrivateEndpointConnection.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PrivateEndpointConnection.java index 98d0e91099c2f..43393fbbbe3ab 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PrivateEndpointConnection.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/PrivateEndpointConnection.java @@ -59,12 +59,60 @@ public interface PrivateEndpointConnection extends HasInner { + interface Update extends Appliable, UpdateStages.WithGroupIds, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, UpdateStages.WithProvisioningState { } /** * Grouping of PrivateEndpointConnection update stages. */ interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify GroupIds. + */ + interface WithGroupIds { + /** + * Specifies groupIds. + * @param groupIds GroupIds from the private link service resource + * @return the next update stage + */ + Update withGroupIds(List groupIds); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The Private Endpoint resource for this Connection + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Details about the state of the connection + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(ResourceProvisioningState provisioningState); + } + } } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/SystemTopicEventSubscriptions.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/SystemTopicEventSubscriptions.java index 2217f9da2a7df..59419f70ad940 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/SystemTopicEventSubscriptions.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/SystemTopicEventSubscriptions.java @@ -51,7 +51,7 @@ public interface SystemTopicEventSubscriptions extends SupportsCreating listBySystemTopicAsync(String resourceGroupName, String systemTopicName); + Observable listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName); /** * Delete an event subscription of a system topic. diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java index 43fad66bd5586..6647d0923dc1d 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/Topic.java @@ -152,7 +152,7 @@ interface WithInputSchemaMapping { interface WithPrivateEndpointConnections { /** * Specifies privateEndpointConnections. - * @param privateEndpointConnections List of private endpoint connections + * @param privateEndpointConnections the privateEndpointConnections parameter value * @return the next definition stage */ WithCreate withPrivateEndpointConnections(List privateEndpointConnections); diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelImpl.java index e8dd6c4cdd0c7..c6462b19b3fe9 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelSource; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelDestination; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelFilter; class EventChannelImpl extends CreatableUpdatableImpl implements EventChannel, EventChannel.Definition, EventChannel.Update { private final EventGridManager manager; @@ -77,6 +78,11 @@ public EventChannelDestination destination() { return this.inner().destination(); } + @Override + public EventChannelFilter filter() { + return this.inner().filter(); + } + @Override public String id() { return this.inner().id(); @@ -115,6 +121,12 @@ public EventChannelImpl withDestination(EventChannelDestination destination) { return this; } + @Override + public EventChannelImpl withFilter(EventChannelFilter filter) { + this.inner().withFilter(filter); + return this; + } + @Override public EventChannelImpl withSource(EventChannelSource source) { this.inner().withSource(source); diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelInner.java index 434bd4baad8b1..c44c91c0d00cd 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelInner.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelSource; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelDestination; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelProvisioningState; +import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventChannelFilter; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.ProxyResource; @@ -40,6 +41,12 @@ public class EventChannelInner extends ProxyResource { @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private EventChannelProvisioningState provisioningState; + /** + * Information about the filter for the event channel. + */ + @JsonProperty(value = "properties.filter") + private EventChannelFilter filter; + /** * Get source of the event channel. This represents a unique resource in the partner's resource model. * @@ -89,4 +96,24 @@ public EventChannelProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get information about the filter for the event channel. + * + * @return the filter value + */ + public EventChannelFilter filter() { + return this.filter; + } + + /** + * Set information about the filter for the event channel. + * + * @param filter the filter value to set + * @return the EventChannelInner object itself. + */ + public EventChannelInner withFilter(EventChannelFilter filter) { + this.filter = filter; + return this; + } + } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelsInner.java index 7e53f625ea4f0..c4fcf1ade0a80 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/EventChannelsInner.java @@ -73,6 +73,10 @@ interface EventChannelsService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("partnerNamespaceName") String partnerNamespaceName, @Path("eventChannelName") String eventChannelName, @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.eventgrid.v2020_04_01_preview.EventChannels beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("partnerNamespaceName") String partnerNamespaceName, @Path("eventChannelName") String eventChannelName, @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.eventgrid.v2020_04_01_preview.EventChannels listByPartnerNamespace" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels") Observable> listByPartnerNamespace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("partnerNamespaceName") String partnerNamespaceName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -297,7 +301,7 @@ private ServiceResponse createOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String partnerN * @param partnerNamespaceName Name of the partner namespace. * @param eventChannelName Name of the event channel. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable deleteAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { return deleteWithServiceResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName).map(new Func1, Void>() { @@ -342,7 +346,7 @@ public Void call(ServiceResponse response) { * @param partnerNamespaceName Name of the partner namespace. * @param eventChannelName Name of the event channel. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { if (this.client.subscriptionId() == null) { @@ -360,12 +364,91 @@ public Observable> deleteWithServiceResponseAsync(String r if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.delete(this.client.subscriptionId(), resourceGroupName, partnerNamespaceName, eventChannelName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, partnerNamespaceName, eventChannelName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an event channel. + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 beginDelete(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName).toBlocking().single().body(); + } + + /** + * Delete an event channel. + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName), serviceCallback); + } + + /** + * Delete an event channel. + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an event channel. + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (partnerNamespaceName == null) { + throw new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null."); + } + if (eventChannelName == null) { + throw new IllegalArgumentException("Parameter eventChannelName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, partnerNamespaceName, eventChannelName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -374,7 +457,7 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsImpl.java index 5186e87bb8798..49ae05f7912eb 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsImpl.java @@ -14,7 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; -import java.util.List; +import com.microsoft.azure.Page; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventSubscriptionFullUrl; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PartnerTopicEventSubscription; @@ -56,13 +56,13 @@ public EventSubscriptionFullUrl call(EventSubscriptionFullUrlInner inner) { } @Override - public Observable listByPartnerTopicAsync(String resourceGroupName, String partnerTopicName) { + public Observable listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName) { PartnerTopicEventSubscriptionsInner client = this.inner(); return client.listByPartnerTopicAsync(resourceGroupName, partnerTopicName) - .flatMap(new Func1, Observable>() { + .flatMapIterable(new Func1, Iterable>() { @Override - public Observable call(List innerList) { - return Observable.from(innerList); + public Iterable call(Page page) { + return page.items(); } }) .map(new Func1() { diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsInner.java index c28aec187f15e..12f919e937116 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicEventSubscriptionsInner.java @@ -10,8 +10,12 @@ 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.eventgrid.v2020_04_01_preview.EventSubscriptionUpdateParameters; +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; @@ -29,6 +33,7 @@ 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; @@ -93,7 +98,11 @@ interface PartnerTopicEventSubscriptionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PartnerTopicEventSubscriptions listByPartnerTopic" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions") - Observable> listByPartnerTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("partnerTopicName") String partnerTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByPartnerTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("partnerTopicName") String partnerTopicName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.eventgrid.v2020_04_01_preview.PartnerTopicEventSubscriptions listByPartnerTopicNext" }) + @GET + Observable> listByPartnerTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -862,10 +871,16 @@ private ServiceResponse getFullUrlDelegate(Respon * @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 List<EventSubscriptionInner> object if successful. + * @return the PagedList<EventSubscriptionInner> object if successful. */ - public List listByPartnerTopic(String resourceGroupName, String partnerTopicName) { - return listByPartnerTopicWithServiceResponseAsync(resourceGroupName, partnerTopicName).toBlocking().single().body(); + public PagedList listByPartnerTopic(final String resourceGroupName, final String partnerTopicName) { + ServiceResponse> response = listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -878,8 +893,96 @@ public List listByPartnerTopic(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByPartnerTopicAsync(String resourceGroupName, String partnerTopicName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByPartnerTopicWithServiceResponseAsync(resourceGroupName, partnerTopicName), serviceCallback); + public ServiceFuture> listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName) { + return listByPartnerTopicWithServiceResponseAsync(resourceGroupName, partnerTopicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listByPartnerTopicWithServiceResponseAsync(final String resourceGroupName, final String partnerTopicName) { + return listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByPartnerTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByPartnerTopicSinglePageAsync(final String resourceGroupName, final String partnerTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (partnerTopicName == null) { + throw new IllegalArgumentException("Parameter partnerTopicName 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 String filter = null; + final Integer top = null; + return service.listByPartnerTopic(this.client.subscriptionId(), resourceGroupName, partnerTopicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByPartnerTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); } /** @@ -888,16 +991,66 @@ public ServiceFuture> listByPartnerTopicAsync(Strin * * @param resourceGroupName The name of the resource group within the user's subscription. * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<EventSubscriptionInner> object + * @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<EventSubscriptionInner> object if successful. */ - public Observable> listByPartnerTopicAsync(String resourceGroupName, String partnerTopicName) { - return listByPartnerTopicWithServiceResponseAsync(resourceGroupName, partnerTopicName).map(new Func1>, List>() { + public PagedList listByPartnerTopic(final String resourceGroupName, final String partnerTopicName, final String filter, final Integer top) { + ServiceResponse> response = listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { @Override - public List call(ServiceResponse> response) { - return response.body(); + public Page nextPage(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } - }); + }; + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listByPartnerTopicAsync(final String resourceGroupName, final String partnerTopicName, final String filter, final Integer top) { + return listByPartnerTopicWithServiceResponseAsync(resourceGroupName, partnerTopicName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -906,10 +1059,37 @@ public List call(ServiceResponse>> listByPartnerTopicWithServiceResponseAsync(final String resourceGroupName, final String partnerTopicName, final String filter, final Integer top) { + return listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByPartnerTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param partnerTopicName Name of the partner topic. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<EventSubscriptionInner> object + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByPartnerTopicWithServiceResponseAsync(String resourceGroupName, String partnerTopicName) { + public Observable>> listByPartnerTopicSinglePageAsync(final String resourceGroupName, final String partnerTopicName, final String filter, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -922,18 +1102,129 @@ public Observable>> listByPartnerTo if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listByPartnerTopic(this.client.subscriptionId(), resourceGroupName, partnerTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listByPartnerTopic(this.client.subscriptionId(), resourceGroupName, partnerTopicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByPartnerTopicDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listByPartnerTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByPartnerTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner 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<EventSubscriptionInner> object if successful. + */ + public PagedList listByPartnerTopicNext(final String nextPageLink) { + ServiceResponse> response = listByPartnerTopicNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner 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> listByPartnerTopicNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByPartnerTopicNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner 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<EventSubscriptionInner> object + */ + public Observable> listByPartnerTopicNextAsync(final String nextPageLink) { + return listByPartnerTopicNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner 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<EventSubscriptionInner> object + */ + public Observable>> listByPartnerTopicNextWithServiceResponseAsync(final String nextPageLink) { + return listByPartnerTopicNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByPartnerTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a partner topic. + * List event subscriptions that belong to a specific partner topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByPartnerTopicNextSinglePageAsync(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.listByPartnerTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByPartnerTopicNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -941,9 +1232,9 @@ public Observable>> call(Response> listByPartnerTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByPartnerTopicNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicImpl.java index 970a3296a6d00..22283ce99b363 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PartnerTopicImpl.java @@ -61,4 +61,10 @@ public String source() { return this.inner().source(); } + @Override + public PartnerTopicImpl withTags(Map tags) { + this.utags = tags; + return this; + } + } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionImpl.java index ed01b77a770f3..bdfd16a209324 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -11,8 +11,8 @@ import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnection; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; -import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpoint; +import java.util.List; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.ConnectionState; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.ResourceProvisioningState; @@ -58,7 +58,7 @@ public Observable createResourceAsync() { @Override public Observable updateResourceAsync() { PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); - return client.updateAsync(this.resourceGroupName, this.parentType, this.parentName, this.privateEndpointConnectionName) + return client.updateAsync(this.resourceGroupName, this.parentType, this.parentName, this.privateEndpointConnectionName, this.inner()) .map(innerToFluentMap(this)); } @@ -109,4 +109,28 @@ public String type() { return this.inner().type(); } + @Override + public PrivateEndpointConnectionImpl withGroupIds(List groupIds) { + this.inner().withGroupIds(groupIds); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProvisioningState(ResourceProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionInner.java index e48cd7ff7ad83..e5d7625959a0d 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionInner.java @@ -17,7 +17,7 @@ import com.microsoft.azure.ProxyResource; /** - * PrivateEndpointConnection resource information. + * The PrivateEndpointConnectionInner model. */ @JsonFlatten public class PrivateEndpointConnectionInner extends ProxyResource { diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionsInner.java index 1f4e1f85794fc..8a8a597e50692 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -18,9 +18,11 @@ 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; @@ -65,11 +67,11 @@ interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections update" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.eventgrid.v2020_04_01_preview.PrivateEndpointConnections beginUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("parentType") String parentType, @Path("parentName") String parentName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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.eventgrid.v2020_04_01_preview.PrivateEndpointConnections delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) @@ -201,13 +203,14 @@ private ServiceResponse getDelegate(Response updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); } /** @@ -234,11 +238,12 @@ public ServiceFuture updateAsync(String resource * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. * @param parentName The name of the parent resource (namely, either, the topic name or domain name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { - return updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable updateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return updateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -254,10 +259,11 @@ public PrivateEndpointConnectionInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -273,10 +279,14 @@ public Observable> updateWithSer if (privateEndpointConnectionName == null) { throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Validator.validate(privateEndpointConnection); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -288,13 +298,14 @@ public Observable> updateWithSer * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. * @param parentName The name of the parent resource (namely, either, the topic name or domain name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. * @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 PrivateEndpointConnectionInner object if successful. */ - public PrivateEndpointConnectionInner beginUpdate(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).toBlocking().single().body(); + public PrivateEndpointConnectionInner beginUpdate(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); } /** @@ -305,12 +316,13 @@ public PrivateEndpointConnectionInner beginUpdate(String resourceGroupName, Stri * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. * @param parentName The name of the parent resource (namely, either, the topic name or domain name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. * @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 beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); } /** @@ -321,11 +333,12 @@ public ServiceFuture beginUpdateAsync(String res * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. * @param parentName The name of the parent resource (namely, either, the topic name or domain name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. + * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -341,10 +354,11 @@ public PrivateEndpointConnectionInner call(ServiceResponse> beginUpdateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String parentType, String parentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -360,10 +374,14 @@ public Observable> beginUpdateWi if (privateEndpointConnectionName == null) { throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection 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.beginUpdate(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Validator.validate(privateEndpointConnection); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsImpl.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsImpl.java index bb5e915c524ba..b039030d61f30 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsImpl.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsImpl.java @@ -14,7 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; -import java.util.List; +import com.microsoft.azure.Page; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.EventSubscriptionFullUrl; import com.microsoft.azure.management.eventgrid.v2020_04_01_preview.SystemTopicEventSubscription; @@ -56,13 +56,13 @@ public EventSubscriptionFullUrl call(EventSubscriptionFullUrlInner inner) { } @Override - public Observable listBySystemTopicAsync(String resourceGroupName, String systemTopicName) { + public Observable listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName) { SystemTopicEventSubscriptionsInner client = this.inner(); return client.listBySystemTopicAsync(resourceGroupName, systemTopicName) - .flatMap(new Func1, Observable>() { + .flatMapIterable(new Func1, Iterable>() { @Override - public Observable call(List innerList) { - return Observable.from(innerList); + public Iterable call(Page page) { + return page.items(); } }) .map(new Func1() { diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsInner.java index 1f9c4a106619f..1fe9980cb514b 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicEventSubscriptionsInner.java @@ -10,8 +10,12 @@ 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.eventgrid.v2020_04_01_preview.EventSubscriptionUpdateParameters; +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; @@ -29,6 +33,7 @@ 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; @@ -93,7 +98,11 @@ interface SystemTopicEventSubscriptionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.SystemTopicEventSubscriptions listBySystemTopic" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}/eventSubscriptions") - Observable> listBySystemTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("systemTopicName") String systemTopicName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listBySystemTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("systemTopicName") String systemTopicName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.eventgrid.v2020_04_01_preview.SystemTopicEventSubscriptions listBySystemTopicNext" }) + @GET + Observable> listBySystemTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -862,10 +871,16 @@ private ServiceResponse getFullUrlDelegate(Respon * @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 List<EventSubscriptionInner> object if successful. + * @return the PagedList<EventSubscriptionInner> object if successful. */ - public List listBySystemTopic(String resourceGroupName, String systemTopicName) { - return listBySystemTopicWithServiceResponseAsync(resourceGroupName, systemTopicName).toBlocking().single().body(); + public PagedList listBySystemTopic(final String resourceGroupName, final String systemTopicName) { + ServiceResponse> response = listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -878,8 +893,96 @@ public List listBySystemTopic(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listBySystemTopicAsync(String resourceGroupName, String systemTopicName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listBySystemTopicWithServiceResponseAsync(resourceGroupName, systemTopicName), serviceCallback); + public ServiceFuture> listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName) { + return listBySystemTopicWithServiceResponseAsync(resourceGroupName, systemTopicName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable>> listBySystemTopicWithServiceResponseAsync(final String resourceGroupName, final String systemTopicName) { + return listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySystemTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySystemTopicSinglePageAsync(final String resourceGroupName, final String systemTopicName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (systemTopicName == null) { + throw new IllegalArgumentException("Parameter systemTopicName 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 String filter = null; + final Integer top = null; + return service.listBySystemTopic(this.client.subscriptionId(), resourceGroupName, systemTopicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySystemTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); } /** @@ -888,16 +991,66 @@ public ServiceFuture> listBySystemTopicAsync(String * * @param resourceGroupName The name of the resource group within the user's subscription. * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<EventSubscriptionInner> object + * @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<EventSubscriptionInner> object if successful. */ - public Observable> listBySystemTopicAsync(String resourceGroupName, String systemTopicName) { - return listBySystemTopicWithServiceResponseAsync(resourceGroupName, systemTopicName).map(new Func1>, List>() { + public PagedList listBySystemTopic(final String resourceGroupName, final String systemTopicName, final String filter, final Integer top) { + ServiceResponse> response = listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { @Override - public List call(ServiceResponse> response) { - return response.body(); + public Page nextPage(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } - }); + }; + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @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> listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName, final String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventSubscriptionInner> object + */ + public Observable> listBySystemTopicAsync(final String resourceGroupName, final String systemTopicName, final String filter, final Integer top) { + return listBySystemTopicWithServiceResponseAsync(resourceGroupName, systemTopicName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -906,10 +1059,37 @@ public List call(ServiceResponse>> listBySystemTopicWithServiceResponseAsync(final String resourceGroupName, final String systemTopicName, final String filter, final Integer top) { + return listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySystemTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. + ServiceResponse> * @param systemTopicName Name of the system topic. + ServiceResponse> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + ServiceResponse> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<EventSubscriptionInner> object + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listBySystemTopicWithServiceResponseAsync(String resourceGroupName, String systemTopicName) { + public Observable>> listBySystemTopicSinglePageAsync(final String resourceGroupName, final String systemTopicName, final String filter, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -922,18 +1102,129 @@ public Observable>> listBySystemTop if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listBySystemTopic(this.client.subscriptionId(), resourceGroupName, systemTopicName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listBySystemTopic(this.client.subscriptionId(), resourceGroupName, systemTopicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listBySystemTopicDelegate(response); - List items = null; - if (result.body() != null) { - items = result.body().items(); - } - ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listBySystemTopicDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySystemTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system 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<EventSubscriptionInner> object if successful. + */ + public PagedList listBySystemTopicNext(final String nextPageLink) { + ServiceResponse> response = listBySystemTopicNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system 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> listBySystemTopicNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySystemTopicNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system 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<EventSubscriptionInner> object + */ + public Observable> listBySystemTopicNextAsync(final String nextPageLink) { + return listBySystemTopicNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system 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<EventSubscriptionInner> object + */ + public Observable>> listBySystemTopicNextWithServiceResponseAsync(final String nextPageLink) { + return listBySystemTopicNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySystemTopicNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List event subscriptions of a system topic. + * List event subscriptions that belong to a specific system topic. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventSubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySystemTopicNextSinglePageAsync(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.listBySystemTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySystemTopicNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -941,9 +1232,9 @@ public Observable>> call(Response> listBySystemTopicDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listBySystemTopicNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java index f849d5b8ab20a..e58832367e2b9 100644 --- a/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java +++ b/sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/TopicInner.java @@ -26,7 +26,7 @@ @JsonFlatten public class TopicInner extends Resource { /** - * List of private endpoint connections. + * The privateEndpointConnections property. */ @JsonProperty(value = "properties.privateEndpointConnections") private List privateEndpointConnections; @@ -97,7 +97,7 @@ public class TopicInner extends Resource { private IdentityInfo identity; /** - * Get list of private endpoint connections. + * Get the privateEndpointConnections value. * * @return the privateEndpointConnections value */ @@ -106,7 +106,7 @@ public List privateEndpointConnections() { } /** - * Set list of private endpoint connections. + * Set the privateEndpointConnections value. * * @param privateEndpointConnections the privateEndpointConnections value to set * @return the TopicInner object itself.