com.microsoft.azure.management.network.implementation.PrivateLinkServicesInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-mgmt-network Show documentation
Show all versions of azure-mgmt-network Show documentation
This package contains Microsoft Azure Network Management SDK. A new set of management libraries are now Generally Available. For documentation on how to use the new libraries, please see https://aka.ms/azsdk/java/mgmt
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.network.implementation;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.management.network.CheckPrivateLinkServiceVisibilityRequest;
import com.microsoft.azure.management.network.ErrorException;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
/**
* An instance of this class provides access to all the operations defined
* in PrivateLinkServices.
*/
public class PrivateLinkServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing {
/** The Retrofit service to perform REST calls. */
private PrivateLinkServicesService service;
/** The service client containing this operation class. */
private NetworkManagementClientImpl client;
/**
* Initializes an instance of PrivateLinkServicesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public PrivateLinkServicesInner(Retrofit retrofit, NetworkManagementClientImpl client) {
this.service = retrofit.create(PrivateLinkServicesService.class);
this.client = client;
}
/**
* The interface defining all the services for PrivateLinkServices to be
* used by Retrofit to perform actually REST calls.
*/
interface PrivateLinkServicesService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", method = "DELETE", hasBody = true)
Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", method = "DELETE", hasBody = true)
Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices getByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}")
Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.PrivateLinkServices createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}")
Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Body PrivateLinkServiceInner 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.PrivateLinkServices beginCreateOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}")
Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Body PrivateLinkServiceInner 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.PrivateLinkServices listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices")
Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices")
Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices getPrivateEndpointConnection" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}")
Observable> getPrivateEndpointConnection(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("peConnectionName") String peConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.PrivateLinkServices updatePrivateEndpointConnection" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}")
Observable> updatePrivateEndpointConnection(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("peConnectionName") String peConnectionName, @Path("subscriptionId") String subscriptionId, @Body PrivateEndpointConnectionInner 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.PrivateLinkServices deletePrivateEndpointConnection" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", method = "DELETE", hasBody = true)
Observable> deletePrivateEndpointConnection(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("peConnectionName") String peConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices beginDeletePrivateEndpointConnection" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", method = "DELETE", hasBody = true)
Observable> beginDeletePrivateEndpointConnection(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("peConnectionName") String peConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices listPrivateEndpointConnections" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections")
Observable> listPrivateEndpointConnections(@Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices checkPrivateLinkServiceVisibility" })
@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.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.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);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices listAutoApprovedPrivateLinkServicesByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices")
Observable> listAutoApprovedPrivateLinkServicesByResourceGroup(@Path("location") String location, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.PrivateLinkServices listByResourceGroupNext" })
@GET
Observable> listByResourceGroupNext(@Url String nextUrl, @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.PrivateLinkServices listNext" })
@GET
Observable> listNext(@Url String nextUrl, @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.PrivateLinkServices listPrivateEndpointConnectionsNext" })
@GET
Observable> listPrivateEndpointConnectionsNext(@Url String nextUrl, @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.PrivateLinkServices listAutoApprovedPrivateLinkServicesNext" })
@GET
Observable> listAutoApprovedPrivateLinkServicesNext(@Url String nextUrl, @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.PrivateLinkServices listAutoApprovedPrivateLinkServicesByResourceGroupNext" })
@GET
Observable> listAutoApprovedPrivateLinkServicesByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void delete(String resourceGroupName, String serviceName) {
deleteWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body();
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name 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 deleteAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback);
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable deleteAsync(String resourceGroupName, String serviceName) {
return deleteWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
Observable> observable = service.delete(resourceGroupName, serviceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void beginDelete(String resourceGroupName, String serviceName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body();
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name 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 beginDeleteAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback);
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable beginDeleteAsync(String resourceGroupName, String serviceName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serviceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.beginDelete(resourceGroupName, serviceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginDeleteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.register(202, new TypeToken() { }.getType())
.register(204, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateLinkServiceInner object if successful.
*/
public PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body();
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name 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 getByResourceGroupAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback);
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable getByResourceGroupAsync(String resourceGroupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, PrivateLinkServiceInner>() {
@Override
public PrivateLinkServiceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
final String expand = null;
return service.getByResourceGroup(resourceGroupName, serviceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateLinkServiceInner object if successful.
*/
public PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName, expand).toBlocking().single().body();
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param expand Expands referenced resources.
* @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 getByResourceGroupAsync(String resourceGroupName, String serviceName, String expand, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName, expand), serviceCallback);
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable getByResourceGroupAsync(String resourceGroupName, String serviceName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceName, expand).map(new Func1, PrivateLinkServiceInner>() {
@Override
public PrivateLinkServiceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the specified private link service by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serviceName, String expand) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.getByResourceGroup(resourceGroupName, serviceName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateLinkServiceInner object if successful.
*/
public PrivateLinkServiceInner createOrUpdate(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).toBlocking().last().body();
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service 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 createOrUpdateAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters), serviceCallback);
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).map(new Func1, PrivateLinkServiceInner>() {
@Override
public PrivateLinkServiceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName 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 = "2019-11-01";
Observable> observable = service.createOrUpdate(resourceGroupName, serviceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateLinkServiceInner object if successful.
*/
public PrivateLinkServiceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).toBlocking().single().body();
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service 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 beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters), serviceCallback);
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).map(new Func1, PrivateLinkServiceInner>() {
@Override
public PrivateLinkServiceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates an private link service in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param parameters Parameters supplied to the create or update private link service operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateLinkServiceInner object
*/
public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName 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 = "2019-11-01";
return service.beginCreateOrUpdate(resourceGroupName, serviceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.register(201, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Gets all private link services in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList<PrivateLinkServiceInner> object if successful.
*/
public PagedList listByResourceGroup(final String resourceGroupName) {
ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all private link services in a resource group.
*
* @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all private link services in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateLinkServiceInner> object
*/
public Observable> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all private link services in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateLinkServiceInner> object
*/
public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
return listByResourceGroupSinglePageAsync(resourceGroupName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all private link services in a resource group.
*
ServiceResponse> * @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PrivateLinkServiceInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Gets all private link service in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList<PrivateLinkServiceInner> object if successful.
*/
public PagedList list() {
ServiceResponse> response = listSinglePageAsync().toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all private link service in a subscription.
*
* @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> listAsync(final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all private link service in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateLinkServiceInner> object
*/
public Observable> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all private link service in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateLinkServiceInner> object
*/
public Observable>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all private link service in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PrivateLinkServiceInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateEndpointConnectionInner object if successful.
*/
public PrivateEndpointConnectionInner getPrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) {
return getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).toBlocking().single().body();
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @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 getPrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName), serviceCallback);
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable getPrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName) {
return getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).map(new Func1, PrivateEndpointConnectionInner>() {
@Override
public PrivateEndpointConnectionInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable> getPrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String serviceName, String peConnectionName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (peConnectionName == null) {
throw new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
final String expand = null;
return service.getPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getPrivateEndpointConnectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateEndpointConnectionInner object if successful.
*/
public PrivateEndpointConnectionInner getPrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName, String expand) {
return getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, expand).toBlocking().single().body();
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param expand Expands referenced resources.
* @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 getPrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, String expand, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, expand), serviceCallback);
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable getPrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, String expand) {
return getPrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, expand).map(new Func1, PrivateEndpointConnectionInner>() {
@Override
public PrivateEndpointConnectionInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Get the specific private end point connection by specific private link service in the resource group.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable> getPrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String serviceName, String peConnectionName, String expand) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (peConnectionName == null) {
throw new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.getPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getPrivateEndpointConnectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getPrivateEndpointConnectionDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Approve or reject private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param parameters Parameters supplied to approve or reject the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PrivateEndpointConnectionInner object if successful.
*/
public PrivateEndpointConnectionInner updatePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters) {
return updatePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, parameters).toBlocking().single().body();
}
/**
* Approve or reject private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param parameters Parameters supplied to approve or reject the private end point connection.
* @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 updatePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(updatePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, parameters), serviceCallback);
}
/**
* Approve or reject private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param parameters Parameters supplied to approve or reject the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable updatePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters) {
return updatePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName, parameters).map(new Func1, PrivateEndpointConnectionInner>() {
@Override
public PrivateEndpointConnectionInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Approve or reject private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @param parameters Parameters supplied to approve or reject the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PrivateEndpointConnectionInner object
*/
public Observable> updatePrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (peConnectionName == null) {
throw new IllegalArgumentException("Parameter peConnectionName 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 = "2019-11-01";
return service.updatePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = updatePrivateEndpointConnectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse updatePrivateEndpointConnectionDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) {
deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).toBlocking().last().body();
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @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 deletePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName), serviceCallback);
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable deletePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName) {
return deletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> deletePrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String serviceName, String peConnectionName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (peConnectionName == null) {
throw new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
Observable> observable = service.deletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
public void beginDeletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) {
beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).toBlocking().single().body();
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @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 beginDeletePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName), serviceCallback);
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable beginDeletePrivateEndpointConnectionAsync(String resourceGroupName, String serviceName, String peConnectionName) {
return beginDeletePrivateEndpointConnectionWithServiceResponseAsync(resourceGroupName, serviceName, peConnectionName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Delete private end point connection for a private link service in a subscription.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @param peConnectionName The name of the private end point connection.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable> beginDeletePrivateEndpointConnectionWithServiceResponseAsync(String resourceGroupName, String serviceName, String peConnectionName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (peConnectionName == null) {
throw new IllegalArgumentException("Parameter peConnectionName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.beginDeletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginDeletePrivateEndpointConnectionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginDeletePrivateEndpointConnectionDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.register(202, new TypeToken() { }.getType())
.register(204, new TypeToken() { }.getType())
.registerError(ErrorException.class)
.build(response);
}
/**
* Gets all private end point connections for a specific private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList<PrivateEndpointConnectionInner> object if successful.
*/
public PagedList listPrivateEndpointConnections(final String resourceGroupName, final String serviceName) {
ServiceResponse> response = listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listPrivateEndpointConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all private end point connections for a specific private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name 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> listPrivateEndpointConnectionsAsync(final String resourceGroupName, final String serviceName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listPrivateEndpointConnectionsNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all private end point connections for a specific private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateEndpointConnectionInner> object
*/
public Observable> listPrivateEndpointConnectionsAsync(final String resourceGroupName, final String serviceName) {
return listPrivateEndpointConnectionsWithServiceResponseAsync(resourceGroupName, serviceName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all private end point connections for a specific private link service.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<PrivateEndpointConnectionInner> object
*/
public Observable>> listPrivateEndpointConnectionsWithServiceResponseAsync(final String resourceGroupName, final String serviceName) {
return listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listPrivateEndpointConnectionsNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all private end point connections for a specific private link service.
*
ServiceResponse> * @param resourceGroupName The name of the resource group.
ServiceResponse> * @param serviceName The name of the private link service.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listPrivateEndpointConnectionsSinglePageAsync(final String resourceGroupName, final String serviceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serviceName == null) {
throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2019-11-01";
return service.listPrivateEndpointConnections(resourceGroupName, serviceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listPrivateEndpointConnectionsDelegate(response);
return Observable.just(new ServiceResponse