com.azure.resourcemanager.healthdataaiservices.implementation.PrivateEndpointConnectionsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-healthdataaiservices Show documentation
Show all versions of azure-resourcemanager-healthdataaiservices Show documentation
This package contains Microsoft Azure SDK for Health Data AI Services Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.healthdataaiservices.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.healthdataaiservices.fluent.PrivateEndpointConnectionsClient;
import com.azure.resourcemanager.healthdataaiservices.fluent.models.PrivateEndpointConnectionResourceInner;
import com.azure.resourcemanager.healthdataaiservices.implementation.models.PrivateEndpointConnectionResourceListResult;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient.
*/
public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient {
/**
* The proxy service used to perform REST calls.
*/
private final PrivateEndpointConnectionsService service;
/**
* The service client containing this operation class.
*/
private final HealthDataAIServicesClientImpl client;
/**
* Initializes an instance of PrivateEndpointConnectionsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
PrivateEndpointConnectionsClientImpl(HealthDataAIServicesClientImpl client) {
this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for HealthDataAIServicesClientPrivateEndpointConnections to be used by
* the proxy service to perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "HealthDataAIServices")
public interface PrivateEndpointConnectionsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deidServiceName") String deidServiceName,
@PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
@HeaderParam("accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> create(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deidServiceName") String deidServiceName,
@PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
@HeaderParam("accept") String accept,
@BodyParam("application/json") PrivateEndpointConnectionResourceInner resource, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deidServiceName") String deidServiceName,
@PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
@HeaderParam("accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByDeidService(
@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deidServiceName") String deidServiceName, @HeaderParam("accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByDeidServiceNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, Context context);
}
/**
* Get a specific private connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a specific private connection along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String deidServiceName, String privateEndpointConnectionName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, deidServiceName, privateEndpointConnectionName,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a specific private connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a specific private connection along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String deidServiceName, String privateEndpointConnectionName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, deidServiceName, privateEndpointConnectionName, accept, context);
}
/**
* Get a specific private connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a specific private connection on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
return getWithResponseAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a specific private connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a specific private connection along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName,
String deidServiceName, String privateEndpointConnectionName, Context context) {
return getWithResponseAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, context).block();
}
/**
* Get a specific private connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a specific private connection.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PrivateEndpointConnectionResourceInner get(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
return getWithResponse(resourceGroupName, deidServiceName, privateEndpointConnectionName, Context.NONE)
.getValue();
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createWithResponseAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
if (resource == null) {
return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
} else {
resource.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, deidServiceName, privateEndpointConnectionName,
accept, resource, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createWithResponseAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
if (resource == null) {
return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
} else {
resource.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, deidServiceName, privateEndpointConnectionName, accept, resource, context);
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, PrivateEndpointConnectionResourceInner>
beginCreateAsync(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName,
PrivateEndpointConnectionResourceInner resource) {
Mono>> mono
= createWithResponseAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource);
return this.client.getLroResult(
mono, this.client.getHttpPipeline(), PrivateEndpointConnectionResourceInner.class,
PrivateEndpointConnectionResourceInner.class, this.client.getContext());
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, PrivateEndpointConnectionResourceInner>
beginCreateAsync(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName,
PrivateEndpointConnectionResourceInner resource, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createWithResponseAsync(resourceGroupName, deidServiceName,
privateEndpointConnectionName, resource, context);
return this.client.getLroResult(
mono, this.client.getHttpPipeline(), PrivateEndpointConnectionResourceInner.class,
PrivateEndpointConnectionResourceInner.class, context);
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, PrivateEndpointConnectionResourceInner>
beginCreate(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName,
PrivateEndpointConnectionResourceInner resource) {
return this.beginCreateAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource)
.getSyncPoller();
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, PrivateEndpointConnectionResourceInner>
beginCreate(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName,
PrivateEndpointConnectionResourceInner resource, Context context) {
return this
.beginCreateAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource, context)
.getSyncPoller();
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource) {
return beginCreateAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource, Context context) {
return beginCreateAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PrivateEndpointConnectionResourceInner create(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource) {
return createAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource).block();
}
/**
* Create a Private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param resource Resource create parameters.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return holder for private endpoint connections.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PrivateEndpointConnectionResourceInner create(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource, Context context) {
return createAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, resource, context)
.block();
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, deidServiceName, privateEndpointConnectionName,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
if (privateEndpointConnectionName == null) {
return Mono.error(new IllegalArgumentException(
"Parameter privateEndpointConnectionName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, deidServiceName, privateEndpointConnectionName, accept, context);
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
return this.beginDeleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName).getSyncPoller();
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, Context context) {
return this.beginDeleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, context)
.getSyncPoller();
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName) {
return beginDeleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String deidServiceName,
String privateEndpointConnectionName, Context context) {
return beginDeleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName) {
deleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName).block();
}
/**
* Delete the private endpoint connection.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
* resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String deidServiceName, String privateEndpointConnectionName,
Context context) {
deleteAsync(resourceGroupName, deidServiceName, privateEndpointConnectionName, context).block();
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByDeidServiceSinglePageAsync(String resourceGroupName, String deidServiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByDeidService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, deidServiceName, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByDeidServiceSinglePageAsync(String resourceGroupName, String deidServiceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (deidServiceName == null) {
return Mono
.error(new IllegalArgumentException("Parameter deidServiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByDeidService(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, deidServiceName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByDeidServiceAsync(String resourceGroupName,
String deidServiceName) {
return new PagedFlux<>(() -> listByDeidServiceSinglePageAsync(resourceGroupName, deidServiceName),
nextLink -> listByDeidServiceNextSinglePageAsync(nextLink));
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByDeidServiceAsync(String resourceGroupName,
String deidServiceName, Context context) {
return new PagedFlux<>(() -> listByDeidServiceSinglePageAsync(resourceGroupName, deidServiceName, context),
nextLink -> listByDeidServiceNextSinglePageAsync(nextLink, context));
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByDeidService(String resourceGroupName,
String deidServiceName) {
return new PagedIterable<>(listByDeidServiceAsync(resourceGroupName, deidServiceName));
}
/**
* List private endpoint connections on the given resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deidServiceName The name of the deid service.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByDeidService(String resourceGroupName,
String deidServiceName, Context context) {
return new PagedIterable<>(listByDeidServiceAsync(resourceGroupName, deidServiceName, context));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByDeidServiceNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByDeidServiceNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByDeidServiceNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByDeidServiceNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}