From 88aca6655998fc4108b6a517fc47044c7152fb6b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 9 Jul 2020 17:02:40 +0000 Subject: [PATCH] Update from master --- sdk/network/mgmt-v2020_04_01/pom.xml | 6 +- .../network/v2020_04_01/HubRouteTable.java | 5 +- .../LoadBalancerBackendAddress.java | 26 +- .../network/v2020_04_01/Subnet.java | 2 - .../implementation/HubRouteTableImpl.java | 5 +- .../implementation/HubRouteTableInner.java | 10 +- .../PrivateLinkServicesInner.java | 342 ++++++++++++++++-- 7 files changed, 331 insertions(+), 65 deletions(-) diff --git a/sdk/network/mgmt-v2020_04_01/pom.xml b/sdk/network/mgmt-v2020_04_01/pom.xml index 2b4830250704c..afe05c06ed585 100644 --- a/sdk/network/mgmt-v2020_04_01/pom.xml +++ b/sdk/network/mgmt-v2020_04_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.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-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/HubRouteTable.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/HubRouteTable.java index 84c28b8f4b410..724830b05bdb0 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/HubRouteTable.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/HubRouteTable.java @@ -18,7 +18,6 @@ import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.network.v2020_04_01.implementation.NetworkManager; import java.util.List; -import com.microsoft.azure.SubResource; /** * Type representing HubRouteTable. @@ -27,7 +26,7 @@ public interface HubRouteTable extends HasInner, Indexable, /** * @return the associatedConnections value. */ - List associatedConnections(); + List associatedConnections(); /** * @return the etag value. @@ -52,7 +51,7 @@ public interface HubRouteTable extends HasInner, Indexable, /** * @return the propagatingConnections value. */ - List propagatingConnections(); + List propagatingConnections(); /** * @return the provisioningState value. diff --git a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/LoadBalancerBackendAddress.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/LoadBalancerBackendAddress.java index 6f7aa9e7a1b7a..e0f0fcd35bc8b 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/LoadBalancerBackendAddress.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/LoadBalancerBackendAddress.java @@ -8,8 +8,7 @@ package com.microsoft.azure.management.network.v2020_04_01; -import com.microsoft.azure.management.network.v2020_04_01.implementation.VirtualNetworkInner; -import com.microsoft.azure.management.network.v2020_04_01.implementation.NetworkInterfaceIPConfigurationInner; +import com.microsoft.azure.SubResource; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -22,7 +21,7 @@ public class LoadBalancerBackendAddress { * Reference to an existing virtual network. */ @JsonProperty(value = "properties.virtualNetwork") - private VirtualNetworkInner virtualNetwork; + private SubResource virtualNetwork; /** * IP Address belonging to the referenced virtual network. @@ -33,8 +32,8 @@ public class LoadBalancerBackendAddress { /** * Reference to IP address defined in network interfaces. */ - @JsonProperty(value = "properties.networkInterfaceIPConfiguration") - private NetworkInterfaceIPConfigurationInner networkInterfaceIPConfiguration; + @JsonProperty(value = "properties.networkInterfaceIPConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SubResource networkInterfaceIPConfiguration; /** * Name of the backend address. @@ -47,7 +46,7 @@ public class LoadBalancerBackendAddress { * * @return the virtualNetwork value */ - public VirtualNetworkInner virtualNetwork() { + public SubResource virtualNetwork() { return this.virtualNetwork; } @@ -57,7 +56,7 @@ public VirtualNetworkInner virtualNetwork() { * @param virtualNetwork the virtualNetwork value to set * @return the LoadBalancerBackendAddress object itself. */ - public LoadBalancerBackendAddress withVirtualNetwork(VirtualNetworkInner virtualNetwork) { + public LoadBalancerBackendAddress withVirtualNetwork(SubResource virtualNetwork) { this.virtualNetwork = virtualNetwork; return this; } @@ -87,21 +86,10 @@ public LoadBalancerBackendAddress withIpAddress(String ipAddress) { * * @return the networkInterfaceIPConfiguration value */ - public NetworkInterfaceIPConfigurationInner networkInterfaceIPConfiguration() { + public SubResource networkInterfaceIPConfiguration() { return this.networkInterfaceIPConfiguration; } - /** - * Set reference to IP address defined in network interfaces. - * - * @param networkInterfaceIPConfiguration the networkInterfaceIPConfiguration value to set - * @return the LoadBalancerBackendAddress object itself. - */ - public LoadBalancerBackendAddress withNetworkInterfaceIPConfiguration(NetworkInterfaceIPConfigurationInner networkInterfaceIPConfiguration) { - this.networkInterfaceIPConfiguration = networkInterfaceIPConfiguration; - return this; - } - /** * Get name of the backend address. * diff --git a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/Subnet.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/Subnet.java index 92cb82eda4ebf..acb080dca7093 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/Subnet.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/Subnet.java @@ -9,8 +9,6 @@ package com.microsoft.azure.management.network.v2020_04_01; import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.management.network.v2020_04_01.implementation.ResourceNavigationLinkInner; -import com.microsoft.azure.management.network.v2020_04_01.implementation.ServiceAssociationLinkInner; import com.microsoft.azure.management.network.v2020_04_01.implementation.SubnetInner; import com.microsoft.azure.arm.model.Indexable; import com.microsoft.azure.arm.model.Refreshable; diff --git a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableImpl.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableImpl.java index 8f5b23be7922e..591c5f2c01ba0 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableImpl.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableImpl.java @@ -13,7 +13,6 @@ import rx.Observable; import java.util.List; import com.microsoft.azure.management.network.v2020_04_01.HubRoute; -import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.v2020_04_01.ProvisioningState; class HubRouteTableImpl extends CreatableUpdatableImpl implements HubRouteTable, HubRouteTable.Definition, HubRouteTable.Update { @@ -74,7 +73,7 @@ public boolean isInCreateMode() { @Override - public List associatedConnections() { + public List associatedConnections() { return this.inner().associatedConnections(); } @@ -99,7 +98,7 @@ public String name() { } @Override - public List propagatingConnections() { + public List propagatingConnections() { return this.inner().propagatingConnections(); } diff --git a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableInner.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableInner.java index 1917dbc0e8b02..20f734ec8e8a1 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableInner.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/HubRouteTableInner.java @@ -10,10 +10,10 @@ import java.util.List; import com.microsoft.azure.management.network.v2020_04_01.HubRoute; -import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.v2020_04_01.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; /** * RouteTable resource in a virtual hub. @@ -36,13 +36,13 @@ public class HubRouteTableInner extends SubResource { * List of all connections associated with this route table. */ @JsonProperty(value = "properties.associatedConnections", access = JsonProperty.Access.WRITE_ONLY) - private List associatedConnections; + private List associatedConnections; /** * List of all connections that advertise to this route table. */ @JsonProperty(value = "properties.propagatingConnections", access = JsonProperty.Access.WRITE_ONLY) - private List propagatingConnections; + private List propagatingConnections; /** * The provisioning state of the RouteTable resource. Possible values @@ -115,7 +115,7 @@ public HubRouteTableInner withLabels(List labels) { * * @return the associatedConnections value */ - public List associatedConnections() { + public List associatedConnections() { return this.associatedConnections; } @@ -124,7 +124,7 @@ public List associatedConnections() { * * @return the propagatingConnections value */ - public List propagatingConnections() { + public List propagatingConnections() { return this.propagatingConnections; } diff --git a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/PrivateLinkServicesInner.java b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/PrivateLinkServicesInner.java index 941f0618361f9..63e521d112331 100644 --- a/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/PrivateLinkServicesInner.java +++ b/sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_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 @@ -119,10 +121,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.v2020_04_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.v2020_04_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.v2020_04_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.v2020_04_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); @@ -1431,7 +1441,7 @@ private ServiceResponse> listPrivateEnd * @return the PrivateLinkServiceVisibilityInner object if successful. */ public PrivateLinkServiceVisibilityInner checkPrivateLinkServiceVisibility(String location) { - return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location).toBlocking().single().body(); + return checkPrivateLinkServiceVisibilityWithServiceResponseAsync(location).toBlocking().last().body(); } /** @@ -1451,7 +1461,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>() { @@ -1467,7 +1477,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityWithServiceResponseAsync(String location) { if (location == null) { @@ -1480,12 +1490,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 whether 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 whether 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 whether 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 whether 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 = "2020-04-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 whether 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 whether 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 whether 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 whether 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 = "2020-04-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); @@ -1504,8 +1642,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(); } /** @@ -1517,8 +1655,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); } /** @@ -1529,8 +1667,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(); @@ -1546,7 +1684,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."); } @@ -1556,12 +1694,12 @@ public Observable> checkPriva final String apiVersion = "2020-04-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); @@ -1570,9 +1708,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); } @@ -1588,7 +1727,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(); } /** @@ -1610,7 +1749,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>() { @@ -1627,7 +1766,7 @@ public PrivateLinkServiceVisibilityInner call(ServiceResponse> checkPrivateLinkServiceVisibilityByResourceGroupWithServiceResponseAsync(String location, String resourceGroupName) { if (location == null) { @@ -1643,12 +1782,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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 = "2020-04-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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 whether the subscription is visible to private link service in the specified resource group. + * + * @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 = "2020-04-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); @@ -1668,8 +1949,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(); } /** @@ -1682,8 +1963,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); } /** @@ -1695,8 +1976,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(); @@ -1713,7 +1994,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."); } @@ -1726,12 +2007,12 @@ public Observable> checkPriva final String apiVersion = "2020-04-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); @@ -1740,9 +2021,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); }