From bad99e95761aaad34ec0b46f8921bacfad51c73f Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 20 Aug 2020 06:37:41 +0000 Subject: [PATCH] Update from master --- sdk/network/mgmt-v2019_06_01/pom.xml | 6 +- .../PrivateLinkServiceConnectionState.java | 16 +- .../implementation/BastionHostsInner.java | 327 +++++++++++++++++ .../ConnectionMonitorsInner.java | 192 ++++++++++ .../NetworkManagementClientImpl.java | 2 + .../PrivateLinkServicesInner.java | 342 ++++++++++++++++-- 6 files changed, 844 insertions(+), 41 deletions(-) diff --git a/sdk/network/mgmt-v2019_06_01/pom.xml b/sdk/network/mgmt-v2019_06_01/pom.xml index ff2d2f6274abb..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 - ../../parents/azure-arm-parent + 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; diff --git a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/PrivateLinkServicesInner.java b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/PrivateLinkServicesInner.java index 0075d38c4177a..c87953b710c90 100644 --- a/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/PrivateLinkServicesInner.java +++ b/sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/PrivateLinkServicesInner.java @@ -40,6 +40,8 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -111,10 +113,18 @@ interface PrivateLinkServicesService { @POST("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility") Observable> checkPrivateLinkServiceVisibility(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckPrivateLinkServiceVisibilityRequest 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.PrivateLinkServices beginCheckPrivateLinkServiceVisibility" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility") + Observable> beginCheckPrivateLinkServiceVisibility(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckPrivateLinkServiceVisibilityRequest 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.PrivateLinkServices checkPrivateLinkServiceVisibilityByResourceGroup" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility") Observable> checkPrivateLinkServiceVisibilityByResourceGroup(@Path("location") String location, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckPrivateLinkServiceVisibilityRequest 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.PrivateLinkServices beginCheckPrivateLinkServiceVisibilityByResourceGroup" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility") + Observable> beginCheckPrivateLinkServiceVisibilityByResourceGroup(@Path("location") String location, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckPrivateLinkServiceVisibilityRequest 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.PrivateLinkServices listAutoApprovedPrivateLinkServices" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices") Observable> listAutoApprovedPrivateLinkServices(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1118,7 +1128,7 @@ private ServiceResponse beginDeletePrivateEndpointConnectionDelegate(Respo * @return the PrivateLinkServiceVisibilityInner object if successful. */ public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility(String location) { - return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location).toBlocking().single().body(); + return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location).toBlocking().last().body(); } /** @@ -1138,7 +1148,7 @@ public ServiceFuture checkPrivateLinkServiceV * * @param location The location of the domain name. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PrivateLinkServiceVisibilityInner object + * @return the observable for the request */ public Observable checkPrivateLinkServiceVisibilityAsync(String location) { return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location).map(new Func1, PrivateLinkServiceVisibilityInner>() { @@ -1154,7 +1164,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityWithServiceResponseAsync(String location) { if (location == null) { @@ -1167,12 +1177,140 @@ public Observable> checkPriva final String privateLinkServiceAlias = null; CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); parameters.withPrivateLinkServiceAlias(null); - return service.checkPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + Observable> observable = service.checkPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param privateLinkServiceAlias The alias of the private link service. + * @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 PrivateLinkServiceVisibilityInner object if successful. + */ + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility(String location, String privateLinkServiceAlias) { + return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).toBlocking().last().body(); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param privateLinkServiceAlias The alias of the private link service. + * @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 checkPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias), serviceCallback); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param privateLinkServiceAlias The alias of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable checkPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias) { + return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { + @Override + public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param privateLinkServiceAlias The alias of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> checkPrivateLinkServiceVisibilityWithServiceResponseAsync(String location, String privateLinkServiceAlias) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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"; + CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); + parameters.withPrivateLinkServiceAlias(privateLinkServiceAlias); + Observable> observable = service.checkPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkServiceVisibilityInner object if successful. + */ + public PrivateLinkServiceVisibilityInner beginCheckPrivateLinkServiceVisibility(String location) { + return beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCheckPrivateLinkServiceVisibilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkServiceVisibilityInner object + */ + public Observable beginCheckPrivateLinkServiceVisibilityAsync(String location) { + return beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location).map(new Func1, PrivateLinkServiceVisibilityInner>() { + @Override + public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkServiceVisibilityInner object + */ + public Observable> beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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 String privateLinkServiceAlias = null; + CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); + parameters.withPrivateLinkServiceAlias(null); + return service.beginCheckPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = checkPrivateLinkServiceVisibilityDelegate(response); + ServiceResponse clientResponse = beginCheckPrivateLinkServiceVisibilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1191,8 +1329,8 @@ public Observable> call(Respo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateLinkServiceVisibilityInner object if successful. */ - public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility(String location, String privateLinkServiceAlias) { - return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).toBlocking().single().body(); + public PrivateLinkServiceVisibilityInner beginCheckPrivateLinkServiceVisibility(String location, String privateLinkServiceAlias) { + return beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).toBlocking().single().body(); } /** @@ -1204,8 +1342,8 @@ public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility(Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias), serviceCallback); + public ServiceFuture beginCheckPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias), serviceCallback); } /** @@ -1216,8 +1354,8 @@ public ServiceFuture checkPrivateLinkServiceV * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkServiceVisibilityInner object */ - public Observable checkPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias) { - return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { + public Observable beginCheckPrivateLinkServiceVisibilityAsync(String location, String privateLinkServiceAlias) { + return beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(location, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { @Override public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { return response.body(); @@ -1233,7 +1371,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityWithServiceResponseAsync(String location, String privateLinkServiceAlias) { + public Observable> beginCheckPrivateLinkServiceVisibilityWithServiceResponseAsync(String location, String privateLinkServiceAlias) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -1243,12 +1381,12 @@ public Observable> checkPriva final String apiVersion = "2019-06-01"; CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); parameters.withPrivateLinkServiceAlias(privateLinkServiceAlias); - return service.checkPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + return service.beginCheckPrivateLinkServiceVisibility(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = checkPrivateLinkServiceVisibilityDelegate(response); + ServiceResponse clientResponse = beginCheckPrivateLinkServiceVisibilityDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1257,9 +1395,10 @@ public Observable> call(Respo }); } - private ServiceResponse checkPrivateLinkServiceVisibilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCheckPrivateLinkServiceVisibilityDelegate(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()) .registerError(CloudException.class) .build(response); } @@ -1275,7 +1414,7 @@ private ServiceResponse checkPrivateLinkServi * @return the PrivateLinkServiceVisibilityInner object if successful. */ public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName) { - return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName).toBlocking().single().body(); + return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName).toBlocking().last().body(); } /** @@ -1297,7 +1436,7 @@ public ServiceFuture checkPrivateLinkServiceV * @param location The location of the domain name. * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PrivateLinkServiceVisibilityInner object + * @return the observable for the request */ public Observable checkPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName) { return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName).map(new Func1, PrivateLinkServiceVisibilityInner>() { @@ -1314,7 +1453,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName) { if (location == null) { @@ -1330,12 +1469,154 @@ public Observable> checkPriva final String privateLinkServiceAlias = null; CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); parameters.withPrivateLinkServiceAlias(null); - return service.checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + Observable> observable = service.checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param privateLinkServiceAlias The alias of the private link service. + * @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 PrivateLinkServiceVisibilityInner object if successful. + */ + public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName, String privateLinkServiceAlias) { + return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).toBlocking().last().body(); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param privateLinkServiceAlias The alias of the private link service. + * @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 checkPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias), serviceCallback); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param privateLinkServiceAlias The alias of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable checkPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { + return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { + @Override + public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param privateLinkServiceAlias The alias of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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"; + CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); + parameters.withPrivateLinkServiceAlias(privateLinkServiceAlias); + Observable> observable = service.checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @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 PrivateLinkServiceVisibilityInner object if successful. + */ + public PrivateLinkServiceVisibilityInner beginCheckPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName).toBlocking().single().body(); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @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 beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName), serviceCallback); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkServiceVisibilityInner object + */ + public Observable beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName).map(new Func1, PrivateLinkServiceVisibilityInner>() { + @Override + public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkServiceVisibilityInner object + */ + public Observable> beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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 String privateLinkServiceAlias = null; + CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); + parameters.withPrivateLinkServiceAlias(null); + return service.beginCheckPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = checkPrivateLinkServiceVisibilityByResourceGroupDelegate(response); + ServiceResponse clientResponse = beginCheckPrivateLinkServiceVisibilityByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1355,8 +1636,8 @@ public Observable> call(Respo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateLinkServiceVisibilityInner object if successful. */ - public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName, String privateLinkServiceAlias) { - return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).toBlocking().single().body(); + public PrivateLinkServiceVisibilityInner beginCheckPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName, String privateLinkServiceAlias) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).toBlocking().single().body(); } /** @@ -1369,8 +1650,8 @@ public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibilityByReso * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture checkPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias), serviceCallback); + public ServiceFuture beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias), serviceCallback); } /** @@ -1382,8 +1663,8 @@ public ServiceFuture checkPrivateLinkServiceV * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkServiceVisibilityInner object */ - public Observable checkPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { - return checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { + public Observable beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(location, resourceGroupName, privateLinkServiceAlias).map(new Func1, PrivateLinkServiceVisibilityInner>() { @Override public PrivateLinkServiceVisibilityInner call(ServiceResponse response) { return response.body(); @@ -1400,7 +1681,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { + public Observable> beginCheckPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName, String privateLinkServiceAlias) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -1413,12 +1694,12 @@ public Observable> checkPriva final String apiVersion = "2019-06-01"; CheckPrivateLinkServiceVisibilityRequest parameters = new CheckPrivateLinkServiceVisibilityRequest(); parameters.withPrivateLinkServiceAlias(privateLinkServiceAlias); - return service.checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + return service.beginCheckPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = checkPrivateLinkServiceVisibilityByResourceGroupDelegate(response); + ServiceResponse clientResponse = beginCheckPrivateLinkServiceVisibilityByResourceGroupDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1427,9 +1708,10 @@ public Observable> call(Respo }); } - private ServiceResponse checkPrivateLinkServiceVisibilityByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCheckPrivateLinkServiceVisibilityByResourceGroupDelegate(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()) .registerError(CloudException.class) .build(response); }