From d6b79f4160efc92d766d242eb94db60f2cf524e0 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 28 Feb 2020 05:53:31 +0000 Subject: [PATCH] Generated from aee76f6f20cccd50de6dfe022d205c698f0a291a in64 -> int64 --- sdk/network/mgmt-v2019_06_01/pom.xml | 4 +- .../PrivateLinkServiceConnectionState.java | 16 +- .../implementation/BastionHostsInner.java | 327 ++++++++++++++++++ .../ConnectionMonitorsInner.java | 192 ++++++++++ .../NetworkManagementClientImpl.java | 2 + 5 files changed, 531 insertions(+), 10 deletions(-) diff --git a/sdk/network/mgmt-v2019_06_01/pom.xml b/sdk/network/mgmt-v2019_06_01/pom.xml index c13837e2d55e4..2c5ed872eb710 100644 --- a/sdk/network/mgmt-v2019_06_01/pom.xml +++ b/sdk/network/mgmt-v2019_06_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-network - 1.0.0-beta-1 + 1.0.0-beta jar Microsoft Azure SDK for Network Management This package contains Microsoft Network Management SDK. diff --git a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/PrivateLinkServiceConnectionState.java b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/PrivateLinkServiceConnectionState.java index ba61d9f3b54ed..1cbec0a1477d4 100644 --- a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/PrivateLinkServiceConnectionState.java +++ b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/PrivateLinkServiceConnectionState.java @@ -32,8 +32,8 @@ public class PrivateLinkServiceConnectionState { * A message indicating if changes on the service provider require any * updates on the consumer. */ - @JsonProperty(value = "actionRequired") - private String actionRequired; + @JsonProperty(value = "actionsRequired") + private String actionsRequired; /** * Get indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. @@ -78,20 +78,20 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get a message indicating if changes on the service provider require any updates on the consumer. * - * @return the actionRequired value + * @return the actionsRequired value */ - public String actionRequired() { - return this.actionRequired; + public String actionsRequired() { + return this.actionsRequired; } /** * Set a message indicating if changes on the service provider require any updates on the consumer. * - * @param actionRequired the actionRequired value to set + * @param actionsRequired the actionsRequired value to set * @return the PrivateLinkServiceConnectionState object itself. */ - public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { - this.actionRequired = actionRequired; + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; return this; } diff --git a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/BastionHostsInner.java b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/BastionHostsInner.java index e80e4b32a3cf5..35d730053528c 100644 --- a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/BastionHostsInner.java +++ b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/BastionHostsInner.java @@ -16,6 +16,8 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.network.v2019_06_01.ErrorException; +import com.microsoft.azure.management.network.v2019_06_01.TagsObject; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -24,12 +26,14 @@ import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; +import java.util.Map; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; +import retrofit2.http.PATCH; import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; @@ -84,6 +88,14 @@ interface BastionHostsService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}") Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("bastionHostName") String bastionHostName, @Path("subscriptionId") String subscriptionId, @Body BastionHostInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_06_01.BastionHosts updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("bastionHostName") String bastionHostName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject bastionHostParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_06_01.BastionHosts beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("bastionHostName") String bastionHostName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject bastionHostParameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_06_01.BastionHosts list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -505,6 +517,321 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateTagsAsync(String resourceGroupName, String bastionHostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName), serviceCallback); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String bastionHostName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName).map(new Func1, BastionHostInner>() { + @Override + public BastionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String bastionHostName) { + 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 (bastionHostName == null) { + throw new IllegalArgumentException("Parameter bastionHostName is required and cannot be null."); + } + final String apiVersion = "2019-06-01"; + final Map tags = null; + TagsObject bastionHostParameters = new TagsObject(); + bastionHostParameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, bastionHostName, apiVersion, this.client.acceptLanguage(), bastionHostParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BastionHostInner object if successful. + */ + public BastionHostInner updateTags(String resourceGroupName, String bastionHostName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags).toBlocking().last().body(); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @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 updateTagsAsync(String resourceGroupName, String bastionHostName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags), serviceCallback); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String bastionHostName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags).map(new Func1, BastionHostInner>() { + @Override + public BastionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String bastionHostName, Map tags) { + 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 (bastionHostName == null) { + throw new IllegalArgumentException("Parameter bastionHostName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-06-01"; + TagsObject bastionHostParameters = new TagsObject(); + bastionHostParameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, bastionHostName, apiVersion, this.client.acceptLanguage(), bastionHostParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BastionHostInner object if successful. + */ + public BastionHostInner beginUpdateTags(String resourceGroupName, String bastionHostName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName).toBlocking().single().body(); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @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 beginUpdateTagsAsync(String resourceGroupName, String bastionHostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName), serviceCallback); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BastionHostInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String bastionHostName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName).map(new Func1, BastionHostInner>() { + @Override + public BastionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BastionHostInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String bastionHostName) { + 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 (bastionHostName == null) { + throw new IllegalArgumentException("Parameter bastionHostName is required and cannot be null."); + } + final String apiVersion = "2019-06-01"; + final Map tags = null; + TagsObject bastionHostParameters = new TagsObject(); + bastionHostParameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, bastionHostName, apiVersion, this.client.acceptLanguage(), bastionHostParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BastionHostInner object if successful. + */ + public BastionHostInner beginUpdateTags(String resourceGroupName, String bastionHostName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags).toBlocking().single().body(); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @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 beginUpdateTagsAsync(String resourceGroupName, String bastionHostName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags), serviceCallback); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BastionHostInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String bastionHostName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, bastionHostName, tags).map(new Func1, BastionHostInner>() { + @Override + public BastionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates bastion host tags. + * + * @param resourceGroupName The resource group name of the BastionHost. + * @param bastionHostName The name of the bastionHost. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BastionHostInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String bastionHostName, Map tags) { + 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 (bastionHostName == null) { + throw new IllegalArgumentException("Parameter bastionHostName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-06-01"; + TagsObject bastionHostParameters = new TagsObject(); + bastionHostParameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, bastionHostName, apiVersion, this.client.acceptLanguage(), bastionHostParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + /** * Lists all Bastion Hosts in a subscription. * diff --git a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/ConnectionMonitorsInner.java b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/ConnectionMonitorsInner.java index a6211edc5dbd6..3489f0116abc6 100644 --- a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/ConnectionMonitorsInner.java +++ b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/ConnectionMonitorsInner.java @@ -11,18 +11,21 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.management.network.v2019_06_01.ErrorResponseException; +import com.microsoft.azure.management.network.v2019_06_01.TagsObject; 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 java.util.Map; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; +import retrofit2.http.PATCH; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.PUT; @@ -79,6 +82,10 @@ interface ConnectionMonitorsService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", method = "DELETE", hasBody = true) Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_06_01.ConnectionMonitors updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2019_06_01.ConnectionMonitors stop" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("connectionMonitorName") String connectionMonitorName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -546,6 +553,191 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner updateTags(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @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 updateTagsAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName), serviceCallback); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.updateTags(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ConnectionMonitorResultInner object if successful. + */ + public ConnectionMonitorResultInner updateTags(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, tags).toBlocking().single().body(); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param tags Resource tags. + * @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 updateTagsAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, tags), serviceCallback); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable updateTagsAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, tags).map(new Func1, ConnectionMonitorResultInner>() { + @Override + public ConnectionMonitorResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConnectionMonitorResultInner object + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (networkWatcherName == null) { + throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); + } + if (connectionMonitorName == null) { + throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.updateTags(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateTagsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + /** * Stops the specified connection monitor. * diff --git a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/NetworkManagementClientImpl.java b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/NetworkManagementClientImpl.java index cf1caddeff973..8b02cb82a9ed8 100644 --- a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/NetworkManagementClientImpl.java +++ b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/NetworkManagementClientImpl.java @@ -12,6 +12,8 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; import com.microsoft.azure.CloudException; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; import com.microsoft.azure.management.network.v2019_06_01.ErrorException; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient;