diff --git a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysInner.java index 84da49d22ff3..982fc3095f6e 100644 --- a/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -125,10 +129,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2017_10_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2017_10_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1507,7 +1507,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2017-10-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1598,6 +1598,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1614,7 +1615,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1649,81 +1650,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2017-10-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1733,7 +1659,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1748,12 +1674,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2017-10-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1762,7 +1688,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java index 0f503be19e0a..d49858d0d153 100644 --- a/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -125,10 +129,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_04_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_04_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1523,7 +1523,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2018-04-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1614,6 +1614,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1630,7 +1631,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1665,81 +1666,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2018-04-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1749,7 +1675,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1764,12 +1690,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2018-04-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1778,7 +1704,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java index ed60768343ff..b086b9205ce5 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -133,10 +137,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_06_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_06_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1681,7 +1681,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2018-06-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1772,6 +1772,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1788,7 +1789,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1823,81 +1824,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2018-06-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1907,7 +1833,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1922,12 +1848,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2018-06-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1936,7 +1862,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java index e958c427c91d..4d8c572e3822 100644 --- a/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -125,10 +129,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_07_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_07_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1523,7 +1523,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2018-07-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1614,6 +1614,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1630,7 +1631,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1665,81 +1666,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2018-07-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1749,7 +1675,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1764,12 +1690,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2018-07-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1778,7 +1704,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java index a4438655a7ba..364d3640f59f 100644 --- a/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -133,10 +137,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_08_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_08_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1681,7 +1681,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2018-08-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1772,6 +1772,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1788,7 +1789,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1823,81 +1824,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2018-08-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1907,7 +1833,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1922,12 +1848,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2018-08-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1936,7 +1862,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/VirtualNetworkGatewaysInner.java b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/VirtualNetworkGatewaysInner.java index 3f38d0cf6414..55355141e2c8 100644 --- a/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/VirtualNetworkGatewaysInner.java +++ b/network/resource-manager/v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/VirtualNetworkGatewaysInner.java @@ -42,6 +42,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -133,10 +137,6 @@ interface VirtualNetworkGatewaysService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") Observable> generateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_12_01.VirtualNetworkGateways beginGenerateVpnProfile" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") - Observable> beginGenerateVpnProfile(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Body VpnClientParameters 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.v2018_12_01.VirtualNetworkGateways getVpnProfilePackageUrl" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") Observable> getVpnProfilePackageUrl(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkGatewayName") String virtualNetworkGatewayName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1681,7 +1681,7 @@ public Observable> generatevpnclientpackageWithServiceRe Validator.validate(parameters); final String apiVersion = "2018-12-01"; Observable> observable = service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -1772,6 +1772,7 @@ public Observable> call(Response response) private ServiceResponse beginGeneratevpnclientpackageDelegate(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); } @@ -1788,7 +1789,7 @@ private ServiceResponse beginGeneratevpnclientpackageDelegate(Response generateVpnProfileAsync(String resourceGroupName, S * @param virtualNetworkGatewayName The name of the virtual network gateway. * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the String object */ public Observable generateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { @@ -1823,81 +1824,6 @@ public String call(ServiceResponse response) { }); } - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (virtualNetworkGatewayName == null) { - throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - final String apiVersion = "2018-12-01"; - Observable> observable = service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the String object if successful. - */ - public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @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 beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkGatewayName The name of the virtual network gateway. - * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the String object - */ - public Observable beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { - return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, String>() { - @Override - public String call(ServiceResponse response) { - return response.body(); - } - }); - } - /** * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. * @@ -1907,7 +1833,7 @@ public String call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ - public Observable> beginGenerateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + public Observable> generateVpnProfileWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1922,12 +1848,12 @@ public Observable> beginGenerateVpnProfileWithServiceRes } Validator.validate(parameters); final String apiVersion = "2018-12-01"; - return service.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginGenerateVpnProfileDelegate(response); + ServiceResponse clientResponse = generateVpnProfileDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1936,7 +1862,7 @@ public Observable> call(Response response) }); } - private ServiceResponse beginGenerateVpnProfileDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse generateVpnProfileDelegate(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())