com.azure.resourcemanager.applicationinsights.implementation.ComponentsClientImpl Maven / Gradle / Ivy
Show all versions of azure-resourcemanager-applicationinsights Show documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.applicationinsights.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.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
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.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.applicationinsights.fluent.ComponentsClient;
import com.azure.resourcemanager.applicationinsights.fluent.models.ApplicationInsightsComponentInner;
import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentPurgeResponseInner;
import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentPurgeStatusResponseInner;
import com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentListResult;
import com.azure.resourcemanager.applicationinsights.models.ComponentPurgeBody;
import com.azure.resourcemanager.applicationinsights.models.TagsResource;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in ComponentsClient. */
public final class ComponentsClientImpl implements ComponentsClient {
/** The proxy service used to perform REST calls. */
private final ComponentsService service;
/** The service client containing this operation class. */
private final ApplicationInsightsManagementClientImpl client;
/**
* Initializes an instance of ComponentsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ComponentsClientImpl(ApplicationInsightsManagementClientImpl client) {
this.service =
RestProxy.create(ComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ApplicationInsightsManagementClientComponents to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ApplicationInsightsM")
private interface ComponentsService {
@Headers({"Content-Type: application/json"})
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights"
+ "/components")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}")
@ExpectedResponses({200, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> delete(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> createOrUpdate(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@BodyParam("application/json") ApplicationInsightsComponentInner insightProperties,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Patch(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> updateTags(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@BodyParam("application/json") TagsResource componentTags,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}/purge")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> purge(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@BodyParam("application/json") ComponentPurgeBody body,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components"
+ "/{resourceName}/operations/{purgeId}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getPurgeStatus(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceName") String resourceName,
@PathParam("purgeId") String purgeId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get("{nextLink}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listNext(
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get("{nextLink}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept,
Context context);
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
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."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), 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()));
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(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."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription as paginated response with {@link
* PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription as paginated response with {@link
* PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
return new PagedIterable<>(listAsync());
}
/**
* Gets a list of all Application Insights components within a subscription.
*
* @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 list of all Application Insights components within a subscription as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
return new PagedIterable<>(listAsync(context));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(
String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
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()));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(
String resourceGroupName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group as paginated response with {@link
* PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(
() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group as paginated response with {@link
* PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(
String resourceGroupName, Context context) {
return new PagedFlux<>(
() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* Gets a list of Application Insights components within a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 list of Application Insights components within a resource group as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(
String resourceGroupName, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Deletes an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 resourceName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.delete(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 resourceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
accept,
context);
}
/**
* Deletes an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 resourceName) {
return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap(ignored -> Mono.empty());
}
/**
* Deletes an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 resourceName) {
deleteAsync(resourceGroupName, resourceName).block();
}
/**
* Deletes an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) {
return deleteWithResponseAsync(resourceGroupName, resourceName, context).block();
}
/**
* Returns an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(
String resourceGroupName, String resourceName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Returns an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(
String resourceGroupName, String resourceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
accept,
context);
}
/**
* Returns an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 an Application Insights component definition on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(
String resourceGroupName, String resourceName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Returns an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 an Application Insights component definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationInsightsComponentInner getByResourceGroup(String resourceGroupName, String resourceName) {
return getByResourceGroupAsync(resourceGroupName, resourceName).block();
}
/**
* Returns an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component 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 an Application Insights component definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(
String resourceGroupName, String resourceName, Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block();
}
/**
* Creates (or updates) an Application Insights component. Note: You cannot specify a different value for
* InstrumentationKey nor AppId in the Put operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param insightProperties Properties that need to be specified to create an Application Insights component.
* @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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(
String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (insightProperties == null) {
return Mono
.error(new IllegalArgumentException("Parameter insightProperties is required and cannot be null."));
} else {
insightProperties.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.createOrUpdate(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
insightProperties,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creates (or updates) an Application Insights component. Note: You cannot specify a different value for
* InstrumentationKey nor AppId in the Put operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param insightProperties Properties that need to be specified to create an Application Insights component.
* @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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(
String resourceGroupName,
String resourceName,
ApplicationInsightsComponentInner insightProperties,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (insightProperties == null) {
return Mono
.error(new IllegalArgumentException("Parameter insightProperties is required and cannot be null."));
} else {
insightProperties.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.createOrUpdate(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
insightProperties,
accept,
context);
}
/**
* Creates (or updates) an Application Insights component. Note: You cannot specify a different value for
* InstrumentationKey nor AppId in the Put operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param insightProperties Properties that need to be specified to create an Application Insights component.
* @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 an Application Insights component definition on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(
String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) {
return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, insightProperties)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Creates (or updates) an Application Insights component. Note: You cannot specify a different value for
* InstrumentationKey nor AppId in the Put operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param insightProperties Properties that need to be specified to create an Application Insights component.
* @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 an Application Insights component definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationInsightsComponentInner createOrUpdate(
String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) {
return createOrUpdateAsync(resourceGroupName, resourceName, insightProperties).block();
}
/**
* Creates (or updates) an Application Insights component. Note: You cannot specify a different value for
* InstrumentationKey nor AppId in the Put operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param insightProperties Properties that need to be specified to create an Application Insights component.
* @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 an Application Insights component definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createOrUpdateWithResponse(
String resourceGroupName,
String resourceName,
ApplicationInsightsComponentInner insightProperties,
Context context) {
return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, insightProperties, context).block();
}
/**
* Updates an existing component's tags. To update other fields use the CreateOrUpdate method.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param componentTags Updated tag information to set into the component instance.
* @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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateTagsWithResponseAsync(
String resourceGroupName, String resourceName, TagsResource componentTags) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (componentTags == null) {
return Mono.error(new IllegalArgumentException("Parameter componentTags is required and cannot be null."));
} else {
componentTags.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.updateTags(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
componentTags,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Updates an existing component's tags. To update other fields use the CreateOrUpdate method.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param componentTags Updated tag information to set into the component instance.
* @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 an Application Insights component definition along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateTagsWithResponseAsync(
String resourceGroupName, String resourceName, TagsResource componentTags, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (componentTags == null) {
return Mono.error(new IllegalArgumentException("Parameter componentTags is required and cannot be null."));
} else {
componentTags.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.updateTags(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
componentTags,
accept,
context);
}
/**
* Updates an existing component's tags. To update other fields use the CreateOrUpdate method.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param componentTags Updated tag information to set into the component instance.
* @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 an Application Insights component definition on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateTagsAsync(
String resourceGroupName, String resourceName, TagsResource componentTags) {
return updateTagsWithResponseAsync(resourceGroupName, resourceName, componentTags)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Updates an existing component's tags. To update other fields use the CreateOrUpdate method.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param componentTags Updated tag information to set into the component instance.
* @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 an Application Insights component definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationInsightsComponentInner updateTags(
String resourceGroupName, String resourceName, TagsResource componentTags) {
return updateTagsAsync(resourceGroupName, resourceName, componentTags).block();
}
/**
* Updates an existing component's tags. To update other fields use the CreateOrUpdate method.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param componentTags Updated tag information to set into the component instance.
* @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 an Application Insights component definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateTagsWithResponse(
String resourceGroupName, String resourceName, TagsResource componentTags, Context context) {
return updateTagsWithResponseAsync(resourceGroupName, resourceName, componentTags, context).block();
}
/**
* Purges data in an Application Insights component by a set of user-defined filters.
*
* In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch
* the execution of purge requests by sending a single command whose predicate includes all user identities that
* require purging. Use the in operator to specify multiple identities. You should run the query prior to using for
* a purge request to verify that the results are expected.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param body Describes the body of a request to purge data in a single table of an Application Insights component.
* @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 response containing operationId for a specific purge action along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> purgeWithResponseAsync(
String resourceGroupName, String resourceName, ComponentPurgeBody body) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.purge(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
body,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Purges data in an Application Insights component by a set of user-defined filters.
*
* In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch
* the execution of purge requests by sending a single command whose predicate includes all user identities that
* require purging. Use the in operator to specify multiple identities. You should run the query prior to using for
* a purge request to verify that the results are expected.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param body Describes the body of a request to purge data in a single table of an Application Insights component.
* @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 response containing operationId for a specific purge action along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> purgeWithResponseAsync(
String resourceGroupName, String resourceName, ComponentPurgeBody body, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.purge(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
body,
accept,
context);
}
/**
* Purges data in an Application Insights component by a set of user-defined filters.
*
* In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch
* the execution of purge requests by sending a single command whose predicate includes all user identities that
* require purging. Use the in operator to specify multiple identities. You should run the query prior to using for
* a purge request to verify that the results are expected.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param body Describes the body of a request to purge data in a single table of an Application Insights component.
* @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 response containing operationId for a specific purge action on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono purgeAsync(
String resourceGroupName, String resourceName, ComponentPurgeBody body) {
return purgeWithResponseAsync(resourceGroupName, resourceName, body)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Purges data in an Application Insights component by a set of user-defined filters.
*
* In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch
* the execution of purge requests by sending a single command whose predicate includes all user identities that
* require purging. Use the in operator to specify multiple identities. You should run the query prior to using for
* a purge request to verify that the results are expected.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param body Describes the body of a request to purge data in a single table of an Application Insights component.
* @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 response containing operationId for a specific purge action.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ComponentPurgeResponseInner purge(String resourceGroupName, String resourceName, ComponentPurgeBody body) {
return purgeAsync(resourceGroupName, resourceName, body).block();
}
/**
* Purges data in an Application Insights component by a set of user-defined filters.
*
*
In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch
* the execution of purge requests by sending a single command whose predicate includes all user identities that
* require purging. Use the in operator to specify multiple identities. You should run the query prior to using for
* a purge request to verify that the results are expected.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param body Describes the body of a request to purge data in a single table of an Application Insights component.
* @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 response containing operationId for a specific purge action along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response purgeWithResponse(
String resourceGroupName, String resourceName, ComponentPurgeBody body, Context context) {
return purgeWithResponseAsync(resourceGroupName, resourceName, body, context).block();
}
/**
* Get status for an ongoing purge operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
* @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 status for an ongoing purge operation along with {@link Response} on successful completion of {@link
* Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getPurgeStatusWithResponseAsync(
String resourceGroupName, String resourceName, String purgeId) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (purgeId == null) {
return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getPurgeStatus(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
purgeId,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get status for an ongoing purge operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
* @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 status for an ongoing purge operation along with {@link Response} on successful completion of {@link
* Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getPurgeStatusWithResponseAsync(
String resourceGroupName, String resourceName, String purgeId, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName 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 (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (purgeId == null) {
return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null."));
}
final String apiVersion = "2020-02-02";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getPurgeStatus(
this.client.getEndpoint(),
resourceGroupName,
apiVersion,
this.client.getSubscriptionId(),
resourceName,
purgeId,
accept,
context);
}
/**
* Get status for an ongoing purge operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
* @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 status for an ongoing purge operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getPurgeStatusAsync(
String resourceGroupName, String resourceName, String purgeId) {
return getPurgeStatusWithResponseAsync(resourceGroupName, resourceName, purgeId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get status for an ongoing purge operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
* @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 status for an ongoing purge operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ComponentPurgeStatusResponseInner getPurgeStatus(
String resourceGroupName, String resourceName, String purgeId) {
return getPurgeStatusAsync(resourceGroupName, resourceName, purgeId).block();
}
/**
* Get status for an ongoing purge operation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
* @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 status for an ongoing purge operation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getPurgeStatusWithResponse(
String resourceGroupName, String resourceName, String purgeId, Context context) {
return getPurgeStatusWithResponseAsync(resourceGroupName, resourceName, purgeId, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @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 describes the list of Application Insights Resources along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(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.listNext(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 nextLink parameter.
* @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 describes the list of Application Insights Resources along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(
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
.listNext(nextLink, this.client.getEndpoint(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @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 describes the list of Application Insights Resources along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(
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.listByResourceGroupNext(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 nextLink parameter.
* @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 describes the list of Application Insights Resources along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(
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
.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
}